日期:2014-05-18  浏览次数:20790 次

java.sql.SQLException: 异常 不晓得怎么回事情?郁闷
错误如下:
java.sql.SQLException:   Incorrect   integer   value:   'null '   for   column   'UserNumber '   at   row   1
at   com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at   com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2822)
at   com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1536)
at   com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1626)
at   com.mysql.jdbc.Connection.execSQL(Connection.java:3025)
at   com.mysql.jdbc.Statement.executeUpdate(Statement.java:1147)
at   com.mysql.jdbc.Statement.executeUpdate(Statement.java:1070)
at   org.apache.jsp.AddUser_jsp._jspService(AddUser_jsp.java:77)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at   java.lang.Thread.run(Thread.java:595)


------解决方案--------------------
'UserNumber ' 为null了,这个字段数据库的设计可能不允许为null
------解决方案--------------------
debug一下
看看出错的时候strUserNumber值是什么