疯了 疯了!!!~~~ 快来救我~~~~~~
exception
org.apache.jasper.JasperException: Exception in JSP: /chklogin.jsp:11
8: String sql = "SELECT * FROM userpassword WHERE USER_ID= ' "+userid+ " ' AND USER_PASSWORD= ' "+password+ " ' ";
9: DBSQLManager dbsm = new DBSQLManager();
10: dbsm.setsqlstr(sql);
11: dbsm.executequery();
12: ResultSet rs = dbsm.getrs();
13: if (!rs.next())
14: {
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:467)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NullPointerException shell.DBSQLManager.executequery(DBSQLManager.java:59)
org.apache.jsp.chklogin_jsp._jspService(chklogin_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
下面是相关的文件.
package shell;
import java.sql.*;
import shell.*;
public class DBSQLManager
{
protected Connection conn=null;
protected Statement stmt=null;
protected ResultSet rs=null;
protected String sqlstr;
public DBSQLManager()
{
try
{
sqlstr= " ";
DBConnectionManager dcm=new DBConnectionManager();
conn=dcm.getconnection();
stmt=conn.createStatement();
}
catch (Exception e)
{
e.printStackTrace();
}
}
public Statement getstmt()
{
return stmt;
}
public Connection getconn()
{
return conn;
}
public ResultSet getrs()
{
return rs;
}
public void setsqlstr(String newsqlstr)
{
this.sqlstr=newsqlstr;
}
public String getsqlstr()
{
return sqlstr;
}
public void executequery() throws Exception
{
rs=stmt.executeQuery(sqlstr);
}
public void execeteupdate() throws Exception
{
stmt.executeUpdate(sqlstr);
}
public void close() throws
JAVAMAIL如何使用代理发送邮件