tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Philp <sph...@ameritech.net>
Subject Newbie problems with JDBC taglib
Date Sat, 17 Mar 2001 15:29:03 GMT
I'm having a problem using the JDBC taglib (031701.tar.gz, but also
tried 031601.tar.gz) that I'm hoping someone can help me out with...

The page looks like:

<%@ taglib uri="http://jakarta.apache.org/taglibs/jdbc" prefix="sql" %>
<table width="100%">
<tr>
  <th align=left>Customer Name</th>
  <th align=left>Available Reports</th>
</tr>
<sql:connection id="conn" jndiName="java:comp/env/jdbc/advdb"/>
 
<sql:preparedStatement id="stmt1" conn="conn">
        <sql:query>
                SELECT 
			CSCODE, 
			CSNAME 
		FROM 
			CUSTOMER 
		WHERE 
			CSNAME LIKE ? 
			AND SACODE IN (?) 
			AND CSTYPE = 'A' 
		ORDER BY 2
        </sql:query>
 
        <sql:execute>
                <sql:setColumn position="1">
			<%=request.getParameter("Customer") + "%" %>
		</sql:setColumn>
                <sql:setColumn position="2">4</sql:setColumn>
        </sql:execute>
 
        <sql:resultSet id="rs1">
                <tr>
	                <td><sql:getColumn position="1"/></td>
	                <td><sql:getColumn position="2"/></td>
		</tr>
        </sql:resultSet>
</sql:preparedStatement>
</table>
<sql:closeConnection conn="conn"/>


When I execute that page under Resin 1.2.1 (IBM JDK 1.3 on Linux) I get
the following error:

java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagData: method
getAttributes()Ljava/util/Enumeration; not found
        at
org.apache.taglibs.jdbc.resultset.BaseGetterTEI.isValid(BaseGetterTEI.java:78)
        at
com.caucho.jsp.JspGenerator.generateMyTag(JspGenerator.java:747)
        at
com.caucho.jsp.JspGenerator.generateTaglib(JspGenerator.java:713)
        at
com.caucho.jsp.JspGenerator.generateChildren(JspGenerator.java:679)
        at
com.caucho.jsp.JavaGenerator.printTagInstance(JavaGenerator.java:634)
        at
com.caucho.jsp.JspGenerator.generateMyTag(JspGenerator.java:769)
        at
com.caucho.jsp.JspGenerator.generateTaglib(JspGenerator.java:713)
        at
com.caucho.jsp.JspGenerator.generateChildren(JspGenerator.java:679)
        at
com.caucho.jsp.JavaGenerator.printTagInstance(JavaGenerator.java:634)
        at
com.caucho.jsp.JspGenerator.generateMyTag(JspGenerator.java:769)
        at
com.caucho.jsp.JspGenerator.generateTaglib(JspGenerator.java:713)
        at
com.caucho.jsp.JspGenerator.generateChildren(JspGenerator.java:679)
        at com.caucho.jsp.JspGenerator.generate(JspGenerator.java:237)
        at com.caucho.jsp.JspParser.parse(JspParser.java:213)
        at com.caucho.jsp.JspParser.parse(JspParser.java:149)
        at com.caucho.jsp.XtpPage.getJspPage(XtpPage.java:482)
        at com.caucho.jsp.XtpPage.compileJspPage(XtpPage.java:338)
        at com.caucho.jsp.XtpPage.subservice(XtpPage.java:204)
        at com.caucho.jsp.Page.service(Page.java:334)
        at
com.caucho.server.http.Invocation.service(Invocation.java:255)
        at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:201)
        at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:217)
        at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:151)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
        at java.lang.Thread.run(Thread.java:498)


What am I doing wrong?


The other problem that I ran across was that the documentation showed
the connection attribute would work as:

	<sql:connection id="conn1" jndiName="java:comp/env/jdbc/advdb">

but that gets me an error about an unknown attribute "jndiname" (yes,
the 'n' switched case).  Change the connection tags to:

	<sql:connection id="conn1">
		<sql:jndiName>java:comp/env/jdbc/advdb</sql:jndiName>
	</sql:connection>

gets it working correctly.  Tried both the 3/16 and 3/17 nightlies just
to see if it was a bug that'd been ironed out since my download.

Thanks for any help you can provide!

-- 
Steve Philp, MCSE/MCP+I
Assistant IS Manager
Advance Packaging Corporation
sphilp@ameritech.net

Mime
View raw message