tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Klicman <ja...@jsptags.com>
Subject Re: using sql taglibs with postgresql
Date Wed, 27 Sep 2000 20:43:21 GMT
Hi Vanja,

Ah yes, I know this error well. The error message is completely
misleading.

Put your <sql:query>...</sql:query> on one line. PostgreSQL does not
like the carriage-return character which is what your SQL will contain
if it spans more than one line.

I've experienced this issue using my own sql tags with PostgreSQL. I
ended up writing a <text:unix> tag to strip the carriage-returns.

-James


On Wed, Sep 27, 2000 at 03:27:34PM -0400, Vanja Buvac wrote:
> 
> Hi,
> 
> has anyone been able to get the sql-examples distributed with the taglibs
> running on an postgresql database.
> 
> I'm using Retep's JDBC6.5-1.2 driver on a Postgresql 6.5 database.  The
> jsp code I'm using is the following:
> 
> <sql:connection id="conn1" >
> <sql:dburl>jdbc:postgresql://myserver/mytable</sql:dburl>
>   <sql:driver>postgresql.Driver</sql:driver>
>   <sql:userid>name</sql:userid>
>   <sql:password>password</sql:password>
> </sql:connection>
> 
> <sql:query id="getBoxen" connection="conn1" visibility="table">
> SELECT * FROM coding_results
> </sql:query>
> 
> A connection with the database is established, however the select
> statement is followed by an extra double-quote (").  So, tomcat reports
> the following error.  The source of the error is postgresql reporting the
> extra quote mark in the query.  I ran postgresql in debug mode and ther is
> in fact an extra quote that appears in the query.
> 
> Has anyone resolved this issue yet?
> 
> Thanks, Vanja.
> 
> 
> PS. here is the error message from tomcat.
> 
> 
> javax.servlet.ServletException: ERROR:  parser: parse error at or near "
> "
> 
>         at java.lang.Throwable.fillInStackTrace(Native Method)
>         at java.lang.Throwable.fillInStackTrace(Compiled Code)
>         at java.lang.Throwable.(Compiled Code)
>         at java.lang.Exception.(Compiled Code)
>         at javax.servlet.ServletException.(ServletException.java:161)
>         at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
>         at _0002ftest_0002ejsptest_jsp_4._jspService(Compiled Code)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
>         at
> org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
>         at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled
> Code)
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
>         at org.apache.tomcat.service.TcpConnectionThread.run(Compiled
> Code)
>         at java.lang.Thread.run(Compiled Code)

Mime
View raw message