### Detailed Problem Statement: ###
We are using the JDriver that comes with weblogic 6.1 to access Oracle9i
database. The
java version is 1.3 and
jdbc version is 2.0.
The connection pool is created sucessfully. When trying to execute the query
the following error is generated. The error is the same for all types of
queries such as select count(*) from emp.
### What were you trying to accomplish when the problem occurred? ###
Here is my code:
Connection connection = null;
int retries = DbConnection.getDbPoolRetries();
while ((connection == null) && (retries > 0)) {
try {
Properties props = new Properties();
props.put("user", "stage1");
props.put("password", "interasset");
props.put("server", "ORCL_STAGE.INTERASSET.COM");
java.sql.Driver driver = (java.sql.Driver)
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
connection = driver.connect("jdbc:weblogic
racle", props);
connection.setAutoCommit(false);
} catch (Exception e) {
connection = null;
retries--;
try {
Thread.currentThread().sleep(DbConnection.getDbPoolRetryDelay());
} catch (InterruptedException ie) {
}
}
}
if (connection == null) {
throw new Exception("Couldn't get connection, static data is not loaded.");
}
try {
Connection connection = getConnection();
Statement statement = connection.createStatement();
ResultSet rs =
statement.executeQuery("select count(*) from emp");
statement.close();
connection.close();
} catch (Exception e) {
log.error("Unable to get count.", e);
}
}
### The step-by-step actions which preceded the problem: ###
Weblogic started
Connection Pool created
Driver Loaded
Connection got to connection pool
statement.executeQuery throws error
Could someone tell me what I need to change. As a reminder the code was working with oracle thin driver b4 i started messing with the OCI driver