Guest_imported
New member
- Jan 1, 1970
- 0
Hi
From some reasons I am getting ResouldSet is close error in JRun 3 when I running jsp page which is calling one method in bean class file. Help !
here is 1 line that is calling been from jsp page.
while (rs.next())
{
..............
............
.....
details = db.catdetails(catid); //here crashes i don't know why!!
..........
....
}
and here is my been method that extract forum category infos.
. Please help i have spend 2 week trying to figure out what is wrong wit it,
and why i am getting Record Set close exception. THANK YOU VERY MUCH!!
public String[] catdetails (int id) throws SQLException
{
//Creating array to hold all the details for the category record
String[] details = new String[3];
Statement sstmt = con.createStatement();
//Query for total toppics for this category
rs = sstmt.executeQuery("SELECT COUNT(*) AS Topics FROM Thread WHERE ID_category="+id+""
//Retriving the value of query from result set
if (rs.next())
{
details[0] = rs.getString(1);
}
//Query for date of last message posted and it's creator.
rs = sstmt.executeQuery("SELECT * FROM Message AS m1 WHERE m1.Date IN (SELECT MAX(m2.DATE) FROM Message m2 WHERE m2.ID_thread IN (SELECT ID_thread FROM Thread WHERE id_category="+id+")"
if (rs.next())
{
//details[1] = (rs.getDate("Date").toString();
details[1] = rs.getString("Date"
details[2] = rs.getString("User_ID"
}
return details;
}
From some reasons I am getting ResouldSet is close error in JRun 3 when I running jsp page which is calling one method in bean class file. Help !
here is 1 line that is calling been from jsp page.
while (rs.next())
{
..............
............
.....
details = db.catdetails(catid); //here crashes i don't know why!!
..........
....
}
and here is my been method that extract forum category infos.
. Please help i have spend 2 week trying to figure out what is wrong wit it,
and why i am getting Record Set close exception. THANK YOU VERY MUCH!!
public String[] catdetails (int id) throws SQLException
{
//Creating array to hold all the details for the category record
String[] details = new String[3];
Statement sstmt = con.createStatement();
//Query for total toppics for this category
rs = sstmt.executeQuery("SELECT COUNT(*) AS Topics FROM Thread WHERE ID_category="+id+""
//Retriving the value of query from result set
if (rs.next())
{
details[0] = rs.getString(1);
}
//Query for date of last message posted and it's creator.
rs = sstmt.executeQuery("SELECT * FROM Message AS m1 WHERE m1.Date IN (SELECT MAX(m2.DATE) FROM Message m2 WHERE m2.ID_thread IN (SELECT ID_thread FROM Thread WHERE id_category="+id+")"
if (rs.next())
{
//details[1] = (rs.getDate("Date").toString();
details[1] = rs.getString("Date"
details[2] = rs.getString("User_ID"
}
return details;
}