cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <cocoonge...@yahoo.com>
Subject esql:row-count and rowCount()
Date Sat, 23 Nov 2002 03:51:12 GMT
I've been looking into esql:row-count (just calls
EsqlQuery.rowCount()) which is throwing a "not yet
implemented" exception for all cases but
EsqlConnection.LIMIT_METHOD_JDBC.  Obviously this was
meant to be a temporary measure while some issue was
resolved.  

Does anyone know what issues lay behind this?  I've
copied the relevant method below.  I don't see
anything out of the ordinary in the code, which works
in my case (mysql, no skipped rows) if I code it
directly in with <xsp:logic>.  I have to confess
though that my database experience (at least jdbc) is
limited to mysql and oracle.  Is this just a complete
oversite since this is a relatively new feature?

I'd be happy to work on a patch but need to understand
the issues involved that prompted the move in the
first place.

Geoff Howard

  public int rowCount() throws SQLException {
    switch(limitMethod) {
      case EsqlConnection.LIMIT_METHOD_JDBC:
          // TC: I'm not quite sure if synchronized is
really necessary since
          // the XSP page will be poolable
          synchronized (resultSet) {
            int currentRow = resultSet.getRow();
            resultSet.last();
            int count = resultSet.getRow();
            if (currentRow > 0) {
              resultSet.absolute(currentRow);
            }
            else {
              resultSet.first();
             resultSet.relative(-1);
            }
            return(count);
          }
      default:
        // select count(*)
        throw new RuntimeException("not yet
implemented");
    }
  }


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus  Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message