当前位置: 技术问答>java相关
大家帮忙看看是什么错误?
来源: 互联网 发布时间:2017-03-16
本文导语: 我写的代码 提示错误: description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 18...
我写的代码
提示错误:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 18 in the jsp file: /jconn2.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:Program FilesApache GroupTomcat 4.1workStandalonelocalhost_jconn2_jsp.java:59: incompatible types
found : int
required: java.sql.ResultSet
rs=stmt.executeUpdate("insert into qin(id,name) values('123','绉?)");
^
1 error
是什么原因???
提示错误:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 18 in the jsp file: /jconn2.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:Program FilesApache GroupTomcat 4.1workStandalonelocalhost_jconn2_jsp.java:59: incompatible types
found : int
required: java.sql.ResultSet
rs=stmt.executeUpdate("insert into qin(id,name) values('123','绉?)");
^
1 error
是什么原因???
|
检查字段类型
估计你的id是int
---》
rs=stmt.executeUpdate("insert into qin(id,name) values(123,'秦')");//‘123’->123
估计你的id是int
---》
rs=stmt.executeUpdate("insert into qin(id,name) values(123,'秦')");//‘123’->123
|
rs=stmt.executeUpdate("insert into qin(id,name) values('123','秦')");
这句错了,改成
stmt.executeUpdate("insert into qin(id,name) values('123','秦')");
这句错了,改成
stmt.executeUpdate("insert into qin(id,name) values('123','秦')");
|
executeUpdate的返回类型是int(返回被改变的记录总数),而不是ResultSet
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。