主题:jsp页面数据库问题
String sql="select * from line where lineid='"+id+"' and room_ID='"+room_ID+"'";
ResultSet rs=query.executeQuery(sql);
if(rs.next()){
node.setLineid(rs.getString("lineid"));
node.setLinepre(rs.getString("linepre"));
node.setLinenext(rs.getString("linenext"));
treeView.creatTree(node);
String sql_2 = "select count( * ) as num from line where linenext='"+ node.getLinepre() + "' and room_ID='"+room_ID+"'";
ResultSet rs_2 = query.executeQuery(sql_2);
[color=FF0000]rs_2.getString("num");[/color]
String sql_1="select * from line where linenext='"+node.getLinepre() + "' and room_ID='"+room_ID+"'";
ResultSet rs_1=query.executeQuery(sql_1);
while (rs.next()) {
lineid = rs_1.getString("lineid");
linepre = rs_1.getString("linepre");
linenext = rs_1.getString("linenext");
我想去出count(*)的值,该怎么取,为什么红色一行会出现以下错误:
javax.servlet.ServletException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态
ResultSet rs=query.executeQuery(sql);
if(rs.next()){
node.setLineid(rs.getString("lineid"));
node.setLinepre(rs.getString("linepre"));
node.setLinenext(rs.getString("linenext"));
treeView.creatTree(node);
String sql_2 = "select count( * ) as num from line where linenext='"+ node.getLinepre() + "' and room_ID='"+room_ID+"'";
ResultSet rs_2 = query.executeQuery(sql_2);
[color=FF0000]rs_2.getString("num");[/color]
String sql_1="select * from line where linenext='"+node.getLinepre() + "' and room_ID='"+room_ID+"'";
ResultSet rs_1=query.executeQuery(sql_1);
while (rs.next()) {
lineid = rs_1.getString("lineid");
linepre = rs_1.getString("linepre");
linenext = rs_1.getString("linenext");
我想去出count(*)的值,该怎么取,为什么红色一行会出现以下错误:
javax.servlet.ServletException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态