When we close a connection (connectionobject.close()), will the statements and resultsets automatically get closed..? Or, do we have to close statements and resultsets explicitly..?
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
Yes, they will all close too, since they depend on the connection. It's advisable to close your statement & resultset separately though. ------------------ Bosun SCJP for the Java� 2 Platform
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Stanley Tan
Ranch Hand
Joined: May 17, 2001
Posts: 243
posted
0
I also believe there's a way to use disconnected ResultSets such that if the connection is closed the ResultSet can still be used. Am I right?
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
The resultse is a pointer to a row(s) that match the criteria. You will need to put your rows in some kind of collection such an ArrayList, if you want to access it when the connection is closed. There could be another way that I am not aware of. ------------------ Bosun SCJP for the Java� 2 Platform