tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morgan Delagrange" <morga...@rcnchicago.com>
Subject Re: Problem with DBTags
Date Tue, 31 Jul 2001 04:27:03 GMT
The syntax of DBTags definitely does not support multiple queries per statement tag (i.e. your
pseudo-code example will not work.)

It's curious that using separate statement tags did not work however.  Could you send pseudo
code for that usage?

Lavandowska wrote on 7/29/01 4:05 pm:

>No, not the "where's the tld" 
>problem.
>
>I'm trying to execute two 
>queries on the same 
>connection. The first query is 
>a simple "select name from 
>table where ..." that only 
>returns one column and one 
>row.  The second query 
>returns several columns for 
>several rows.  The problem is 
>that my driver returns 
>javax.servlet.jsp.JspTagExce
>ption: java.sql.SQLException: 
>[TDS Driver]Invalid column 
>number (2). A number 
>between 1 and 1 is valid. 	at 
>org.apache.taglibs.dbtags.res
>ultset.GetColumnTag.doStar
>tTag
>
>It looks like something isn't 
>getting reset in 
>GetColumnTag.doStartTag 
>for the second query?  
>Perhaps it isn't creating a 
>new ResultSet?  Or could this 
>be an error in how 
>OrionServer caches tags?
>
>I've tried putting them in the 
>same <statement> tag, and 
>in seperate <statement> 
>tags, doesn't seem to 
>matter.  Either query on its 
>own runs fine, it is only when 
>I attempt to do both that I 
>get this problem. Example 
>psuedo-code follows:
>
><sql:statement id="stmt1" 
>conn="conn1">
>    <sql:query>
>	select name from table 
>where id = <%= tableId %>
>    </sql:query>
>	
>    <sql:resultSet id="rset1">
>	<sql:getColumn 
>position="1"/>
>    </sql:resultSet>
>	
>   <sql:query>
>     select id, name, foo, bar
>     from table2
>     where table1_id = <%= 
>tableId %>
>     order by sort_order
>   </sql:query>
>   
>   <%-- loop through the rows 
>of your query --%>
>   <table border="1">
>   <sql:resultSet id="rset2">
>       <tr><td>
>   	 <b>Name:</b> 
><sql:getColumn 
>position="2"/><br>  	 
><b>Foo:</b> 
><sql:getColumn 
>position="3"/><br>  	 
><b>Bar:</b> 
>$<sql:getColumn 
>position="4"/>
>       </td></tr>
>   </sql:resultSet>
>   </table>
>   
></sql:statement>
>
>_____________________________
>_____________________ Do You 
>Yahoo!?
>Make international calls for 
>as low as $.04/minute with 
>Yahoo! Messenger 
>http://phonecard.yahoo.co
>m/


Mime
View raw message