dbTalk Databases Forums  

Oracle JDBC driver's limitations

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Oracle JDBC driver's limitations in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
as
 
Posts: n/a

Default Oracle JDBC driver's limitations - 05-26-2005 , 12:54 AM






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();
}



Reply With Quote
  #2  
Old   
HansF
 
Posts: n/a

Default Re: Oracle JDBC driver's limitations - 05-26-2005 , 01:53 AM






On Thu, 26 May 2005 13:54:18 +0800, as interested us by writing:

Quote:
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.
It also has some benefits that the manual describes. You just gotta find
your balance point <g>

Quote:
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.
I'm not sure what is vague about the following statement, from Chapter 19
of the online JDBC Developer's Guide and Reference from docs.oracle.com ...

-------------
The Oracle JDBC drivers do not have finalizer methods. They perform
cleanup routines by using the close() method of the ResultSet and
Statement classes. If you do not explicitly close your result set and
statement objects, significant memory leaks can occur.
------------

--
Hans Forbrich
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com
*** I no longer assist with top-posted newsgroup queries ***


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.