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

[1331 byte] By [lareds] at [2007-9-26 5:29:30]
# 1
Hi,you should tell us what happens on your machine.Exception? Which? Thrown where?False results? Which?Also we might have to look at that class DBConnection. Can you post it?
Hartmut at 2007-6-29 19:39:04 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
i get a java.io.IOException saying the batch file cannot be found
lareds at 2007-6-29 19:39:04 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
When? At which line of code in which class?Unless you post the code, how can anybody know what your program does?
Hartmut at 2007-6-29 19:39:04 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...