4353 lines · 201.8 KB · Java
RawDownload
     *         the new column value     * @throws SQLException if (1) the given column name is not valid,     *            (2) the cursor is not on one of this rowset's rows or its     *            insert row, or (3) this rowset is     *            <code>ResultSet.CONCUR_READ_ONLY</code>     */    public void updateArray(String columnName, Array a) throws SQLException {         crsInternal.updateArray(columnName, a);    }     /**     * Populates this <code>JoinRowSetImpl</code> object with data.     * This form of the method uses the rowset's user, password, and url or     * data source name properties to create a database     * connection.  If properties that are needed     * have not been set, this method will throw an exception.     * <P>     * Another form of this method uses an existing JDBC <code>Connection</code>     * object instead of creating a new one; therefore, it ignores the     * properties used for establishing a new connection.     * <P>     * The query specified by the command property is executed to create a     * <code>ResultSet</code> object from which to retrieve data.     * The current contents of the rowset are discarded, and the     * rowset's metadata is also (re)set.  If there are outstanding updates,     * they are also ignored.     * <P>     * The method <code>execute</code> closes any database connections that it     * creates.     *     * @throws SQLException if an error occurs or the     *                         necessary properties have not been set     */    public void execute() throws SQLException {        crsInternal.execute();    }     /**     * Populates this <code>JoinRowSetImpl</code> object with data,     * using the given connection to produce the result set from     * which data will be read.  A second form of this method,     * which takes no arguments, uses the values from this rowset's     * user, password, and either url or data source properties to     * create a new database connection. The form of <code>execute</code>     * that is given a connection ignores these properties.     *     *  @param conn A standard JDBC <code>Connection</code> object with valid     *           properties that the <code>JoinRowSet</code> implementation     *           can pass to a synchronization provider to establish a     *           connection to the datasource     * @throws SQLException if an invalid <code>Connection</code> is supplied     *           or an error occurs in establishing the connection to the     *           data soure     * @see java.sql.Connection     */    public void execute(Connection conn) throws SQLException {        crsInternal.execute(conn);    }     /**     * Provide interface coverage for getURL(int) in ResultSet->RowSet     */    public java.net.URL getURL(int columnIndex) throws SQLException {        return crsInternal.getURL(columnIndex);    }     /**     * Provide interface coverage for getURL(String) in ResultSet->RowSet     */    public java.net.URL getURL(String columnName) throws SQLException {        return crsInternal.getURL(columnName);    }    /**    * Creates a new <code>WebRowSet</code> object, populates it with the    * data in the given <code>ResultSet</code> object, and writes it    * to the given <code>java.io.Writer</code> object in XML format.    *    * @throws SQLException if an error occurs writing out the rowset    *          contents to XML    */    public void writeXml(ResultSet rs, java.io.Writer writer)        throws SQLException {             wrs = new WebRowSetImpl();             wrs.populate(rs);             wrs.writeXml(writer);    }     /**     * Writes this <code>JoinRowSet</code> object to the given     * <code>java.io.Writer</code> object in XML format. In     * addition to the rowset's data, its properties and metadata     * are also included.     *     * @throws SQLException if an error occurs writing out the rowset     *          contents to XML     */    public void writeXml(java.io.Writer writer) throws SQLException {        createWebRowSet().writeXml(writer);}     /**     * Reads this <code>JoinRowSet</code> object in its XML format.     *     * @throws SQLException if a database access error occurs     */    public void readXml(java.io.Reader reader) throws SQLException {        wrs = new WebRowSetImpl();        wrs.readXml(reader);        crsInternal = (CachedRowSetImpl)wrs;    }     // Stream based methods    /**     * Reads a stream based XML input to populate an <code>WebRowSet</code>     *     * @throws SQLException if a data source access occurs     * @throws IOException if a IO exception occurs     */    public void readXml(java.io.InputStream iStream) throws SQLException, IOException {         wrs = new WebRowSetImpl();         wrs.readXml(iStream);         crsInternal = (CachedRowSetImpl)wrs;    }     /**     * Creates an an output stream of the internal state and contents of a     * <code>WebRowSet</code> for XML proceessing     *     * @throws SQLException if a datasource access occurs     * @throws IOException if an IO exception occurs     */    public void writeXml(java.io.OutputStream oStream) throws SQLException, IOException {         createWebRowSet().writeXml(oStream);    }     /**     * Creates a new <code>WebRowSet</code> object, populates it with     * the contents of the <code>ResultSet</code> and creates an output     * streams the internal state and contents of the rowset for XML processing.     *     * @throws SQLException if a datasource access occurs     * @throws IOException if an IO exception occurs     */    public void writeXml(ResultSet rs, java.io.OutputStream oStream) throws SQLException, IOException {             wrs = new WebRowSetImpl();             wrs.populate(rs);             wrs.writeXml(oStream);    }     /**     * %%% Javadoc comments to be added here     */    private WebRowSet createWebRowSet() throws SQLException {       if(wrs != null) {           // check if it has already been initialized.           return wrs;       } else {         wrs = new WebRowSetImpl();          crsInternal.beforeFirst();          wrs.populate(crsInternal);          return wrs;       }    }     /**     * Returns the last set SQL <code>JOIN</code> type in this JoinRowSetImpl     * object     *     * @return joinType One of the standard JoinRowSet static field JOIN types     * @throws SQLException if an error occurs determining the current join type     */    public int getJoinType() throws SQLException {        if (vecJoinType == null) {            // Default JoinRowSet type            this.setJoinType(JoinRowSet.INNER_JOIN);        }        Integer i = (Integer)(vecJoinType.get(vecJoinType.size()-1));        return i.intValue();    }     /**    * The listener will be notified whenever an event occurs on this <code>JoinRowSet</code>    * object.    * <P>    * A listener might, for example, be a table or graph that needs to    * be updated in order to accurately reflect the current state of    * the <code>RowSet</code> object.    * <p>    * <b>Note</b>: if the <code>RowSetListener</code> object is    * <code>null</code>, this method silently discards the <code>null</code>    * value and does not add a null reference to the set of listeners.    * <p>    * <b>Note</b>: if the listener is already set, and the new <code>RowSetListerner</code>    * instance is added to the set of listeners already registered to receive    * event notifications from this <code>RowSet</code>.    *    * @param listener an object that has implemented the    *     <code>javax.sql.RowSetListener</code> interface and wants to be notified    *     of any events that occur on this <code>JoinRowSet</code> object; May be    *     null.    * @see #removeRowSetListener    */    public void addRowSetListener(RowSetListener listener) {        crsInternal.addRowSetListener(listener);    }     /**    * Removes the designated object from this <code>JoinRowSet</code> object's list of listeners.    * If the given argument is not a registered listener, this method    * does nothing.    *    *  <b>Note</b>: if the <code>RowSetListener</code> object is    * <code>null</code>, this method silently discards the <code>null</code>    * value.    *    * @param listener a <code>RowSetListener</code> object that is on the list    *        of listeners for this <code>JoinRowSet</code> object    * @see #addRowSetListener    */     public void removeRowSetListener(RowSetListener listener) {        crsInternal.removeRowSetListener(listener);    }     /**     * Converts this <code>JoinRowSetImpl</code> object to a collection     * of tables. The sample implementation utilitizes the <code>TreeMap</code>     * collection type.     * This class guarantees that the map will be in ascending key order,     * sorted according to the natural order for the key's class.     *     * @return a <code>Collection</code> object consisting of tables,     *         each of which is a copy of a row in this     *         <code>JoinRowSetImpl</code> object     * @throws SQLException if an error occurs in generating the collection     * @see #toCollection(int)     * @see #toCollection(String)     * @see java.util.TreeMap     */     public Collection<?> toCollection() throws SQLException {        return crsInternal.toCollection();    }     /**     * Returns the specified column of this <code>JoinRowSetImpl</code> object     * as a <code>Collection</code> object.  This method makes a copy of the     * column's data and utilitizes the <code>Vector</code> to establish the     * collection. The <code>Vector</code> class implements a growable array     * objects allowing the individual components to be accessed using an     * an integer index similar to that of an array.     *     * @return a <code>Collection</code> object that contains the value(s)     *         stored in the specified column of this     *         <code>JoinRowSetImpl</code>     *         object     * @throws SQLException if an error occurs generated the collection; or     *          an invalid column is provided.     * @see #toCollection()     * @see #toCollection(String)     * @see java.util.Vector     */    public Collection<?> toCollection(int column) throws SQLException {        return crsInternal.toCollection(column);    }     /**     * Returns the specified column of this <code>JoinRowSetImpl</code> object     * as a <code>Collection</code> object.  This method makes a copy of the     * column's data and utilitizes the <code>Vector</code> to establish the     * collection. The <code>Vector</code> class implements a growable array     * objects allowing the individual components to be accessed using an     * an integer index similar to that of an array.     *     * @return a <code>Collection</code> object that contains the value(s)     *         stored in the specified column of this     *         <code>JoinRowSetImpl</code>     *         object     * @throws SQLException if an error occurs generated the collection; or     *          an invalid column is provided.     * @see #toCollection()     * @see #toCollection(int)     * @see java.util.Vector     */    public Collection<?> toCollection(String column) throws SQLException {        return crsInternal.toCollection(column);    }     /**     * Creates a <code>RowSet</code> object that is a copy of     * this <code>JoinRowSetImpl</code> object's table structure     * and the constraints only.     * There will be no data in the object being returned.     * Updates made on a copy are not visible to the original rowset.     * <P>     * This helps in getting the underlying XML schema which can     * be used as the basis for populating a <code>WebRowSet</code>.     *     * @return a new <code>CachedRowSet</code> object that is a copy     * of this <code>JoinRowSetImpl</code> object's schema and     * retains all the constraints on the original rowset but contains     * no data     * @throws SQLException if an error occurs in generating the copy     * of the <code>CachedRowSet</code> object     * @see #createShared     * @see #createCopy     * @see #createCopyNoConstraints     * @see javax.sql.RowSetEvent     * @see javax.sql.RowSetListener     */     public CachedRowSet createCopySchema() throws SQLException {         return crsInternal.createCopySchema();     }      /**      * {@inheritDoc}      */     public void setSyncProvider(String providerStr) throws SQLException {         crsInternal.setSyncProvider(providerStr);     }      /**      * {@inheritDoc}      */     public void acceptChanges() throws SyncProviderException {         crsInternal.acceptChanges();     }      /**      * {@inheritDoc}      */     public SyncProvider getSyncProvider() throws SQLException {        return crsInternal.getSyncProvider();     }     /**     * This method re populates the resBundle     * during the deserialization process     *     */     private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {        // Default state initialization happens here        ois.defaultReadObject();        // Initialization of transient Res Bundle happens here .        try {           resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();        } catch(IOException ioe) {            throw new RuntimeException(ioe);        }      }      static final long serialVersionUID = -5590501621560008453L;}

Lines 4001–4353 of 4353. Previous lines