This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I'am wondering if anybody knows if the connection closes that was used to retrieve a ResultSet, does the ResultSet also close. Can you continue to use a ResultSet after the connection that retrieved the ResultSet closes?
hi there... the ResultSet implementation is very tied with the Connection object that created it. The ResultSet object exsits as long as the Connection Object does. Oneway around this is to make use of a RowSet Object. The RowSet class is an extension of the Statement class; thus it inherits all the capabilities provided in its super class. A RowSet Object caches its ResultSet and also the necessary information to re-establish the connection again. This means that they are serializable!.
Joined: Sep 29, 2002
The ResultSet object exsits as long as the Connection Object does.
The Connection API documentation does not support this statement. It is possible that some JDBC driver providers may implement this facility, but a developer cannot write portable code on the basis of proprietary features.
The RowSet class is an extension of the Statement class