有jsp查询数据库,已经使用rs.next(),为什么执行到rs.next()之后就显示无效游标??急急急!!!!
<%Connectionconn=null;try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");StringstrConn...
<%
Connection conn=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String strConn="jdbc:odbc:shopData";
String strUser="sa";
String strPassword="";
conn=DriverManager.getConnection(strConn,strUser,strPassword);
Statement stmt=conn.createStatement();
String s_id=Bytes(request.getParameter("s_id"));
String strSql="select * from renwushu where s_id='"+s_id+"'";
ResultSet rs=stmt.executeQuery(strSql);
%>
<%while(rs.next())%>
任务书<br>
姓名:<input type="text" name="a" value="<%=rs.getString("s_name") %>">
学号:<input type="text" name="b" value="<%=rs.getString("s_id") %>"><br> 展开
Connection conn=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String strConn="jdbc:odbc:shopData";
String strUser="sa";
String strPassword="";
conn=DriverManager.getConnection(strConn,strUser,strPassword);
Statement stmt=conn.createStatement();
String s_id=Bytes(request.getParameter("s_id"));
String strSql="select * from renwushu where s_id='"+s_id+"'";
ResultSet rs=stmt.executeQuery(strSql);
%>
<%while(rs.next())%>
任务书<br>
姓名:<input type="text" name="a" value="<%=rs.getString("s_name") %>">
学号:<input type="text" name="b" value="<%=rs.getString("s_id") %>"><br> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询