日期:2014-05-17  浏览次数:20850 次

createStatement出错
我的代码在其他电脑上可以用,但本机上就出现下面的错误,是哪里的错误?
XML code

HTTP Status 500 - 

--------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: An exception occurred processing JSP page /zqwu/stinfos.jsp at line 28

25: catch(SQLException e){
26: out.println("Connection database fail!");
27: }
28: Statement stmt=conn.createStatement();
29: ResultSet result=stmt.executeQuery("select * from studentsinfo");
30: %>
31: <p></p>


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause 

java.lang.NullPointerException
    org.apache.jsp.zqwu.stinfos_jsp._jspService(stinfos_jsp.java:81)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.





------解决方案--------------------
把你jsp中的代码贴出来看看。。。
------解决方案--------------------
完事了散分吧。
------解决方案--------------------
一看就知道是connection为null
我的异常网推荐解决方案:An exception occurred processing JSP page,http://www.aiyiweb.com/j2se/33144.html
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html