i have a sql query be executed up to thousand times, the only change
is the where clause value change, so each time i need to create a
statement to execute query, before create statement, do i need to close
last time opened resultset and statement ? Please advice.
Second Question is how to return a resultSet from a function ? Does the ResultSet Object gets destroyed once we exit the function or we need to
explicitly close it. The same is question for Statement Object.
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();// Do i need to close this.
ResultSet ltemprs= lstmt.executeQuery(selopen); //Do i neet to close this
}
[ March 12, 2004: Message edited by: Bear Bibeault ]