Saturday, October 6, 2012


//Connecting to DB2 database while reading properties from file
import java.beans.Statement;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.*;


public class ConnectingDb {


//Establishing connection
Statement statement=null;
//Connection connection = getConnection();
public Connection  getConnection() throws ClassNotFoundException, SQLException
{
Properties prop = new Properties();
try{
prop.load(new FileInputStream("./conf/Db.properties"));
}
catch (Exception e){
}
Class.forName (prop.getProperty("DriverName"));
Connection  connection = DriverManager.getConnection(prop.getProperty("ConnectionURL"),prop.getProperty("Username"),prop.getProperty("Password"));
System. out .println( "From DAO, connection obtained " );
return connection;
//statement = connection.createStatement();
}

}




Tuesday, May 22, 2012

Connecting LoadRunner 11.0 Analysis to MS SQLServer 2008


Installing and configuring MSDE

Installing MS SQLServer 2008 Enterprise Edition
Make sure that below screens are followed while installing SQLServer 2008


Setting up MSDE database:
1. Reboot the machine after the install.
2. Share the data folder that is located in the MSDE installation folder (Example: C:\MSSQL2008\MSSQL10.MSSQLSERVER\MSSQL\DATA)
3. Launch the Analysis.
4. Go to Tool -> Options -> Database.
5. Select the "SQL server/MSDE" radio button and fill in the following information:


Server details
Server Name: Enter the machine name for the Server.
User Name: The default is sa. You can change this to a username/password that has Administrator privileges.
Password: There is no password by default. You can change this to a username/password that has Administrator privileges.
Use Windows Integrated Security: Select the check-box.


Shared Folder Details
Shared Folder Path: Enter the server name and shared folder name.
Example:
"\\PAC0223\Data\" where PAC0223 is a host name where the SQLServer is installed and "Data" is a folder under
C:\MSSQL2008\MSSQL10.MSSQLSERVER\MSSQL which is shared as per point 2 above.
Local Folder path: Enter the actual location of the "Data" folder mentioned in the above example.
Example: C:\MSSQL2008\MSSQL10.MSSQLSERVER\MSSQL\DATA

6. Click on "Test Parameters" and make sure that all the options have been selected without any error.
7. If you have problems connecting, select the "Use Windows Integrated Security" option and try again.

Issue with solution



Problem
While configuring LR Analysis to use MS SQL Server ( Tools > Options > Database ) the following error appears: : "Synchronizing shared and physical directoes" failed.

Cause

Incorrect path has been added to shared folder on MSQL Server

Fix
Physical path was missing at the end of share folder details
Example: C:\MSSQL\Data