morgand 01/01/30 16:45:18
Modified: jdbc/examples/web jdbc.jsp
Log:
Using the new getColumn/setColumn tags
Revision Changes Path
1.2 +16 -17 jakarta-taglibs/jdbc/examples/web/jdbc.jsp
Index: jdbc.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jdbc/examples/web/jdbc.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jdbc.jsp 2001/01/08 21:16:41 1.1
+++ jdbc.jsp 2001/01/31 00:45:18 1.2
@@ -29,13 +29,13 @@
</sql:query>
<sql:resultSet id="rset1">
<tr>
- <td><sql:getString position="1"/></td>
- <td><sql:getString position="2"/></td>
- <td><sql:getString position="3"/><sql:wasNull>[no
description]</sql:wasNull></td>
+ <td><sql:getColumn position="1"/></td>
+ <td><sql:getColumn position="2"/></td>
+ <td><sql:getColumn position="3"/><sql:wasNull>[no
description]</sql:wasNull></td>
</tr>
</sql:resultSet>
</sql:preparedStatement>
-</table>
+</table>
<P><B>Inseting a row using the "statement" tag</B></P>
@@ -51,20 +51,20 @@
<table>
<tr><th>id</th><th>name</th><th>description</th></tr>
-<sql:preparedStatement id="stmt4" conn="conn1">
+<sql:preparedStatement id="stmt4" conn="conn1">
<sql:query>
select id, name, description from test_books
order by 1
</sql:query>
<sql:resultSet id="rset2">
<tr>
- <td><sql:getString position="1"/></td>
- <td><sql:getString position="2"/></td>
- <td><sql:getString position="3"/><sql:wasNull>[no
description]</sql:wasNull></td>
+ <td><sql:getColumn position="1"/></td>
+ <td><sql:getColumn position="2"/></td>
+ <td><sql:getColumn position="3"/><sql:wasNull>[no
description]</sql:wasNull></td>
</tr>
</sql:resultSet>
</sql:preparedStatement>
-</table>
+</table>
<P><B>Selecting back the title of book 3, assigning the value to an
attribute</B></P>
@@ -75,7 +75,7 @@
order by 1
</sql:query>
<sql:resultSet id="rset3">
- <sql:getString position="1" to="bookName"/>
+ <sql:getColumn position="1" to="bookName"/>
</sql:resultSet>
</sql:preparedStatement>
@@ -89,9 +89,9 @@
</sql:query>
<sql:execute>
The contents of an execute body are not included in the output
- <sql:setInt position="1">4</sql:setInt>
- <sql:setString position="2" name="bookName"/>
- <sql:setString position="3">book by Pynchon</sql:setString>
+ <sql:setColumn position="1">4</sql:setColumn>
+ <sql:setColumn
position="2"><%=pageContext.getAttribute("bookName")%></sql:setColumn>
+ <sql:setColumn position="3">book by Pynchon</sql:setColumn>
</sql:execute>
</sql:preparedStatement>
@@ -106,9 +106,9 @@
</sql:query>
<sql:resultSet id="rset4">
<tr>
- <td><sql:getString position="1"/></td>
- <td><sql:getString position="2"/></td>
- <td><sql:getString position="3"/><sql:wasNull>[no
description]</sql:wasNull></td>
+ <td><sql:getColumn position="1"/></td>
+ <td><sql:getColumn position="2"/></td>
+ <td><sql:getColumn position="3"/><sql:wasNull>[no
description]</sql:wasNull></td>
</tr>
</sql:resultSet>
</sql:preparedStatement>
@@ -123,5 +123,4 @@
<jsp:getProperty name="conn1" property="closed"/>
<p><b>Success!</b></p>
-