Re: Cursor usage for Oracle JDBC classes12

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: Sat, 26 Feb 2000 18:52:16 GMT
Message-ID: <38B8210F.847FA795_at_rationalconcepts.com>


Hi Wil,
  do you also close the resultset?

try {
      Statement s = con.createStatement();
      ResultStatement rs = s.executeQuery("select ....");

      while (rs.next()) {
        //process the answers
     }
      rs.close;
      s.close;
}
catch (SQLException e) {}
...

cindy

Wil Weterings wrote:

I recently switch from using the classes111 jdbc 1.0 (jdk 1.1) driver to the
classes12  2.0 driver for jdk1.2.

I am developing a JDBC based program that opens the database connection and
issue SQL statements based on the open connection. It seems that the
classes12 driver opens database cursors en keeps the cursor open until I
close the database connection and that is not what I want.

I close the statements based on the connection with no result.  It seems as
long as the connection is open the database cursor are not closed. Is this a
bug ?

I could change the program to close and reopen the connection for every
query I want to do, but it seem like overkill.

Is it possible to close the cursors that are no longer used.

Wil.

Please respond to my E-mail weterings_at_schiphol.nl

Received on Sat Feb 26 2000 - 19:52:16 CET

Original text of this message