I am a beginner and learning
JSP. I am using a simple SQL statement in the program. I don't understand how the root cause is the '=' in the statement.
need help.....
org.apache.jasper.JasperException: Exception in JSP: /MyJsp.jsp:37
34: };
35:
36: Statement stmt = conn.createStatement();
37: ResultSet rset = stmt.executeQuery("select Person_nbr from Application" +
38: "where person_nbr = 1000");
39: while (rset.next()){ %>
40: <%=rset.getString(3)%>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: Line 1: Incorrect syntax near '='.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.sql.SQLException: Line 1: Incorrect syntax near '='.
net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418)
net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1258)
org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)