• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet issue!!!!!!!!

 
Gorakshanath Pandey
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
Currently faced with a unique problem. I have a huge database
and i am querying it while looping it through another
resultset . The problem is that it gives a runtime error
if i use multiple conditions in the where clause but runs
perfectly for each of the condition. Plz help
temprs=SelQuery(SelStmt,con);
ResultSet dtrs;
String dtsql;
while(temprs.next())
{
String selopen="select count(*) from mast "
+" where reg_cd =" + "'" + temprs.getString("reg_cd ")+ "'"
+" and f_cmr = 'T' and closed_pms_dt between " + "'" + temprs.getDate("st_date") + "'" + " and " +"'" + temprs.getDate("ed_date") + "'";
Statement lstmt = con.createStatement();
ResultSet ltemprs= lstmt.executeQuery(selopen);

}
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the Exception you are getting?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try doing a System.out.println(selopen) to see what it thinks the SQL string is. Then you cut and paste it into your database to get a more precise description of the problem.
Also, are you closing the statement/resultset between queries?
[ March 11, 2004: Message edited by: Jeanne Boyarsky ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic