"com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed."
this is the code for the method
public synchronized ResultSet getTimings(String strDate, String strDoctor)
throws SQLException
{
try{
String SQL = "select time_slots from dbo.Timing"
+ " where timing_id not in " + " ("
+ " select timing_id from dbo.Appointment "
+ " inner join Staff on dbo.Appointment.staff_id = dbo.Staff.staff_id"
+ " where dbo.Appointment.staff_id = '" + strDoctor
+ "' and appt_date = '" + strDate
+ "' and active_or_deleted=1" + " )"; //sql query
System.out.println(SQL);
rs = stmt.executeQuery(SQL); //Resultset object containing query result
return rs; //return result set
}
catch(SQLException e)
{
e.printStackTrace();
return null;
}
}
any suggestions on how to solve this error. i found one where i have to create a new connection each time i want to use it but is there a better way of handling this??

New Topic/Question
Reply


MultiQuote






|