aspose file tools
The moose likes JDBC and the fly likes ResultSet.close() Vs Connection.close() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "ResultSet.close() Vs Connection.close()" Watch "ResultSet.close() Vs Connection.close()" New topic
Author

ResultSet.close() Vs Connection.close()

Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245
Hi guys

Does anybody know what the difference between these to methods is?

ResultSet.close() and Connection.close() ??

I use them interchangebbly, would this have an adverse effect on my app in anayway??

Thanks in advance for your thoughts,

Regards
Zein
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
In a properly written JDBC driver, Connection.close() will close any open Statement or ResultSet objects that were opened on that Connection, before closing the connection itself. ResultSet.close() will merely close the ResultSet, leaving open any Statement or Connection above it.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: ResultSet.close() Vs Connection.close()
 
Similar Threads
Doubt while closing connection.
JDBC connection problem
java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
java.sql.SQLException: No available resource. Wait-time expired.
Change of statements!