Package javax.sql.rowset

Examples of javax.sql.rowset.CachedRowSet


          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateInt(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here


          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateFloat(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here

          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateDouble(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here

          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateLong(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here

          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateBoolean(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here

          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateShort(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here

          throw errorVar;
        }
      } else {
        // AD:20/11/2008: Allow for CachedRowSet to be updated if the DBDataSet has already been populated.
        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateString(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), Framework.Constants.SP_ER_USER, Framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
View Full Code Here

  private void populateResults(PreparedStatement ps, ResultSet rs) throws SQLException {
    if (rs == null) {
      resultSet = null;
    }
    else {
      CachedRowSet rowSet = new CachedRowSetImpl();
      final ResultSetMetaData md = new DelegatingResultSetMetaData(rs.getMetaData()) {
        @Override
        public int getScale(int column) throws SQLException {
          int result = super.getScale(column);
          if (result < 0) {
            result = 0;
          }
          return result;
       
      };
     
      ResultSet rsNew = new DelegatingResultSet(rs) {
        @Override
        public ResultSetMetaData getMetaData() throws SQLException {
          return md;
        }
      };
     
      rowSet.populate(rsNew);
      resultSet = rowSet;
     
      this.resultSetType = rs.getType();
      this.resultSetConcurrency = rs.getConcurrency();
    }
View Full Code Here

   * @throws SQLException if thrown by JDBC methods
   * @see #newCachedRowSet
   * @see org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
   */
  protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
    CachedRowSet rowSet = newCachedRowSet();
    rowSet.populate(rs);
    return new ResultSetWrappingSqlRowSet(rowSet);
  }
View Full Code Here

            rowTag = "currentRow";
        }
        assertEquals(rowTag, ele.getTagName());

        // the original row
        CachedRowSet originalRow = (CachedRowSet) webRs.getOriginalRow();
        assertTrue(originalRow.next());

        NodeList nodeList = ele.getChildNodes();
        int colIndex = 0;
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node node = nodeList.item(i);
            if (node instanceof Element) {
                Element element = (Element) node;
                String tag = element.getTagName();
                String content = element.getChildNodes().item(0).getNodeValue();
                if ("columnValue".equals(tag)) {
                    colIndex++;
                    if (content == null) {
                        assertNull(originalRow.getObject(colIndex));
                    } else {
                        String columnValue = null;
                        int columnType = webRs.getMetaData().getColumnType(
                                colIndex);
                        if (Types.DATE == columnType) {
                            columnValue = Long.toString(originalRow.getDate(
                                    colIndex).getTime());
                        } else if (Types.TIME == columnType) {
                            columnValue = Long.toString(originalRow.getTime(
                                    colIndex).getTime());
                        } else if (Types.TIMESTAMP == columnType) {
                            columnValue = Long.toString(originalRow
                                    .getTimestamp(colIndex).getTime());
                        } else {
                            columnValue = originalRow.getString(colIndex);
                        }
                        assertEquals(content, columnValue);
                    }
                } else {
                    if (content == null) {
View Full Code Here

TOP

Related Classes of javax.sql.rowset.CachedRowSet

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.