tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warner Onstine" <war...@warneronstine.com>
Subject Re: jdbc taglib problem
Date Wed, 04 Apr 2001 16:08:46 GMT
Yeah, that was something I added to see if it was producing some sql error.

-warner
----- Original Message -----
From: "Morgan Delagrange" <mdelagra@yahoo.com>
To: <taglibs-user@jakarta.apache.org>
Sent: Wednesday, April 04, 2001 8:14 AM
Subject: Re: jdbc taglib problem


> Hi, Warner, I'm glad you worked out your issue.
>
> By the way, that execute tag shouldn't be necessary
> for looping through the result set.  Removing it
> should produce the same result.
>
> - Morgan
>
> --- Warner Onstine <warner@warneronstine.com> wrote:
> > Uh, never mind I found the problem (an unclosed
> > comment tag), although a
> > little baffled why a different error wasn't thrown,
> > as I had this problem
> > earlier and it pointed out the other spots to me. Oh
> > well...
> >
> > -warner
> > ----- Original Message -----
> > From: "Warner Onstine" <warner@warneronstine.com>
> > To: <taglibs-user@jakarta.apache.org>
> > Sent: Tuesday, April 03, 2001 6:33 PM
> > Subject: Re: jdbc taglib problem
> >
> >
> > > To clarify it appears to be dying at this line:
> > >
> > > try {
> > >       Connection conn =
> > (Connection)pageContext.getAttribute(_connId);
> > >       _statement = conn.createStatement();
> > >       pageContext.setAttribute(getId(),
> > _statement);
> > >     } catch (SQLException e) {
> > >       throw new JspTagException(e.toString());
> > >     }
> > >  where _statement = conn.createStatement() is
> > called.
> > >
> > > -warner
> > >
> > > ----- Original Message -----
> > > From: "Warner Onstine" <warner@warneronstine.com>
> > > To: "taglibs-user"
> > <taglibs-user@jakarta.apache.org>
> > > Sent: Tuesday, April 03, 2001 5:07 PM
> > > Subject: jdbc taglib problem
> > >
> > >
> > > > Hi all,
> > > > I am having a problem using the jdbc taglib.
> > After following the
> > > > docuemntation I am still receiving this error:
> > > >
> > > >
> > --------------------------------------------------
> > > > Root Cause:
> > > > java.lang.NullPointerException
> > > >  at
> > > >
> > >
> >
>
org.apache.taglibs.jdbc.statement.StatementImplTag.doStartTag(StatementImplT
> > > > ag.java:137)
> > > >  at
> >
> org.apache.jsp.genre_jsp._jspService(genre_jsp.java:70)
> > > >  at
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > > >
> > > >
> > -------------------------------------------------
> > > > When trying to connect with my database using
> > this .jsp
> > > >
> > > > <%-- open a database query -->
> > > > <sql:connection id="conn1">
> > > >
> >
> <sql:url>jdbc:mysql://64.165.39.221/reviews</sql:url>
> > > >
> > <sql:driver>org.gjt.mm.mysql.Driver</sql:driver>
> > > >     <sql:userId>******</sql:userId> (note not
> > actually stars!)
> > > >     <sql:password>******</sql:password> (note
> > not actually stars!)
> > > > </sql:connection>
> > > >
> > > > <%-- open a database query --%>
> > > > <table>
> > > > <sql:statement id="stmt1" conn="conn1">
> > > >     <sql:query>
> > > >     select * from tbl_moviegenre
> > > >     </sql:query>
> > > >     <%-- loop through the rows of the query
> > > >     <sql:resultSet id="rset">
> > > >         <tr>
> > > >             <td>Primary key :: <sql:getColumn
> > position="1"/></td>
> > > >             <td>Genre :: <sql:getColumn
> > position="2"/></td>
> > > >         </tr>
> > > >     </sql:resultSet> --%>
> > > >     <sql:execute ignoreErrors="true"/>
> > > > </sql:statement>
> > > > </table>
> > > >
> > > > <sql:closeConnection conn="conn1"/>
> > > > --------------------------------------
> > > >
> > > > Now this works fine in a servlet with the same
> > url, user, password.  So
> > I
> > > > know it isn't my setup. Any ideas? This has been
> > driving me nuts for the
> > > > past 2 hours.
> > > >
> > > > Thanks in advance!
> > > >
> > > > -warner
> > > >
> > > >
> > >
> > >
> >
>
>
> =====
> Morgan Delagrange
> Britannica.com
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>


Mime
View raw message