Note: Bugzilla requires that I select a Component for this report, but JDBC isn't included in the list of taglib components. Setup: Tomcat 3.2.1 on Windows NT InstantDB with RmiJDBC driver SQL database jdbc-examples.war from March 19, 2001 build test_books table with same name and initial data indicated by author's script Symptoms: An SQLException occurs when I run the example in jdbc-examples.war. The stack trace indicates that there is an SQLException when the JSP attempts to insert a record with values that are between an escapeSQL tag pair. It seems to be trying to insert a record with a value that contains two tick marks (Gravity''s Rainbow) instead of using the typical "\" SQL escape character. If I modify jdbc.jsp by removing the escapeSQL tag pair and adding a "\" in front of the tick mark, the example works fine. Here's the stack trace that I see: Error: 500 Location: /jdbc-examples/jdbc.jsp Internal Servlet Error: javax.servlet.ServletException: java.sql.SQLException: insert into test_books (id, name) values (3, 'Gravity''s Rainbow') Don't understand SQL after: "insert" Expected: "}" found: "s Rainbow" at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.ja va:459) at _0002fjdbc_0002ejspjdbc_jsp_0._jspService(_0002fjdbc_0002ejspjdbc_jsp_0.java:245 0) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:1 77) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConne ctionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: javax.servlet.jsp.JspTagException: java.sql.SQLException: insert into test_books (id, name) values (3, 'Gravity''s Rainbow') Don't understand SQL after: "insert" Expected: "}" found: "s Rainbow" at org.apache.taglibs.jdbc.statement.ExecuteTag.doEndTag(ExecuteTag.java:111) at _0002fjdbc_0002ejspjdbc_jsp_0._jspService(_0002fjdbc_0002ejspjdbc_jsp_0.java:730 ) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:1 77) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConne ctionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484)
InstantDB does not support standard double tick SQL escaping. I'm not sure if we should simply leave InstantDB unsupported, or if we use another means of escaping.
Changed product to taglibs from Tomcat 3
This should be assigned to the DBTags taglib.