Hello Everyone,
I have an issue with resultset.
I am executing one query and gettign the resultset and passing that resultset to another method where i am traversing through the resultset.
When i iterate through the resultset i am getting exception
my code looks like:
//classOne
void methonone(){
String query="select * from tablenmae";
Connection.createstatement();//created the connection
Statement stmt = con.createStatement();//created the statement
ResultSet rsRows=stmt.executeQuery(query);//getting the result
methodtwo(rsRows)
}
// classTwo
void methodtwo(ResultSet rs){
rs.next()//throws an exception.
}
The exception is :
com.ibm.db2.jcc.b.SqlException: [jcc][t4][10120][10898][3.52.110] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
I dont really know why the resultset is closed...
i would really appreciate if some one can help me out...
Thanks,
swati