connecting to DB
Hi All,
import java.io.*;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.SQLException;
import InsureSuite.db.DBClass;
import InsureSuite.db.DBConnection;
public class testDB{
public static void main(String arg[])
{
ResultSet rs = null;
Connection conn = null;
Statement stmt =null;
DBClass db = new DBClass(); //initialising connection pool etc.,
try
{
conn = DBConnection.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery("select count(*) from QT_CONSUMER");
while(rs.next()){
System.out.println(rs.getString(1));
}
}
catch(Exception e){
System.out.println("Exception in main " +
e.getMessage());
}
finally{
try{
if(stmt != null)
stmt.close();
if(rs!=null)
rs.close();
DBConnection.freeConnection(conn);
db =null;
}catch(Exception e){}
}
}
}
The above code which is simply opening a connection and executing a SQL stmt which runs fine on other machines,
but not on mine. Any specific reason? I have
win2000 and we use oracle thin driver.
thanks,
lareds

