CachedRowSetImpl , paging and connection connection

Discussion in 'Java' started by R, Mar 24, 2006.

  1. R

    R Guest

    I have been trying to use the CachedRowsetImpl (SUN's reference
    Implementation) to run some queries against Oracle.

    I am using this mainly because I can do paging by setting the

    The qurying and paging works okay , but it requires that I keep the
    connection open while I am iterating through pages.

    That was not my unserstanding from the reading of the API.
    I can close it after populating it and the CRS (Cached ResultSet) is
    supposed to create the connection from the parameters for subsequent

    Am I missing some thing ?

    See the examples below:

    String query = "select * from TEST";
    conn = dataSource.getConnection(uid , pwd);
    PreparedStatement ps = conn.prepareStatement(query,
    rs = ps.executeQuery();
    crs = new CachedRowSetImpl();

    and then iterate through pages works okay. But if I close the
    connection after the populate , it only displayes ONE page and then get
    an error about connection being closed.

    I have tried using the second method of populating the data using
    CRS.execute(conn) where conn is connection. If I close the connection
    after the execute I get the same error.

    I have tried setting the connection params also as below with the same


    Any clues >?????
    R, Mar 24, 2006
    1. Advertisements

  2. R

    R Guest

    Any one ??
    R, Mar 26, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.