try {
// Load the properties file to get the connection information.
Properties prop = TestSample.loadParams("Connection");
// Create a OracleDataSource instance.
OracleDataSource ods = new OracleDataSource();
// Set the driver type.
ods.setDriverType("thin");
// Set the database server name.
ods.setServerName((String)prop.get("HostName"));
// Set the database name.
ods.setDatabaseName((String)prop.get("SID"));
// Set the port number.
ods.setPortNumber(new Integer((String)prop.get("Port")).intValue());
// Set the user name.
ods.setUser((String)prop.get("UserName"));
// Set the password.
ods.setPassword((String)prop.get("Password"));
// Create a connection object.
conn = ods.getConnection();
} catch(SQLException ex) { // Trap SQL errors.
System.out.println("Error in Connecting to the Database "+'\n'+
ex.toString());
} catch(IOException ex) { // Trap IO errors.