troubleshooting Question

URGENT: JDBC: Can I close statement before using result set?

Avatar of gustnado
gustnado asked on
DatabasesOracle DatabaseJava
7 Comments1 Solution989 ViewsLast Modified:
In JDBC, if a statement is closed from which a result set was acquired, is the result set still valid?

Context: I have inherited a big java app. At a low level it has a method that creates a statement, does a query returning a result set, and returns the result set. The statement is left dangling (not closed, not referenced) and repeated calls to this are eating up all the memory in a big Informix server. A close on the statement was added to that method to get rid of the statement resource. One connection is used for hundreds of thousands of calls, so these resources accumulate on the connection.

Is it valid to close the statement and then use the result set, or is the result set dependent on the statement still being open?

The database is Informix.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros