Quantcast
Channel: Java, ResultSet.close(), PreparedStatement.close() -- what for? - Stack Overflow
Browsing all 6 articles
Browse latest View live

Answer by JonnyRaa for Java, ResultSet.close(), PreparedStatement.close() --...

Its a bit of crap Api - ends up with you writing a load of boiler plate code.I reckon the best way to go is wrap the classes and make it so that disposing the connection disposes the other stuff (as...

View Article



Answer by Tom Anderson for Java, ResultSet.close(), PreparedStatement.close()...

The javadoc for Statement#close() says:Note:When a Statement object is closed, its current ResultSet object, if one exists, is also closed.So you don't need to worry about closing ResultSets, as long...

View Article

Answer by darioo for Java, ResultSet.close(), PreparedStatement.close() --...

A connection to the database isn't the only thing your application is tying up. There are other resources at stake.They will get freed up at some point in time if you don't release them yourself, but...

View Article

Answer by gabuzo for Java, ResultSet.close(), PreparedStatement.close() --...

I'm pretty sure closing the connection will close the associated Statements, ResultSets and other associated objects. However all this will consume resources on both the client and may be on the...

View Article

Answer by Sanjay T. Sharma for Java, ResultSet.close(),...

AFAIK, you'll end up exhausting resources on your database server due to tied up file handles, resources needed for holding the result set associated with a given statement etc. There might be smart...

View Article


Java, ResultSet.close(), PreparedStatement.close() -- what for?

In my web-application, i make extensive use of a database. I have an abstract servlet, from which all the servlets that need a database connection, inherit. That abstract servlet creates a database...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images