Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JSP in Tomcat !!!

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I am trying to run my jsp in tomcat3.2.1 but getting an internal servlet error. If i am writing any JSP without doing any database related thing my jsp is running fine but when i try to get it connected to a databse it gives this error. I am using oracle8i:
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPD:\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fSimplejdbc_0002ejspSimplejdbc_jsp_0.java:79: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement st=con.createStatement();
^
D:\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fSimplejdbc_0002ejspSimplejdbc_jsp_0.java:80: Class jsp.resultSet not found.
resultSet rs=st.executeQuery("Select ename,job,salary,deptno from EMP");
^
D:\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fSimplejdbc_0002ejspSimplejdbc_jsp_0.java:114: Variable st may not have been initialized.
st.close();
^
3 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:247)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:440)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:411)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
at org.apache.tomcat.core.Handler.service(Handler.java:261)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:720)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:194)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Unknown Source)
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

org.apache.jasper.JasperException: Unable to compile class for JSPD:\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fSimplejdbc_0002ejspSimplejdbc_jsp_0.java:79: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement st=con.createStatement();
^
D:\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fSimplejdbc_0002ejspSimplejdbc_jsp_0.java:80: Class jsp.resultSet not found.
resultSet rs=st.executeQuery("Select ename,job,salary,deptno from EMP");
^
D:\jakarta-tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fSimplejdbc_0002ejspSimplejdbc_jsp_0.java:114: Variable st may not have been initialized.
st.close();


I would fully qualify the declaration of Statement st in:
Statement st=con.createStatement();
Use the correct class name in
resultSet rs = ...
Bill
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant converstaions take place. Bill could have used his time to answer another question that had not already been answered. I've requested this topic be closed. Please refer to the JSP forum for any further disucssion.
 
I'm full of tinier men! And a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic