Wednesday, August 14, 2013

JAVA FAQ's

1. Rounding of a double value to 2 digits.

-- Double TempTentSec = 0.0;
    TempTentSec = 111.0;
    TempTentSec = Math.round(TempTentSec * 100.0) / 100.0;

(Similarly to round of at 0 places:- Multiply & divide by 1.0)

2. Removing decimals without rounding off the double value.

-- TempTentSec = (double)Math.floor(TempTentSec);

Thursday, July 18, 2013

Oracle Synonym


Following query is to automatically update table data in one database based on changes in another database.

sql>create public synonym AMM_PRODUCTS_PHARMA for ALAB.AMM_PRODUCTS_PHARMA;

sql>create or replace
TRIGGER AMM_PRODUCTS_TRIGGER
after insert on APHARMA.AMM_PRODUCTS for each row
begin
insert into AMM_PRODUCTS_PHARMA
(PRD_ID,
PRD_GENERIC_NAME,
PRD_SHORT_DESC,
PRD_DESC
) values
(:new.PRD_ID,
:new.PRD_GENERIC_NAME,
:new.PRD_SHORT_DESC,
:new.PRD_DESC
);
end;

sql>create public synonym AMT_PROD_STOCK_DETAILS_PHARMA for ALAB.AMT_PROD_STOCK_DETAILS_PHARMA;

sql>create or replace trigger amm_prod_stock_details_trigger
after insert  on APHARMA.AMT_PROD_STOCK_DETAILS for each row
begin
 insert into AMT_PROD_STOCK_DETAILS_PHARMA
 (PRS_SEQ_NO,
PRS_DOC_DATE,
PRS_PER_ID,
PRS_CPY_ID
) values
(:new.PRS_SEQ_NO,
:new.PRS_DOC_DATE,
:new.PRS_PER_ID,
:new.PRS_CPY_ID
);
end;

-- By Mr. Nitesh Ghosalkar

Thursday, July 11, 2013

Entering sequence no in column of table already having data in SQL


  alter table AMM_PROD_DRUG_LICENCE add pdl_seq_no NUMBER(19,0);

update AMM_PROD_DRUG_LICENCE set pdl_Seq_no=1;

CREATE SEQUENCE pdl_sequence_no_seq
  START WITH 1
  INCREMENT BY 1
  CACHE 50;

UPDATE AMM_PROD_DRUG_LICENCE
   SET pdl_seq_no = pdl_sequence_no_seq.nextval;

Wednesday, July 3, 2013

Spring Roo Files



There are many different types of files used in Spring Roo project having various code to perform task:-

1.] .java files - These can be the domain class files, controller files, service files, Exception class files.

2.] .aj files - These are aspect java files and are automatically created by Spring Roo project for a particular domain class after running 'web mvc all <pkg_name>' command in Roo Shell.

3.] .jspx files - These are the view components of MVC framework for the project. These files can be used to create report search screens as well.

4.] .properties files -
(a.) database.properties - It contains the username, password, database name, IP address etc.,
(b.) ReportDS.properties - We can write information about the IP address, database, tables to connect to retrieve data to display on reports.
(c.) application.properties - We can put error codes with messages in this file. It also consists of label name for various labels in .jspx pages.

5.] .tagx -

6.] .tld - birt.tld file is used to integrate BIRT reporting tool in STS. It's full form is Tag library descriptor.

7.] .xml -

8.] .rptdesign files - These are the report design files. It has information of columns datatypes and validations with queries for BIRT reports.


Tuesday, March 19, 2013

Installing IP messenger in FEDORA OS


Steps to install IP messenger on Fedora terminal:-

tar -xzvf g2ipmsg-0.9.5.tar.gz

It is important to install the dependencies before we proceed.  On your terminal, as a root user, type:

yum install perl-XML-Parser libgnomeui-devel libpanelappletmm-devel gettext intltool

then type the following series of (familiar) commands to build and install ipmsg.

cd g2ipmsg-0.9.5

./configure --disable-applet

make

make install

then run it

g2ipmsg

You can download the IP messenger from following site:-
http://www.codeforge.com/dlpre/4510/7988031f22bb.tar.gz__.html 

Thursday, March 14, 2013

XPath



-- XPath, the XML Path Language, is a query language for selecting nodes from an XML document.

Example:-
<input name="username"/>
<input name="password"/>
<input name="submit" and @type="submit" and @value="submit"/>

XPaths of above fields are as follows
//input[@name='username']
//input[@name='password']
//input[@name='submit' and @type='submit']

Use sendKeys() for setting values to textboxes.
Use click() to perform click action on any control on webpage.

Following is the WebDriver Java code to use the above XPaths to login:-
WebDriver driver = new InternetExplorerDriver();
WebElement element;
driver.get("http://www.dummyUrl.com");
element = driver.findElement(By.xpath("//input[@name='username']"));
element.setText("admin");
element = driver.findElement(By.xpath("//input[@name='password']"));
element.setText("pass@123");
element = driver.findElement(By.xpath("//input[@name='submit' and @type='submit']"));
element.click();

VSS


Microsoft Visual SourceSafe (VSS) is a source control software package oriented towards small software development projects. Like most source control systems, SourceSafe creates a virtual library of computer files.

-- Install .Net Framework and VSS (Visual SourceSafe).

-- Create users who want to access & be allowed to edit these files in VSS & assign passwords to them.

-- Create a project in VSS & folders.

-- Add files in the respective folders by choosing working folders.

-- Right-click on file & select 'Get latest version' to get the read-only copy of latest version of a file.

-- Right-click on file & select 'Check-out' to get the writable copy of latest version of a file.

-- Right-click on file & select 'Check-in' to upload the copy of latest version of a file.

-- Files not required can be deleted from VSS & then can be removed from local working folder also.

-- It is not possible for multiple users to check-out copy of same file at a time.

Link to download VSS:-
http://www.microsoft.com/en-us/download/details.aspx?id=291