dcsimg
Is it possbible to open 2 ResultSet ???
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, April 7, 2003 02:05 PM

Im always getting this error : Connection is busy with results for another hstmt. My code: ResultSet rs1 = OpenResultSet("SELECT * FROM Table1"); ResultSet rs2 = OpenResultSet("SELECT * FROM Table2 "WHERE sName = '" + rs1.getString("sName") + "'"); public ResultSet OpenResultSet(String sSQL, Connection cn){ ResultSet rs = null; boolean bData = true; try{ Statement stmt = cn.createStatement(); rs = stmt.executeQuery(sSQL); bData=rs.next(); } catch(SQLException ex){ //inherited   More>>

Im always getting this error : Connection is busy with results for another hstmt.


My code:


ResultSet rs1 = OpenResultSet("SELECT * FROM Table1");


ResultSet rs2 = OpenResultSet("SELECT * FROM Table2
"WHERE sName =
'" + rs1.getString("sName") + "'");


public ResultSet OpenResultSet(String sSQL, Connection cn){


ResultSet rs = null;


boolean bData = true;


try{


Statement stmt = cn.createStatement();


rs = stmt.executeQuery(sSQL);


bData=rs.next();


}


catch(SQLException ex){


//inherited from another class


objGCn.TraiterSQLException(ex);



}


return rs;


}



If someone can help me...:)

   <<Less

Re: Is it possbible to open 2 ResultSet ???

Posted By:   Jeanne_Boyarsky  
Posted On:   Monday, April 7, 2003 05:39 PM

I don't think you can have two resultsets open from the same connection. If you had two connections to the database, you could do this.
About | Sitemap | Contact