You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by mo...@apache.org on 2001/08/15 02:46:35 UTC

cvs commit: jakarta-taglibs/dbtags/xml dbtags.xml developers-notes.html documentation.html

morgand     01/08/14 17:46:34

  Modified:    dbtags/xml dbtags.xml developers-notes.html
                        documentation.html
  Log:
  rowCount, wasEmpty and wasNotEmpty can be used outside of statement tags
  
  Revision  Changes    Path
  1.5       +154 -148  jakarta-taglibs/dbtags/xml/dbtags.xml
  
  Index: dbtags.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/dbtags/xml/dbtags.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- dbtags.xml	2001/08/09 21:58:30	1.4
  +++ dbtags.xml	2001/08/15 00:46:34	1.5
  @@ -76,7 +76,7 @@
       <docs uri="../../dbtags/xml/documentation.html"/>
     </documentation>
     
  -  <developers-notes last-updated="08/09/2001" uri="../../dbtags/xml/developers-notes.html"/>
  +  <developers-notes last-updated="08/14/2001" uri="../../dbtags/xml/developers-notes.html"/>
   
     <tagtoc name="Connection Tags">
   
  @@ -664,153 +664,6 @@
           </usage>
         </example>
       </tag>
  -
  -    <tag>
  -      <name>wasEmpty</name>
  -      <tag-class>org.apache.taglibs.dbtags.statement.WasEmptyTag</tag-class>
  -      <body-content>JSP</body-content>
  -        
  -      <description>
  -        Executes its body if the last ResultSet tag received 0 rows
  -        from the database.  You must be after a ResultSet tag and inside
  -        a StatementTag or PreparedStatementTag, or an error will be generated.
  -      </description>
  -        
  -      <availability>1.0</availability>
  -      <restrictions>Use inside a statement or preparedStatement tag and
  -     after a ResultSet tag.</restrictions>
  -        
  -      <example>
  -        <usage>
  -          <code>
  -<![CDATA[
  -<%-- showing the contents of the table --%>
  -<table>
  -<tr><th>id</th><th>name</th><th>description</th></tr>
  -<sql:preparedStatement id="stmt6" conn="conn1"> 
  -  <sql:query>
  -    select id, name, description from test_books
  -  </sql:query>
  -  <sql:resultSet id="rset4">
  -    <tr>
  -      <td><sql:getColumn position="1"/></td>
  -      <td><sql:getColumn position="2"/></td>
  -      <td><sql:getColumn position="3" to="description"/></td>
  -    </tr>
  -  </sql:resultSet>
  -  <tr>
  -    <td colspan="3">
  -    <%-- show different text, depending on whether or not
  -    any rows were retrieved --%>
  -    <sql:wasEmpty>No rows retrieved.</sql:wasEmpty>
  -    <sql:wasNotEmpty><sql:rowCount/> rows retrieved.</sql:wasNotEmpty>
  -    </td>
  -  </tr>
  -</sql:preparedStatement>
  -]]> 
  -          </code>
  -        </usage>
  -      </example>
  -    </tag>
  -
  -    <tag>
  -      <name>wasNotEmpty</name>
  -      <tag-class>org.apache.taglibs.dbtags.statement.WasNotEmptyTag</tag-class>
  -      <body-content>JSP</body-content>
  -        
  -      <description>
  -        Executes its body if the last ResultSet tag received more than 0 rows
  -        from the database.  You must be after a ResultSet tag and inside
  -        a StatementTag or PreparedStatementTag, or an error will be generated.
  -      </description>
  -        
  -      <availability>1.0</availability>
  -      <restrictions>Use inside a statement or preparedStatement tag and
  -     after a ResultSet tag.</restrictions>
  -        
  -      <example>
  -        <usage>
  -          <code>
  -<![CDATA[
  -<%-- showing the contents of the table --%>
  -<table>
  -<tr><th>id</th><th>name</th><th>description</th></tr>
  -<sql:preparedStatement id="stmt6" conn="conn1"> 
  -  <sql:query>
  -    select id, name, description from test_books
  -  </sql:query>
  -  <sql:resultSet id="rset4">
  -    <tr>
  -      <td><sql:getColumn position="1"/></td>
  -      <td><sql:getColumn position="2"/></td>
  -      <td><sql:getColumn position="3" to="description"/></td>
  -    </tr>
  -  </sql:resultSet>
  -  <tr>
  -    <td colspan="3">
  -    <%-- show different text, depending on whether or not
  -    any rows were retrieved --%>
  -    <sql:wasEmpty>No rows retrieved.</sql:wasEmpty>
  -    <sql:wasNotEmpty><sql:rowCount/> rows retrieved.</sql:wasNotEmpty>
  -    </td>
  -  </tr>
  -</sql:preparedStatement>
  -]]> 
  -          </code>
  -        </usage>
  -      </example>
  -    </tag>
  -
  -    <tag>
  -      <name>rowCount</name>
  -      <tag-class>org.apache.taglibs.dbtags.statement.RowCountTag</tag-class>
  -      <body-content>empty</body-content>
  -        
  -      <description>
  -        Prints out the number of rows retrieved from the database.
  -It can be used inside a ResultSet tag to provide a running
  -count of rows retreived, or after the ResultSet tag to
  -display the total number.  Using the tag before the ResultSet
  -or outside of a Statement or PreparedStatement will
  -produce an error.
  -      </description>
  -        
  -      <availability>1.0</availability>
  -      <restrictions>Use inside a statement or preparedStatement tag and not
  -     before a ResultSet tag.</restrictions>
  -        
  -      <example>
  -        <usage>
  -          <code>
  -<![CDATA[
  -<%-- showing the contents of the table --%>
  -<table>
  -<tr><th>id</th><th>name</th><th>description</th></tr>
  -<sql:preparedStatement id="stmt6" conn="conn1"> 
  -  <sql:query>
  -    select id, name, description from test_books
  -  </sql:query>
  -  <sql:resultSet id="rset4">
  -    <tr>
  -      <td><sql:getColumn position="1"/></td>
  -      <td><sql:getColumn position="2"/></td>
  -      <td><sql:getColumn position="3" to="description"/></td>
  -    </tr>
  -  </sql:resultSet>
  -  <tr>
  -    <td colspan="3">
  -    <%-- show different text, depending on whether or not
  -    any rows were retrieved --%>
  -    <sql:wasEmpty>No rows retrieved.</sql:wasEmpty>
  -    <sql:wasNotEmpty><sql:rowCount/> rows retrieved.</sql:wasNotEmpty>
  -    </td>
  -  </tr>
  -</sql:preparedStatement>
  -]]> 
  -          </code>
  -        </usage>
  -      </example>
  -    </tag>
       
     </tagtoc>
   
  @@ -1602,6 +1455,150 @@
           </usage>
         </example>
       </tag>
  +
  +    <tag>
  +      <name>wasEmpty</name>
  +      <tag-class>org.apache.taglibs.dbtags.resultset.WasEmptyTag</tag-class>
  +      <body-content>JSP</body-content>
  +        
  +      <description>
  +        Executes its body if the last ResultSet tag received 0 rows
  +        from the database.  You must be after a ResultSet tag, 
  +        or an error will be generated.
  +      </description>
  +        
  +      <availability>1.0</availability>
  +      <restrictions>Use after a ResultSet tag.</restrictions>
  +        
  +      <example>
  +        <usage>
  +          <code>
  +<![CDATA[
  +<%-- showing the contents of the table --%>
  +<table>
  +<tr><th>id</th><th>name</th><th>description</th></tr>
  +<sql:preparedStatement id="stmt6" conn="conn1"> 
  +  <sql:query>
  +    select id, name, description from test_books
  +  </sql:query>
  +  <sql:resultSet id="rset4">
  +    <tr>
  +      <td><sql:getColumn position="1"/></td>
  +      <td><sql:getColumn position="2"/></td>
  +      <td><sql:getColumn position="3" to="description"/></td>
  +    </tr>
  +  </sql:resultSet>
  +  <tr>
  +    <td colspan="3">
  +    <%-- show different text, depending on whether or not
  +    any rows were retrieved --%>
  +    <sql:wasEmpty>No rows retrieved.</sql:wasEmpty>
  +    <sql:wasNotEmpty><sql:rowCount/> rows retrieved.</sql:wasNotEmpty>
  +    </td>
  +  </tr>
  +</sql:preparedStatement>
  +]]> 
  +          </code>
  +        </usage>
  +      </example>
  +    </tag>
  +
  +    <tag>
  +      <name>wasNotEmpty</name>
  +      <tag-class>org.apache.taglibs.dbtags.resultset.WasNotEmptyTag</tag-class>
  +      <body-content>JSP</body-content>
  +        
  +      <description>
  +        Executes its body if the last ResultSet tag received more than 0 rows
  +        from the database.  You must be after a ResultSet tag, 
  +        or an error will be generated.
  +      </description>
  +        
  +      <availability>1.0</availability>
  +      <restrictions>Use after a ResultSet tag.</restrictions>
  +        
  +      <example>
  +        <usage>
  +          <code>
  +<![CDATA[
  +<%-- showing the contents of the table --%>
  +<table>
  +<tr><th>id</th><th>name</th><th>description</th></tr>
  +<sql:preparedStatement id="stmt6" conn="conn1"> 
  +  <sql:query>
  +    select id, name, description from test_books
  +  </sql:query>
  +  <sql:resultSet id="rset4">
  +    <tr>
  +      <td><sql:getColumn position="1"/></td>
  +      <td><sql:getColumn position="2"/></td>
  +      <td><sql:getColumn position="3" to="description"/></td>
  +    </tr>
  +  </sql:resultSet>
  +  <tr>
  +    <td colspan="3">
  +    <%-- show different text, depending on whether or not
  +    any rows were retrieved --%>
  +    <sql:wasEmpty>No rows retrieved.</sql:wasEmpty>
  +    <sql:wasNotEmpty><sql:rowCount/> rows retrieved.</sql:wasNotEmpty>
  +    </td>
  +  </tr>
  +</sql:preparedStatement>
  +]]> 
  +          </code>
  +        </usage>
  +      </example>
  +    </tag>
  +
  +    <tag>
  +      <name>rowCount</name>
  +      <tag-class>org.apache.taglibs.dbtags.resultset.RowCountTag</tag-class>
  +      <body-content>empty</body-content>
  +        
  +      <description>
  +        Prints out the number of rows retrieved from the database.
  +It can be used inside a ResultSet tag to provide a running
  +count of rows retreived, or after the ResultSet tag to
  +display the total number.  Using the tag before the ResultSet
  +will produce an error.
  +      </description>
  +        
  +      <availability>1.0</availability>
  +      <restrictions>Use inside or after a ResultSet tag (not before).</restrictions>
  +        
  +      <example>
  +        <usage>
  +          <code>
  +<![CDATA[
  +<%-- showing the contents of the table --%>
  +<table>
  +<tr><th>id</th><th>name</th><th>description</th></tr>
  +<sql:preparedStatement id="stmt6" conn="conn1"> 
  +  <sql:query>
  +    select id, name, description from test_books
  +  </sql:query>
  +  <sql:resultSet id="rset4">
  +    <tr>
  +      <td><sql:getColumn position="1"/></td>
  +      <td><sql:getColumn position="2"/></td>
  +      <td><sql:getColumn position="3" to="description"/></td>
  +    </tr>
  +  </sql:resultSet>
  +  <tr>
  +    <td colspan="3">
  +    <%-- show different text, depending on whether or not
  +    any rows were retrieved --%>
  +    <sql:wasEmpty>No rows retrieved.</sql:wasEmpty>
  +    <sql:wasNotEmpty><sql:rowCount/> rows retrieved.</sql:wasNotEmpty>
  +    </td>
  +  </tr>
  +</sql:preparedStatement>
  +]]> 
  +          </code>
  +        </usage>
  +      </example>
  +    </tag>
  +
               
     </tagtoc>
   
  @@ -1623,6 +1620,15 @@
   <revision release="Pre Beta" date="08/09/2001">
     <description>
       Added name attribute to resultset tag for use with rowsets.
  +  </description>
  +</revision>
  +
  +<revision release="Pre Beta" date="08/14/2001">
  +  <description>
  +    Updated rowCount, wasEmpty and wasNotEmpty tags to work outside
  +    of statement tags, in support of detached resultsets and rowsets.
  +    This involved repackaging some classes, so the TLD was updated,
  +    as well as the docs.
     </description>
   </revision>
   
  
  
  
  1.2       +5 -1      jakarta-taglibs/dbtags/xml/developers-notes.html
  
  Index: developers-notes.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/dbtags/xml/developers-notes.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- developers-notes.html	2001/08/09 18:45:34	1.1
  +++ developers-notes.html	2001/08/15 00:46:34	1.2
  @@ -11,7 +11,11 @@
     <p>
       To-do:
       <ul>
  -      <li><b>Add support for RowSets.</b> (considering several contributions)</li>
  +      <li>
  +        <b>Add support for RowSets.</b> (considering several contributions)  
  +        <font color="red">[Update: Preliminary support has been added, see the
  +        history for details]</font>    
  +      </li>
       </ul>
     </p>
   
  
  
  
  1.3       +18 -19    jakarta-taglibs/dbtags/xml/documentation.html
  
  Index: documentation.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/dbtags/xml/documentation.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- documentation.html	2001/08/09 21:58:30	1.2
  +++ documentation.html	2001/08/15 00:46:34	1.3
  @@ -166,25 +166,6 @@
   <p>All statements and preparedStatements automatically trim whitespace from the 
   body.</p>
   
  -<p><b>"wasEmpty" and "wasNotEmpty" tags</b></p>
  -
  -<p>The "wasEmpty" tag only executes its body if the last ResultSet 
  -tag received 0 rows from the database.  You must be after a ResultSet tag and 
  -inside a StatementTag or PreparedStatementTag, or an error will be generated.
  -The "wasNotEmpty" tag executes its body if the last ResultSet
  -received <i>more than</i> 0 rows from the database.
  -See the <A HREF="#summary">Tag Reference</A> for examples.</p>
  -
  -<p><b>"rowCount" tag</b></p>
  -
  -<p>The "rowCount" tag prints out the number of rows retrieved from the database.
  -It can be used inside a ResultSet tag to provide a running
  -count of rows retreived, or after the ResultSet tag to
  -display the total number.  See the <A HREF="#summary">Tag Reference</A> for examples.
  -Using the tag before the ResultSet
  -or outside of a Statement or PreparedStatement will
  -produce an error.</p>
  -
   <A NAME="overview.tags.preparedstatement"><h3>PreparedStatement Tags</h3></A>
   
   <P>"Prepared statements" are a somewhat more advanced format for generating SQL
  @@ -362,6 +343,24 @@
             &lt;sql:wasNull>[no description]&lt;/sql:wasNull>&lt;/td>
       &lt;/tr>
     &lt;/sql:resultSet></pre>
  +
  +<p><b>"wasEmpty" and "wasNotEmpty" tags</b></p>
  +
  +<p>The "wasEmpty" tag only executes its body if the last ResultSet 
  +tag received 0 rows from the database.  You must be after a resultSet tag,
  +or an error will be generated.
  +The "wasNotEmpty" tag executes its body if the last ResultSet
  +received <i>more than</i> 0 rows from the database.
  +See the <A HREF="#summary">Tag Reference</A> for examples.</p>
  +
  +<p><b>"rowCount" tag</b></p>
  +
  +<p>The "rowCount" tag prints out the number of rows retrieved from the database.
  +It can be used inside a ResultSet tag to provide a running
  +count of rows retreived, or after the ResultSet tag to
  +display the total number.  See the <A HREF="#summary">Tag Reference</A> for examples.
  +Using the tag before the ResultSet
  +will produce an error.</p>
   
   </span>