| Author |
Change of statements!
|
manjit singh thakurratan
Greenhorn
Joined: Dec 23, 2009
Posts: 10
|
|
Hi
The sequence for closing connections in a jdbc driven program is
ResultSet.close
Statement.close
Connection.close
What might be the consequences if I close the connection first!? ??
Thnx
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26168
|
|
Manjit,
Welcome to JavaRanch!
If you close the connection first, the statement and result set are invalid. They may or may not get closed depending on your driver. They may or may not throw an exception when you try to close them; also depending on your driver. I advise you not to code that way as the results can be unpredictable.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Change of statements!
|
|
|