• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fetch out of sequence

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
### 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
 
Naveen Sydney
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to let you know:
This is a bug with the dll that bea shipped with service pack 3. So please contact bea for a fresh copy of weblogicoci37.dll
Regards
Naveen Sydney
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic