if rs.nextorg.apache.jasper.JasperException:An exception occurred processing JSP page /admin/Acheck.jsp at line 1613:14:String sql="select * from cqut_admin where Id='"+login+"' and Password='"+password+"'";15:ResultSet rs=con.executeQuery(sql);16:if

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 23:15:58

if rs.nextorg.apache.jasper.JasperException:An exception occurred processing JSP page /admin/Acheck.jsp at line 1613:14:String sql="select * from cqut_admin where Id='"+login+"' and Password='"+password+"'";15:ResultSet rs=con.executeQuery(sql);16:if
if rs.next
org.apache.jasper.JasperException:An exception occurred processing JSP page /admin/Acheck.jsp at line 16
13:
14:String sql="select * from cqut_admin where Id='"+login+"' and Password='"+password+"'";
15:ResultSet rs=con.executeQuery(sql);
16:if(rs.next()){
17:session.setAttribute("login",login);
18:response.sendRedirect("index.htm");
19:}else{
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:426)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NullPointerException
org.apache.jsp.admin.Acheck_jsp._jspService(Acheck_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
空指针异常?怎么解决呢?
----------是不是需要用con创建个Statement或PreparedStatement对象,再用这个对象执行executeQuery?
package com.bwm.db;
import java.sql.*;
public class Condb{
String servername="localhost";
String drivername="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url="jdbc:microsoft:sqlserver://servername:1433;DatabaseName=cqut;user=sa;password=123;";
Connection con=null;
ResultSet rs=null;
public Condb(){ //数据库连接
try{
Class.forName(drivername);
}catch(java.lang.ClassNotFoundException e){
System.err.println(e.getMessage());
}
}
这只是个连接的代码,太多发不起!
import 了该bean,但是还是出上面的错.

if rs.nextorg.apache.jasper.JasperException:An exception occurred processing JSP page /admin/Acheck.jsp at line 1613:14:String sql="select * from cqut_admin where Id='"+login+"' and Password='"+password+"'";15:ResultSet rs=con.executeQuery(sql);16:if
是不是需要用con创建个Statement或PreparedStatement对象,再用这个对象执行executeQuery? Statement stat = con.createStatement(); ResultSet rs = stat.executeQuery(sql); 记得即使没取到数据rs也不是空来着.你的con如果是Connection的话就创建个Statement或PreparedStatement对象.最好把封装的代码也发下. 把ResultSet rs=con.executeQuery(sql);改成上面两句试过了没啊?

if rs.nextorg.apache.jasper.JasperException:An exception occurred processing JSP page /admin/Acheck.jsp at line 1613:14:String sql=select * from cqut_admin where Id='+login+' and Password='+password+';15:ResultSet rs=con.executeQuery(sql);16:if if rs.eof or rs.bof then 和if rs.eof and rs.bof 它们一样不? if(rs.next())里next是什么意思 if(rs.next())里next是什么意思 rs.next 问题if(rs.next()){ rs.first();}else { dos.writeUTF(false); } while(rs.next()) { String result = rs.getString(3)+rs.getString(4)+rs.getString(5)+rs.getString(6); dos.writeUTF( If Not (rs.BOF And rs.为什么他的值是0呢?应该是1啊! 详解if(rs.next())与while(rs.next())各自的用途和区别 n=0 for m=1 to rs.PageSize if rs.EoF then exit for IF Not Rs.Bof [asp]asp里的.IF Not Rs.Bof Set Rs = Conn.Execute(Select * From Nt_Imgbook)IF Not Rs.Bof ThentitleIDArr = 全部商品1ElsetitleIDArr = 全部商品2End IFresponse.write titleIDArr 看看这个代码里的 exit for for 1= 1 to rs.recordcount //rs为一个记录集.Rs.movenextif Rs.eof then exit fornext end if 请问当rs.eof为真时执行 exit for next if not rs.eof rs.open sql,connif not rs.eof thensession(isadm)=admelsesession(isadm)=userend if这里面rs.eof是对数据库查询结果作如何判断? 谁能详细解释asp中if not rs.eof and not rs.bof then怎么理解? 如题,特别是倒数第二句,不知道为什么要那么写.function ftpbase(rs)dim lklk = ftp:// & rs(ftpuser) & : & rs(ftppass)& @ &rs(ftpserver)if(rs(ftpport) 21) then lk = lk & : & rs(ftpport)nowftpid = rs(ftpid)ftpbase = l rs.next是布尔值,while(rs.next)和if(rs.next)有什么区别四楼说的:第一个RS.NEXT总是真的.因为它是从第一个之前开始的.好像不对吧, 在DAO类中,if(rs.next()) 和while(rs.next())的区别,是按什么条件来判断采用if 还是while的, '分页判断开始 page_=100 Rs.Pagesize = page_ Zongtiao = int(Rs.Recordcount):Zongye = int(Rs.PageCoun'分页判断开始page_=100Rs.Pagesize = page_Zongtiao = int(Rs.Recordcount):Zongye = int(Rs.PageCount)if Gets(page) then NowPage = InputURL if one day we are not tobether rs rlsowith the same if not rs.我看到解释是RS的游标是否为尾部,什么是游标,在谁的尾部啊,患有个BOF这俩什么意思啊