Skip to content
Advertisement

Returning ResultSet without close?

I would like to have a database connection managing class which I can use for simple SQL commands like SELECT, INSERT etc. by simple calling something like this (class below):

JavaScript

This is class I’ve found on web:

JavaScript

Is this way of returning ResultSet without closing it (and closing the statement) right? How can I return the ResultSet from the method?

Advertisement

Answer

Returning result set is not a good idea. So,fetch the required data and make use of collection to return the data. This answer may be useful

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement