Results 1 to 2 of 2

Thread: Java 1.5 required for a JdbcTemplate method?

  1. #1
    Join Date
    May 2005
    Posts
    2

    Default Java 1.5 required for a JdbcTemplate method?

    I'm trying to use the JdbcTemplate queryForRowSet method (Spring 1.2 final), but I'm getting the following error:
    java.lang.NoClassDefFoundError: javax/sql/rowset/CachedRowSet

    It appears that javax.sql.rowset.CachedRowSet is in java 1.5, but not in java 1.4. Guess I basically can't use that method with the version of Java I'm running, but would at least be nice if the JavaDoc pointed that out.

    e.g. example code:
    SqlRowSet rs = jt.queryForRowSet(sql.toString(), params, types);

    It's also interesting that the JavaDoc for the method states that results will be mapped to an SqlRowSet object which is a wrapper class for javax.sql.RowSet. However, it also implies that it could possibly wrap javax.sql.rowset.CachedRowSet, which seems to be the case.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,107

    Default

    To use a RowSet feature you need a compatible RowSet implementation. Sun provides one in J2SE 5.0 that is based on JSR 114. They also produced a JSR 114 RI that can be used with Java 1.4. You can just copy the lib/j2ee/rowset.jar from the Spring distribution to your lib directory.

    The SqlRowSet wraps any implementation of javax.sql.RowSet. Since we are dealing with disconnected results here, the implementation will most likely also implement CachedRowSet, but you can't get to those methods from the SqlRowSet interface.

    As more RowSet implementations are made available we'll probably expand the functioonality so you'll be able to plug in your favorite implementation.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. PerformanceMonitorInterceptor
    By tnist in forum AOP
    Replies: 3
    Last Post: Aug 24th, 2005, 01:39 PM
  5. Replies: 1
    Last Post: Jul 28th, 2005, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •