Check out the sql tags that are a part of the Standard tag library
implementation available in the jakarta taglibs project. You can use the
column name to get the column value when iterating over the rows:
<sql:update var="newTable">
create table mytable (
nameid int primary key,
name varchar(80)
)
</sql:update>
<sql:query var="resultSet">
SELECT * FROM mytable
</sql:query>
<%-- using the column name to access the value --%>
<c:forEach var="row" items="${resultSet.rows}">
Name: <c:out value="${row.NAMEID}"/>
Value: <c:out value="${row.NAME}"/>
</c:forEach>
Justy
----- Original Message -----
From: "Soefara Redzuan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 11, 2002 5:51 AM
Subject: why is there no dbtags getField tag ?
> Instead of writing getColumn, is there a more intuitive method that uses
the
> field name instead getColumn ? For example the current method is this
>
> <sql:statement id="stmt1" conn="conn1">
> <sql:query> select * from members </sql:query>
> <sql:resultSet id="rset2">
> <sql:getColumn position="1"/>
> <sql:getColumn position="2"/>
> </sql:resultSet>
> </sql:statement>
>
> Why is there not something like this instead
>
> <sql:statement id="stmt1" conn="conn1">
> <sql:query> select * from members </sql:query>
> <sql:resultSet id="rset2">
> <sql:getField name="firstname" />
> <sql:getField name="lastname" />
> </sql:resultSet>
> </sql:statement>
>
> Or does something like this exist ?
>
> Thank you, Soefara.
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>