java.sql exception,rs.next() ..nested queries
Posted on 2003-03-01
I have a problem with java.sql.I am getting an Invalid handle exception for nested result sets ...
//Conn is the common connection
Statement s1 = conn.createStatement();
rs1 = s1.executeQuery(query1);
Statement s2 = conn.createStatement();
The rs2 resultset works fine,but when it gets back into the outer while loop the exception is thrown.
I know that the problem is becuase the nested statements are usign the same connection.
I know of two ways to work around this
(1) use different connections
(2) remove nesting (save the result rs1,and then retrieve rs2)
But I wnated to know if anyone knows of any other way to work around this problem.
let me know.