首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

createStatement出错,该如何处理

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

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

XML code
HTTP Status 500 - --------------------------------------------type Exception reportmessage 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 2825: 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.myexception.cn/j2se/33144.html
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html

热点排行