String sql9 = "SELECT nme "+ "FROM table1 "; Statement stmt9=conn.createStatement(); ResultSet rset9=stmt9.executeQuery("sql9"); while(rset9.next()) { s = rset9.getString("nme"); }
org.apache.jasper.JasperException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql9' at line 1
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Can anyone tell me the probable cause of this to happen? I have check many times that there is no error with the syntax of the query statement.
[ Last edited by Asiafever at 2-7-2007 08:23 PM ] |