Hi,
I have some code that I run in a JSP that breaks with the above error, but
works ok in a standalone Java Program. Could this be a bug in DB2 / JDBC ?
I've installed the latest DB2 fixpack (8). - Or is there something about
running in a servlet that causes the problem?
thanks
RG
------------------------------------------
code ---------------------------------
java.sql.Connection jc = SetupDatasource.getConnection(application);
ResultSet rs2 = null;
Statement stmt2 = null;
try
{
stmt2 = jc.createStatement();
String sql = "SELECT ... FROM ..." ;
rs2 = stmt2.executeQuery(sql);
while (rs2.next())
{
if (rs2.getObject("PT_ID") != null)
{
%><TR> <TD>FEA <TD><%=rs2.getString("PROJ_NAME")%><%
Statement stmt3 = null ;
ResultSet rs3 = null;
try
{
String sql3 = "SELECT * FROM MYTAB2 WHERE PT_ID=" + rs2.getString("ID") +
" and pt_pt_mesh_rc = 0";
stmt3 = jc.createStatement();
rs3 = stmt3.executeQuery(sql3);
while (rs3.next())
{
%><TD><%=rs3.getString("TITLE")%></TD><%
}
}
finally
{
if (rs3 != null) rs3.close(); // ** COMMENTING OUT BOTH OF THESE REMOVES
PROBLEM
if (stmt3 != null) stmt3.close(); // ** COMMENTING OUT BOTH OF THESE
REMOVES PROBLEM
}
}
Object o = rs2.getObject("S_ID") ; // ******************* EXCEPTION THROWN
HERE ***********************, only when rs3 was open
if (rs2.getObject("S_ID") != null)
{
%><TR><TD><%=rs2.getString("PROJ_NAME")%></TR><%
}
}
}
finally
{
if (rs2 != null) rs2.close();
if (stmt2 != null) stmt2.close();
}
jc.close();