jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hor...@apache.org
Subject cvs commit: jakarta-taglibs/standard/src/javax/servlet/jsp/jstl/sql ResultImpl.java
Date Tue, 19 Mar 2002 01:51:56 GMT
horwat      02/03/18 17:51:56

  Modified:    standard/src/org/apache/taglibs/standard/tag/common/sql
                        QueryTagSupport.java
               standard/src/javax/servlet/jsp/jstl/sql ResultImpl.java
  Log:
  When a starting row is specified the maximum row count has to start from the new starting
row value.
  
  Bugzilla #7178
  
  Revision  Changes    Path
  1.9       +7 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java
  
  Index: QueryTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- QueryTagSupport.java	8 Mar 2002 03:16:17 -0000	1.8
  +++ QueryTagSupport.java	19 Mar 2002 01:51:56 -0000	1.9
  @@ -222,12 +222,18 @@
   	    throw new JspTagException(
                   Resources.getMessage("SQL_NO_STATEMENT"));
   	}
  +        /*
  +         * We shouldn't have a negative startRow
  +         */
  +        if (startRow < 0) {
  +            startRow = 0;
  +        }
   
   	Result result = null;
   	try {
   	    PreparedStatement ps = conn.prepareStatement(sqlStatement);
               if (maxRows > 0 ) {
  -	        ps.setMaxRows(maxRows);
  +	        ps.setMaxRows(startRow + maxRows);
               }
   	    setParameters(ps, parameters);
   	    ResultSet rs = ps.executeQuery();
  
  
  
  1.2       +6 -0      jakarta-taglibs/standard/src/javax/servlet/jsp/jstl/sql/ResultImpl.java
  
  Index: ResultImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/javax/servlet/jsp/jstl/sql/ResultImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResultImpl.java	9 Mar 2002 00:24:15 -0000	1.1
  +++ ResultImpl.java	19 Mar 2002 01:51:56 -0000	1.2
  @@ -93,6 +93,12 @@
   
   	int noOfColumns = rsmd.getColumnCount();
           int beginRow = 0;
  +        /*
  +         * Shift maximum rows depending on starting point
  +         */
  +        if ((maxRows > 0) && (startRow > 0)) {
  +            maxRows = maxRows + startRow;
  +        }
   
   	while (rs.next()) {
               if ((maxRows < 0) || (beginRow < maxRows)) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message