jsp编译有问题,大家帮我看看

sbk 2005-08-01 10:31:40
为什么我的java程序能正常编译和运行,而到jsp中就报下面错误,我已经把<%@page import="java.sql.*"%>写了啊,问大虾我这是什么错误啊,怎么解决?



Error: 500
Location: /mmscount/manage/hh.jsp
Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:25: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement stmt = null;
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:28: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement stmt1 = null;
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:122: Class <>Statement not found in =.
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:122: Incompatible type for =. Can't convert java.sql.Statement to <>Statement.
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:123: Class <>Statement not found in =.
stmt1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:123: Incompatible type for =. Can't convert java.sql.Statement to <>Statement.
stmt1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:125: Class <>Statement not found in void _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
RS=stmt.executeQuery(sql);
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:155: Class <>Statement not found in void _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
RS2=stmt1.executeQuery("select * from mmsqdh where qdh='"+RS.getString("cpid")+"'");
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:256: Class <>Statement not found in void _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
RS1=stmt.executeQuery("select * from mmssub_dz where mphoneno='"+telephone+"'");
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:280: Class <>Statement not found in void _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
RS3=stmt1.executeQuery("select * from mmsqdh where qdh='"+RS1.getString("channel")+"'");
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:379: Class <>Statement not found in void _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
stmt.close();
^
D:\tomcat\work\localhost_8080%2Fmmscount\_0002fmanage_0002fhh_0002ejsphh_jsp_0.java:380: Class <>Statement not found in void _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
stmt1.close();
^
12 errors, 1 warning

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:247)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:536)

...全文
61 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shenpipi 2005-08-01
  • 打赏
  • 举报
回复
java.beans.Statement and java.sql.Statement,编译器弄不清楚你要使用哪个Statement。更改你的import。或者用java.sql.Statement st=XXX来声明你的Statement
zhz586 2005-08-01
  • 打赏
  • 举报
回复
2个包的问题

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧