I made a static method for executing the queries like this below
(this is in ServerProcess class)
public static ResultSet insertRow(Connection conn, String query){
PreparedStatement pstmt = conn.prepareStatement(query);
ResultSet rs = pstmt.executeQuery();
pstmt.close();
return rs;
}
and trying to get & use the resultset from here
ResultSet rs = ServerProcess.insertRow(conn, query)
while(rs.next()){
String nameOfEachOne = rs.getString("MEMBER_NAME");
System.out.println(nameOfEachOne);
}
But, as far as I know, once statement(or preparedstatement) closed, resultset would be bound to get closed as a knock-on consequences.
I would like to use it in this way somehow, but I can't figure out how to do it. Is there any possible ways to get information set after the statement closed ?