M
Marc E
NOTE: I first posted this to comp.lang.java.databases but then saw that list
doesn't get much action. Please excuse the crosspost.
Now, then:
We typically keep our database methods in classes separate from our business
logic, and normally when we run, say, "getMyQueryStuff(blah)" that method
converts the resultset to a bean using apache commons DBUtils. But
sometimes, we just want to work with the resultset directly, as in returning
the resultset itself to the calling class; problem is, as far as I can tell,
you then can't close your connection pool in the database method, so that
connection is now left unreturned to the pool. Sure, the calling class can
close the resultset when it's finished with it, but that doesn't act on the
connection.
So...how do you usually deal with this? Are there any packages out there
that basicallly take a resultset and decouple it from the connection so that
the connection can be returned to the pool and the resultset can be returned
to the caller? Or are there better ways?
Thanks a lot.
doesn't get much action. Please excuse the crosspost.
Now, then:
We typically keep our database methods in classes separate from our business
logic, and normally when we run, say, "getMyQueryStuff(blah)" that method
converts the resultset to a bean using apache commons DBUtils. But
sometimes, we just want to work with the resultset directly, as in returning
the resultset itself to the calling class; problem is, as far as I can tell,
you then can't close your connection pool in the database method, so that
connection is now left unreturned to the pool. Sure, the calling class can
close the resultset when it's finished with it, but that doesn't act on the
connection.
So...how do you usually deal with this? Are there any packages out there
that basicallly take a resultset and decouple it from the connection so that
the connection can be returned to the pool and the resultset can be returned
to the caller? Or are there better ways?
Thanks a lot.