Package com.sun.rowset

Examples of com.sun.rowset.CachedRowSetImpl


    assertEquals("John", crs.getString(1));
  }

  public void testBug48820() throws Exception {

    CachedRowSetImpl crs;

    Connection noBlobsConn = getConnectionWithProps("functionsNeverReturnBlobs=true");

    this.rs = noBlobsConn.createStatement().executeQuery(
        "SELECT PASSWORD ('SOMETHING')");
    this.rs.first();

    String fromPlainResultSet = this.rs.getString(1);

    this.rs = noBlobsConn.createStatement().executeQuery(
        "SELECT PASSWORD ('SOMETHING')");

    crs = new CachedRowSetImpl();
    crs.populate(this.rs);
    crs.first();

    assertEquals(fromPlainResultSet, crs.getString(1));
  }
View Full Code Here


        if (sqlConnection != null && sqlStatement != null && !sqlStatement.isEmpty()) {
            Statement statement = sqlConnection.createStatement();

            if (needResult) {
                cachedRowSet = new CachedRowSetImpl();
                cachedRowSet.populate(statement.executeQuery(sqlStatement));
            } else {
                statement.executeUpdate(sqlStatement);
            }
View Full Code Here

        CachedRowSet cachedRowSet = null;
        Connection sqlConnection = getConnection(credentials);

        if (sqlConnection != null && preparedStatement != null) {
            if (needResult) {
                cachedRowSet = new CachedRowSetImpl();
                cachedRowSet.populate(preparedStatement.executeQuery());
            } else {
                preparedStatement.executeUpdate();
            }
View Full Code Here

    public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
        final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
        final int maxrows = methodSQL.maxRows();

        try {
            CachedRowSetImpl rows = new CachedRowSetImpl();

            if (maxrows > 0) {
                rows.setMaxRows(maxrows);
            }

            rows.populate(resultSet);
            return rows;
        } catch (SQLException e) {
            throw new ControlException(e.getMessage(), e);
        }
    }
View Full Code Here

    public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
        final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
        final int maxrows = methodSQL.maxRows();

        try {
            CachedRowSetImpl rows = new CachedRowSetImpl();

            if (maxrows > 0) {
                rows.setMaxRows(maxrows);
            }

            rows.populate(resultSet);
            return rows;
        } catch (SQLException e) {
            throw new ControlException(e.getMessage(), e);
        }
    }
View Full Code Here

   * @throws SQLException if thrown by JDBC methods
   * @see #createSqlRowSet
   * @see com.sun.rowset.CachedRowSetImpl
   */
  protected CachedRowSet newCachedRowSet() throws SQLException {
    return new CachedRowSetImpl();
  }
View Full Code Here

         connection = dao_.getExoDatasource().getConnection();
         Statement statement =
            connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
         ResultSet resultSet = statement.executeQuery(query);

         CachedRowSet crs = new CachedRowSetImpl();
         crs.setPageSize(pageList.getPageSize());
         crs.populate(resultSet, (pageList.getCurrentPage() - 1) * pageList.getPageSize() + 1);

         while (crs.next())
         {
            T bean = dao_.createInstance();
            dao_.getDBObjectMapper().mapResultSet(crs, bean);
            currentListPage_.add(bean);
         }
View Full Code Here

          if (scrolling)
            model =  m_model.buildTableModel(rs);
            //model = new DefaultTableModel();
         
          else {
            CachedRowSet crs = new CachedRowSetImpl();
            crs.populate(rs);
            model = m_model.buildTableModel(crs);
          }

          table.setModel(model);
         
View Full Code Here

   {
      // load the MySQL driver
      Class.forName( "com.mysql.jdbc.Driver" );
     
      // specify properties of CachedRowSet
      rowSet = new CachedRowSetImpl()
      rowSet.setUrl( "jdbc:mysql://localhost/guestbook" );
      rowSet.setUsername( "jhtp6" );
      rowSet.setPassword( "jhtp6" );

    // obtain list of titles
View Full Code Here

         connection = dao_.getExoDatasource().getConnection();
         Statement statement =
            connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
         ResultSet resultSet = statement.executeQuery(query);

         CachedRowSet crs = new CachedRowSetImpl();
         crs.setPageSize(pageList.getPageSize());
         crs.populate(resultSet, (pageList.getCurrentPage() - 1) * pageList.getPageSize() + 1);

         while (crs.next())
         {
            T bean = dao_.createInstance();
            dao_.getDBObjectMapper().mapResultSet(crs, bean);
            currentListPage_.add(bean);
         }
View Full Code Here

TOP

Related Classes of com.sun.rowset.CachedRowSetImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.