当前位置: 技术问答>java相关
请问这段访问数据库代码如何错了?
来源: 互联网 发布时间:2015-06-20
本文导语: ----------------------------------- Error: 500 Location: /index.jsp Internal Servlet Error: org.apache.jasper.compiler.ParseException: D:index.jsp(0,4) Invalid directive at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java, Compiled Code) at org.apache.j...
-----------------------------------
Error: 500
Location: /index.jsp
Internal Servlet Error:
org.apache.jasper.compiler.ParseException: D:index.jsp(0,4) Invalid directive
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java, Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1034)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
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, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:163)
at org.apache.tomcat.servlets.DefaultServlet.doGet(DefaultServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java, Compiled Code)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
|
这里有错:
除此之外无错!如果还是不行,检查你的编译工具和webserver的配置是不是配好
除此之外无错!如果还是不行,检查你的编译工具和webserver的配置是不是配好
|
同意上面的意见,应该是:
|
|
and:
try
{
conn = DriverManager.getConnection(sConnStr);
stmt = conn.createStatement();
rs = stmt.executeQuery("select number from t1");
if (rs.next())
number = rs.getString("number");
else
out.println("no record!!") ;
rs.close();
stmt.close();
conn.close();
}
catch (SQLException e)
{
System.err.println("firm(): "+e.getMessage());
e.printStackTrace();
}
try
{
conn = DriverManager.getConnection(sConnStr);
stmt = conn.createStatement();
rs = stmt.executeQuery("select number from t1");
if (rs.next())
number = rs.getString("number");
else
out.println("no record!!") ;
rs.close();
stmt.close();
conn.close();
}
catch (SQLException e)
{
System.err.println("firm(): "+e.getMessage());
e.printStackTrace();
}
|
同意楼上的
|
应该就是 page 指令的问题
如果改成 后,看看错误信息是不是变了?!
如果改成 后,看看错误信息是不是变了?!