主题:如何解决无效的游标状态 ?
<%
Statement stat=conn.createStatement();
ResultSet rs=null;
String errorcode=new String();
String content=new String();
String name=new String();
String gettime=new String();
String id=request.getParameter("id");
String strSql="select * from Liuyan where serial_no="+id;
try{
rs=stat.executeQuery(strSql);
rs.next();
content=rs.getString("content");
name=rs.getString("name");
gettime=rs.getString("guest_time");
}catch(Exception e){
errorcode=e.toString();
out.println("<BR>DEBUG:"+errorcode);
}finally{
rs.close();
stat.close();
conn.close();
}
%>
为何总提示:DEBUG:java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态 ?如何解决?
Statement stat=conn.createStatement();
ResultSet rs=null;
String errorcode=new String();
String content=new String();
String name=new String();
String gettime=new String();
String id=request.getParameter("id");
String strSql="select * from Liuyan where serial_no="+id;
try{
rs=stat.executeQuery(strSql);
rs.next();
content=rs.getString("content");
name=rs.getString("name");
gettime=rs.getString("guest_time");
}catch(Exception e){
errorcode=e.toString();
out.println("<BR>DEBUG:"+errorcode);
}finally{
rs.close();
stat.close();
conn.close();
}
%>
为何总提示:DEBUG:java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态 ?如何解决?