I am having a problem with my jsp page. I am using:-
-Tomcat 8.0.20
-Eclipse Java EE luna SR2
-Microsoft SQL server 2005
-Using management studio express to do my db work
It's a small problem as i am learning to run queries on jsp pages. I have stumbled upon this problem and wondered if anyone can help me.
this is my code snippet
<sql:setDataSource var="snapshot" river="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://SANGKARAN;database=ILMU;"
user="*******" password="******"/>
<c:set var="empId" value="102"/>
<sql:update dataSource="${snapshot}" var="count">
UPDATE Employees SET last VALUES = 'Ali'
<sql:param value="${empId}" />
</sql:update>
This is the error
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException:
UPDATE Employees SET last VALUES = 'Ali'
The index 1 is out of range. org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:548) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:454) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setterGetParam(Unknown Source) com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(Unknown Source) org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.setParameters(UpdateTagSupport.java:262) org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doEndTag(UpdateTagSupport.java:165) org.apache.jsp.updatetest_jsp._jspx_meth_sql_005fupdate_005f0(updatetest_jsp.java:274) org.apache.jsp.updatetest_jsp._jspService(updatetest_jsp.java:145) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:431) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
I could really use some help.