Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle JDBC driver's limitations

Oracle JDBC driver's limitations

From: as <none_at_asgmeail.com>
Date: Thu, 26 May 2005 13:54:18 +0800
Message-ID: <429564ce$1_3@rain.i-cable.com>


I read the book and manual on oracle's jdbc driver, and it SEEMS to suggest that oracle's driver has some extra limitations. However, the description is not clear enough so I just want to double check here.

I am using Oracle 9i R2.

In the following code, my understanding is oracle requries the rs.close() and pstmt.close() must be present. Is it true? The online documentation vaguely suggested that because the driver doesnt have a finalizer() so the user must explicitly close ResultSet and Statement. And, I do come across such an example in another Oracle jdbc textbook.

Normally, I would like to put the pstmt=con.prepareStatement(sql); before the for loop and do pstmt.close() in finally block and ignore rs.close() altogether. This should be the standard practice. Is it applicable to Oracle 9iR2?

for (...) {

        pstmt=con.prepareStatement(sql);
        pstmt.setInt(1, someLoopVar);
        rs=pstmt.executeQuery();

        if (rs.next()) {
          ....
        }
        rs.close();
        pstmt.close();

} Received on Thu May 26 2005 - 00:54:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US