are custom classes imported API included in .class files?
Posted
by
kyrogue
on Stack Overflow
See other posts from Stack Overflow
or by kyrogue
Published on 2011-01-09T09:40:44Z
Indexed on
2011/01/09
9:53 UTC
Read the original article
Hit count: 256
i have a question, i have a custom class which imports java.sql.; and i am creating a jsp page, in the jsp page, i did a page import of the custom class , however when i tried to call my custom class database methods it cant work. only when i did a page import of java.sql. did it work. so are custom classes imported API included in .class files?
An error occurred at line: 6 in the jsp file: /resetpw.jsp
Statement cannot be resolved to a type
3:
4: <%
5: db.connect();
6: Statement stmt = db.getConnection().createStatement();
7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts");
8:
9:
An error occurred at line: 7 in the jsp file: /resetpw.jsp
ResultSet cannot be resolved to a type
4: <%
5: db.connect();
6: Statement stmt = db.getConnection().createStatement();
7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts");
8:
9:
10:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:319)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.31 logs.
edited. added what error will come up if i did not do a page import of java.sql.*;
© Stack Overflow or respective owner