在eclipse下做jsp时出现以下问题,求大神解决
exceptionorg.apache.jasper.JasperException:AnexceptionoccurredprocessingJSPpage/frien...
exception org.apache.jasper.JasperException: An exception occurred processing JSP page /friend2.jsp at line 128
125: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
126: Connection conn = DriverManager.getConnection(url);
127: Statement stmt = conn.createStatement();
128: ResultSet RS=stmt.executeQuery(sql);
129: if(RS.next()){
130: %>
131: <p></p>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] FROM 子句语法错误。
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.friend2_jsp._jspService(friend2_jsp.java:326)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet
代码如下http://pan.baidu.com/s/1ntDmnQL谢谢各位大神的指教了 展开
125: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
126: Connection conn = DriverManager.getConnection(url);
127: Statement stmt = conn.createStatement();
128: ResultSet RS=stmt.executeQuery(sql);
129: if(RS.next()){
130: %>
131: <p></p>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] FROM 子句语法错误。
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.friend2_jsp._jspService(friend2_jsp.java:326)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet
代码如下http://pan.baidu.com/s/1ntDmnQL谢谢各位大神的指教了 展开
2个回答
展开全部
ResultSet RS=stmt.executeQuery(sql); 这句话出的问题
原因告诉你了,FROM子句语法错误。
这个东西我也没法运行,大概看了一下,你where后面应该没加空格。别的错误你自己再看看,把sql语句打出来
原因告诉你了,FROM子句语法错误。
这个东西我也没法运行,大概看了一下,你where后面应该没加空格。别的错误你自己再看看,把sql语句打出来
追问
大神,改了还是不对,你咋样才能运行,帮我看看,谢谢了
追答
你sql语句,每个语句后面都有and,有的and前面有空格,有的没有。
另外你写的and,地方也不对。如果只有一个条件,就会形成这种
select * from xxx where xxx = xxx and 这种语句 显然是不合法的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询