0N/A/*
3999N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.rowset;
0N/A
0N/Aimport java.sql.*;
0N/Aimport javax.sql.*;
0N/Aimport java.io.*;
0N/Aimport java.math.*;
0N/Aimport java.util.*;
0N/Aimport java.text.*;
0N/A
0N/Aimport javax.sql.rowset.*;
0N/Aimport javax.sql.rowset.spi.*;
0N/Aimport javax.sql.rowset.serial.*;
0N/Aimport com.sun.rowset.internal.*;
0N/Aimport com.sun.rowset.providers.*;
0N/A
0N/A/**
0N/A * The standard implementation of the <code>CachedRowSet</code> interface.
0N/A *
0N/A * See interface defintion for full behaviour and implementation requirements.
0N/A * This reference implementation has made provision for a one-to-one write back
0N/A * facility and it is curremtly be possible to change the peristence provider
0N/A * during the life-time of any CachedRowSetImpl.
0N/A *
0N/A * @author Jonathan Bruce, Amit Handa
0N/A */
0N/A
0N/Apublic class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetInternal, Serializable, Cloneable, CachedRowSet {
0N/A
0N/A /**
0N/A * The <code>SyncProvider</code> used by the CachedRowSet
0N/A */
0N/A private SyncProvider provider;
0N/A
0N/A /**
0N/A * The <code>RowSetReaderImpl</code> object that is the reader
0N/A * for this rowset. The method <code>execute</code> uses this
0N/A * reader as part of its implementation.
0N/A * @serial
0N/A */
0N/A private RowSetReader rowSetReader;
0N/A
0N/A /**
0N/A * The <code>RowSetWriterImpl</code> object that is the writer
0N/A * for this rowset. The method <code>acceptChanges</code> uses
0N/A * this writer as part of its implementation.
0N/A * @serial
0N/A */
0N/A private RowSetWriter rowSetWriter;
0N/A
0N/A /**
0N/A * The <code>Connection</code> object that connects with this
0N/A * <code>CachedRowSetImpl</code> object's current underlying data source.
0N/A */
0N/A private transient Connection conn;
0N/A
0N/A /**
0N/A * The <code>ResultSetMetaData</code> object that contains information
0N/A * about the columns in the <code>ResultSet</code> object that is the
0N/A * current source of data for this <code>CachedRowSetImpl</code> object.
0N/A */
0N/A private transient ResultSetMetaData RSMD;
0N/A
0N/A /**
0N/A * The <code>RowSetMetaData</code> object that contains information about
0N/A * the columns in this <code>CachedRowSetImpl</code> object.
0N/A * @serial
0N/A */
0N/A private RowSetMetaDataImpl RowSetMD;
0N/A
0N/A // Properties of this RowSet
0N/A
0N/A /**
0N/A * An array containing the columns in this <code>CachedRowSetImpl</code>
0N/A * object that form a unique identifier for a row. This array
0N/A * is used by the writer.
0N/A * @serial
0N/A */
0N/A private int keyCols[];
0N/A
0N/A /**
0N/A * The name of the table in the underlying database to which updates
0N/A * should be written. This name is needed because most drivers
0N/A * do not return this information in a <code>ResultSetMetaData</code>
0N/A * object.
0N/A * @serial
0N/A */
0N/A private String tableName;
0N/A
0N/A /**
0N/A * A <code>Vector</code> object containing the <code>Row</code>
0N/A * objects that comprise this <code>CachedRowSetImpl</code> object.
0N/A * @serial
0N/A */
3999N/A private Vector<Object> rvh;
3999N/A
0N/A /**
0N/A * The current postion of the cursor in this <code>CachedRowSetImpl</code>
0N/A * object.
0N/A * @serial
0N/A */
0N/A private int cursorPos;
0N/A
0N/A /**
0N/A * The current postion of the cursor in this <code>CachedRowSetImpl</code>
0N/A * object not counting rows that have been deleted, if any.
0N/A * <P>
0N/A * For example, suppose that the cursor is on the last row of a rowset
0N/A * that started with five rows and subsequently had the second and third
0N/A * rows deleted. The <code>absolutePos</code> would be <code>3</code>,
0N/A * whereas the <code>cursorPos</code> would be <code>5</code>.
0N/A * @serial
0N/A */
0N/A private int absolutePos;
0N/A
0N/A /**
0N/A * The number of deleted rows currently in this <code>CachedRowSetImpl</code>
0N/A * object.
0N/A * @serial
0N/A */
0N/A private int numDeleted;
0N/A
0N/A /**
0N/A * The total number of rows currently in this <code>CachedRowSetImpl</code>
0N/A * object.
0N/A * @serial
0N/A */
0N/A private int numRows;
0N/A
0N/A /**
0N/A * A special row used for constructing a new row. A new
0N/A * row is constructed by using <code>ResultSet.updateXXX</code>
0N/A * methods to insert column values into the insert row.
0N/A * @serial
0N/A */
0N/A private InsertRow insertRow;
0N/A
0N/A /**
0N/A * A <code>boolean</code> indicating whether the cursor is
0N/A * currently on the insert row.
0N/A * @serial
0N/A */
0N/A private boolean onInsertRow;
0N/A
0N/A /**
0N/A * The field that temporarily holds the last position of the
0N/A * cursor before it moved to the insert row, thus preserving
0N/A * the number of the current row to which the cursor may return.
0N/A * @serial
0N/A */
0N/A private int currentRow;
0N/A
0N/A /**
0N/A * A <code>boolean</code> indicating whether the last value
0N/A * returned was an SQL <code>NULL</code>.
0N/A * @serial
0N/A */
0N/A private boolean lastValueNull;
0N/A
0N/A /**
0N/A * A <code>SQLWarning</code> which logs on the warnings
0N/A */
0N/A private SQLWarning sqlwarn;
0N/A
0N/A /**
0N/A * Used to track match column for JoinRowSet consumption
0N/A */
0N/A private String strMatchColumn ="";
0N/A
0N/A /**
0N/A * Used to track match column for JoinRowSet consumption
0N/A */
0N/A private int iMatchColumn = -1;
0N/A
0N/A /**
0N/A * A <code>RowSetWarning</code> which logs on the warnings
0N/A */
0N/A private RowSetWarning rowsetWarning;
0N/A
0N/A /**
0N/A * The default SyncProvider for the RI CachedRowSetImpl
0N/A */
0N/A private String DEFAULT_SYNC_PROVIDER = "com.sun.rowset.providers.RIOptimisticProvider";
0N/A
0N/A /**
0N/A * The boolean variable indicating locatorsUpdateValue
0N/A */
0N/A private boolean dbmslocatorsUpdateCopy;
0N/A
0N/A /**
0N/A * The <code>ResultSet</code> object that is used to maintain the data when
0N/A * a ResultSet and start position are passed as parameters to the populate function
0N/A */
0N/A private transient ResultSet resultSet;
0N/A
0N/A /**
0N/A * The integer value indicating the end position in the ResultSetwhere the picking
0N/A * up of rows for populating a CachedRowSet object was left off.
0N/A */
0N/A private int endPos;
0N/A
0N/A /**
0N/A * The integer value indicating the end position in the ResultSetwhere the picking
0N/A * up of rows for populating a CachedRowSet object was left off.
0N/A */
0N/A private int prevEndPos;
0N/A
0N/A /**
0N/A * The integer value indicating the position in the ResultSet, to populate the
0N/A * CachedRowSet object.
0N/A */
0N/A private int startPos;
0N/A
0N/A /**
0N/A * The integer value indicating the positon from where the page prior to this
0N/A * was populated.
0N/A */
0N/A private int startPrev;
0N/A
0N/A /**
0N/A * The integer value indicating size of the page.
0N/A */
0N/A private int pageSize;
0N/A
0N/A /**
0N/A * The integer value indicating number of rows that have been processed so far.
0N/A * Used for checking whether maxRows has been reached or not.
0N/A */
0N/A private int maxRowsreached;
0N/A /**
0N/A * The boolean value when true signifies that pages are still to follow and a
0N/A * false value indicates that this is the last page.
0N/A */
0N/A private boolean pagenotend = true;
0N/A
0N/A /**
0N/A * The boolean value indicating whether this is the first page or not.
0N/A */
0N/A private boolean onFirstPage;
0N/A
0N/A /**
0N/A * The boolean value indicating whether this is the last page or not.
0N/A */
0N/A private boolean onLastPage;
0N/A
0N/A /**
0N/A * The integer value indicating how many times the populate function has been called.
0N/A */
0N/A private int populatecallcount;
0N/A
0N/A /**
0N/A * The integer value indicating the total number of rows to be processed in the
0N/A * ResultSet object passed to the populate function.
0N/A */
0N/A private int totalRows;
0N/A
0N/A /**
0N/A * The boolean value indicating how the CahedRowSet object has been populated for
0N/A * paging purpose. True indicates that connection parameter is passed.
0N/A */
0N/A private boolean callWithCon;
0N/A
0N/A /**
0N/A * CachedRowSet reader object to read the data from the ResultSet when a connection
0N/A * parameter is passed to populate the CachedRowSet object for paging.
0N/A */
0N/A private CachedRowSetReader crsReader;
0N/A
0N/A /**
0N/A * The Vector holding the Match Columns
0N/A */
3999N/A private Vector<Integer> iMatchColumns;
0N/A
0N/A /**
0N/A * The Vector that will hold the Match Column names.
0N/A */
3999N/A private Vector<String> strMatchColumns;
0N/A
0N/A /**
0N/A * Trigger that indicates whether the active SyncProvider is exposes the
0N/A * additional TransactionalWriter method
0N/A */
0N/A private boolean tXWriter = false;
0N/A
0N/A /**
0N/A * The field object for a transactional RowSet writer
0N/A */
0N/A private TransactionalWriter tWriter = null;
0N/A
0N/A protected transient JdbcRowSetResourceBundle resBundle;
0N/A
0N/A private boolean updateOnInsert;
0N/A
0N/A
0N/A
0N/A /**
0N/A * Constructs a new default <code>CachedRowSetImpl</code> object with
0N/A * the capacity to hold 100 rows. This new object has no metadata
0N/A * and has the following default values:
0N/A * <pre>
0N/A * onInsertRow = false
0N/A * insertRow = null
0N/A * cursorPos = 0
0N/A * numRows = 0
0N/A * showDeleted = false
0N/A * queryTimeout = 0
0N/A * maxRows = 0
0N/A * maxFieldSize = 0
0N/A * rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE
0N/A * concurrency = ResultSet.CONCUR_UPDATABLE
0N/A * readOnly = false
0N/A * isolation = Connection.TRANSACTION_READ_COMMITTED
0N/A * escapeProcessing = true
0N/A * onInsertRow = false
0N/A * insertRow = null
0N/A * cursorPos = 0
0N/A * absolutePos = 0
0N/A * numRows = 0
0N/A * </pre>
0N/A * A <code>CachedRowSetImpl</code> object is configured to use the default
0N/A * <code>RIOptimisticProvider</code> implementation to provide connectivity
0N/A * and synchronization capabilities to the set data source.
0N/A * <P>
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public CachedRowSetImpl() throws SQLException {
0N/A
0N/A try {
0N/A resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
0N/A } catch(IOException ioe) {
0N/A throw new RuntimeException(ioe);
0N/A }
0N/A
0N/A // set the Reader, this maybe overridden latter
0N/A provider =
0N/A (SyncProvider)SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
0N/A
0N/A if (!(provider instanceof RIOptimisticProvider)) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString());
0N/A }
0N/A
0N/A rowSetReader = (CachedRowSetReader)provider.getRowSetReader();
0N/A rowSetWriter = (CachedRowSetWriter)provider.getRowSetWriter();
0N/A
0N/A // allocate the parameters collection
0N/A initParams();
0N/A
0N/A initContainer();
0N/A
0N/A // set up some default values
0N/A initProperties();
0N/A
0N/A // insert row setup
0N/A onInsertRow = false;
0N/A insertRow = null;
0N/A
0N/A // set the warninings
0N/A sqlwarn = new SQLWarning();
0N/A rowsetWarning = new RowSetWarning();
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Provides a <code>CachedRowSetImpl</code> instance with the same default properties as
0N/A * as the zero parameter constructor.
0N/A * <pre>
0N/A * onInsertRow = false
0N/A * insertRow = null
0N/A * cursorPos = 0
0N/A * numRows = 0
0N/A * showDeleted = false
0N/A * queryTimeout = 0
0N/A * maxRows = 0
0N/A * maxFieldSize = 0
0N/A * rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE
0N/A * concurrency = ResultSet.CONCUR_UPDATABLE
0N/A * readOnly = false
0N/A * isolation = Connection.TRANSACTION_READ_COMMITTED
0N/A * escapeProcessing = true
0N/A * onInsertRow = false
0N/A * insertRow = null
0N/A * cursorPos = 0
0N/A * absolutePos = 0
0N/A * numRows = 0
0N/A * </pre>
0N/A *
0N/A * However, applications will have the means to specify at runtime the
0N/A * desired <code>SyncProvider</code> object.
0N/A * <p>
0N/A * For example, creating a <code>CachedRowSetImpl</code> object as follows ensures
0N/A * that a it is established with the <code>com.foo.provider.Impl</code> synchronization
0N/A * implementation providing the synchronization mechanism for this disconnected
0N/A * <code>RowSet</code> object.
0N/A * <pre>
0N/A * Hashtable env = new Hashtable();
0N/A * env.put(javax.sql.rowset.spi.SyncFactory.ROWSET_PROVIDER_NAME,
0N/A * "com.foo.provider.Impl");
0N/A * CachedRowSetImpl crs = new CachedRowSet(env);
0N/A * </pre>
0N/A * <p>
0N/A * Calling this constructor with a <code>null</code> parameter will
0N/A * cause the <code>SyncFactory</code> to provide the reference
0N/A * optimistic provider <code>com.sun.rowset.providers.RIOptimisticProvider</code>.
0N/A * <p>
0N/A * In addition, the following properties can be associated with the
0N/A * provider to assist in determining the choice of the synchronizaton
0N/A * provider such as:
0N/A * <ul>
0N/A * <li><code>ROWSET_SYNC_PROVIDER</code> - the property specifying the the
0N/A * <code>SyncProvider</code> class name to be instantiated by the
0N/A * <code>SyncFacttory</code>
0N/A * <li><code>ROWSET_SYNC_VENDOR</code> - the property specifying the software
0N/A * vendor associated with a <code>SyncProvider</code> implementation.
0N/A * <li><code>ROWSET_SYNC_PROVIDER_VER</code> - the property specifying the
0N/A * version of the <code>SyncProvider</code> implementation provided by the
0N/A * software vendor.
0N/A * </ul>
0N/A * More specific detailes are available in the <code>SyncFactory</code>
0N/A * and <code>SyncProvider</code> specificiations later in this document.
0N/A * <p>
0N/A * @param env a <code>Hashtable</code> object with a list of desired
0N/A * synchronization providers
0N/A * @throws SQLException if the requested provider cannot be found by the
0N/A * synchonization factory
0N/A * @see SyncProvider
0N/A */
0N/A
0N/A public CachedRowSetImpl(Hashtable env) throws SQLException {
0N/A
0N/A
0N/A try {
0N/A resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
0N/A } catch(IOException ioe) {
0N/A throw new RuntimeException(ioe);
0N/A }
0N/A
0N/A if (env == null) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.nullhash").toString());
0N/A }
0N/A
0N/A String providerName = (String)env.get(
0N/A javax.sql.rowset.spi.SyncFactory.ROWSET_SYNC_PROVIDER);
0N/A
0N/A // set the Reader, this maybe overridden latter
0N/A provider =
0N/A (SyncProvider)SyncFactory.getInstance(providerName);
0N/A
0N/A rowSetReader = provider.getRowSetReader();
0N/A rowSetWriter = provider.getRowSetWriter();
0N/A
0N/A initParams(); // allocate the parameters collection
0N/A initContainer();
0N/A initProperties(); // set up some default values
0N/A }
0N/A
0N/A /**
0N/A * Sets the <code>rvh</code> field to a new <code>Vector</code>
0N/A * object with a capacity of 100 and sets the
0N/A * <code>cursorPos</code> and <code>numRows</code> fields to zero.
0N/A */
0N/A private void initContainer() {
0N/A
3999N/A rvh = new Vector<Object>(100);
0N/A cursorPos = 0;
0N/A absolutePos = 0;
0N/A numRows = 0;
0N/A numDeleted = 0;
0N/A }
0N/A
0N/A /**
0N/A * Sets the properties for this <code>CachedRowSetImpl</code> object to
0N/A * their default values. This method is called internally by the
0N/A * default constructor.
0N/A */
0N/A
0N/A private void initProperties() throws SQLException {
0N/A
0N/A if(resBundle == null) {
0N/A try {
0N/A resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
0N/A } catch(IOException ioe) {
0N/A throw new RuntimeException(ioe);
0N/A }
0N/A }
0N/A setShowDeleted(false);
0N/A setQueryTimeout(0);
0N/A setMaxRows(0);
0N/A setMaxFieldSize(0);
0N/A setType(ResultSet.TYPE_SCROLL_INSENSITIVE);
0N/A setConcurrency(ResultSet.CONCUR_UPDATABLE);
0N/A if((rvh.size() > 0) && (isReadOnly() == false))
0N/A setReadOnly(false);
0N/A else
0N/A setReadOnly(true);
0N/A setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
0N/A setEscapeProcessing(true);
2741N/A //setTypeMap(null);
0N/A checkTransactionalWriter();
0N/A
0N/A //Instantiating the vector for MatchColumns
0N/A
3999N/A iMatchColumns = new Vector<Integer>(10);
0N/A for(int i = 0; i < 10 ; i++) {
2828N/A iMatchColumns.add(i,Integer.valueOf(-1));
0N/A }
0N/A
3999N/A strMatchColumns = new Vector<String>(10);
0N/A for(int j = 0; j < 10; j++) {
0N/A strMatchColumns.add(j,null);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Determine whether the SyncProvider's writer implements the
0N/A * <code>TransactionalWriter<code> interface
0N/A */
0N/A private void checkTransactionalWriter() {
0N/A if (rowSetWriter != null) {
0N/A Class c = rowSetWriter.getClass();
0N/A if (c != null) {
0N/A Class[] theInterfaces = c.getInterfaces();
0N/A for (int i = 0; i < theInterfaces.length; i++) {
0N/A if ((theInterfaces[i].getName()).indexOf("TransactionalWriter") > 0) {
0N/A tXWriter = true;
0N/A establishTransactionalWriter();
0N/A }
0N/A }
0N/A }
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets an private field to all transaction bounddaries to be set
0N/A */
0N/A private void establishTransactionalWriter() {
0N/A tWriter = (TransactionalWriter)provider.getRowSetWriter();
0N/A }
0N/A
0N/A //-----------------------------------------------------------------------
0N/A // Properties
0N/A //-----------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Sets this <code>CachedRowSetImpl</code> object's command property
0N/A * to the given <code>String</code> object and clears the parameters,
0N/A * if any, that were set for the previous command.
0N/A * <P>
0N/A * The command property may not be needed
0N/A * if the rowset is produced by a data source, such as a spreadsheet,
0N/A * that does not support commands. Thus, this property is optional
0N/A * and may be <code>null</code>.
0N/A *
0N/A * @param cmd a <code>String</code> object containing an SQL query
0N/A * that will be set as the command; may be <code>null</code>
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public void setCommand(String cmd) throws SQLException {
0N/A
0N/A super.setCommand(cmd);
0N/A
0N/A if(!buildTableName(cmd).equals("")) {
0N/A this.setTableName(buildTableName(cmd));
0N/A }
0N/A }
0N/A
0N/A
0N/A //---------------------------------------------------------------------
0N/A // Reading and writing data
0N/A //---------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Populates this <code>CachedRowSetImpl</code> object with data from
0N/A * the given <code>ResultSet</code> object. This
0N/A * method is an alternative to the method <code>execute</code>
0N/A * for filling the rowset with data. The method <code>populate</code>
0N/A * does not require that the properties needed by the method
0N/A * <code>execute</code>, such as the <code>command</code> property,
0N/A * be set. This is true because the method <code>populate</code>
0N/A * is given the <code>ResultSet</code> object from
0N/A * which to get data and thus does not need to use the properties
0N/A * required for setting up a connection and executing this
0N/A * <code>CachedRowSetImpl</code> object's command.
0N/A * <P>
0N/A * After populating this rowset with data, the method
0N/A * <code>populate</code> sets the rowset's metadata and
0N/A * then sends a <code>RowSetChangedEvent</code> object
0N/A * to all registered listeners prior to returning.
0N/A *
0N/A * @param data the <code>ResultSet</code> object containing the data
0N/A * to be read into this <code>CachedRowSetImpl</code> object
0N/A * @throws SQLException if an error occurs; or the max row setting is
0N/A * violated while populating the RowSet
0N/A * @see #execute
0N/A */
0N/A
0N/A public void populate(ResultSet data) throws SQLException {
0N/A int rowsFetched;
0N/A Row currentRow;
0N/A int numCols;
0N/A int i;
3999N/A Map<String, Class<?>> map = getTypeMap();
0N/A Object obj;
0N/A int mRows;
0N/A
0N/A if (data == null) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.populate").toString());
0N/A }
0N/A this.resultSet = data;
0N/A
0N/A // get the meta data for this ResultSet
0N/A RSMD = data.getMetaData();
0N/A
0N/A // set up the metadata
0N/A RowSetMD = new RowSetMetaDataImpl();
0N/A initMetaData(RowSetMD, RSMD);
0N/A
0N/A // release the meta-data so that aren't tempted to use it.
0N/A RSMD = null;
0N/A numCols = RowSetMD.getColumnCount();
0N/A mRows = this.getMaxRows();
0N/A rowsFetched = 0;
0N/A currentRow = null;
0N/A
0N/A while ( data.next()) {
0N/A
0N/A currentRow = new Row(numCols);
0N/A
0N/A if ( rowsFetched > mRows && mRows > 0) {
0N/A rowsetWarning.setNextWarning(new RowSetWarning("Populating rows "
0N/A + "setting has exceeded max row setting"));
0N/A }
0N/A for ( i = 1; i <= numCols; i++) {
0N/A /*
0N/A * check if the user has set a map. If no map
0N/A * is set then use plain getObject. This lets
0N/A * us work with drivers that do not support
0N/A * getObject with a map in fairly sensible way
0N/A */
0N/A if (map == null) {
0N/A obj = data.getObject(i);
0N/A } else {
0N/A obj = data.getObject(i, map);
0N/A }
0N/A /*
0N/A * the following block checks for the various
0N/A * types that we have to serialize in order to
0N/A * store - right now only structs have been tested
0N/A */
0N/A if (obj instanceof Struct) {
0N/A obj = new SerialStruct((Struct)obj, map);
0N/A } else if (obj instanceof SQLData) {
0N/A obj = new SerialStruct((SQLData)obj, map);
0N/A } else if (obj instanceof Blob) {
0N/A obj = new SerialBlob((Blob)obj);
0N/A } else if (obj instanceof Clob) {
0N/A obj = new SerialClob((Clob)obj);
0N/A } else if (obj instanceof java.sql.Array) {
2741N/A if(map != null)
2741N/A obj = new SerialArray((java.sql.Array)obj, map);
2741N/A else
2741N/A obj = new SerialArray((java.sql.Array)obj);
0N/A }
0N/A
0N/A ((Row)currentRow).initColumnObject(i, obj);
0N/A }
0N/A rowsFetched++;
0N/A rvh.add(currentRow);
0N/A }
0N/A
0N/A numRows = rowsFetched ;
0N/A // Also rowsFetched should be equal to rvh.size()
0N/A
0N/A // notify any listeners that the rowset has changed
0N/A notifyRowSetChanged();
0N/A
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Initializes the given <code>RowSetMetaData</code> object with the values
0N/A * in the given <code>ResultSetMetaData</code> object.
0N/A *
0N/A * @param md the <code>RowSetMetaData</code> object for this
0N/A * <code>CachedRowSetImpl</code> object, which will be set with
0N/A * values from rsmd
0N/A * @param rsmd the <code>ResultSetMetaData</code> object from which new
0N/A * values for md will be read
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A private void initMetaData(RowSetMetaDataImpl md, ResultSetMetaData rsmd) throws SQLException {
0N/A int numCols = rsmd.getColumnCount();
0N/A
0N/A md.setColumnCount(numCols);
0N/A for (int col=1; col <= numCols; col++) {
0N/A md.setAutoIncrement(col, rsmd.isAutoIncrement(col));
0N/A if(rsmd.isAutoIncrement(col))
0N/A updateOnInsert = true;
0N/A md.setCaseSensitive(col, rsmd.isCaseSensitive(col));
0N/A md.setCurrency(col, rsmd.isCurrency(col));
0N/A md.setNullable(col, rsmd.isNullable(col));
0N/A md.setSigned(col, rsmd.isSigned(col));
0N/A md.setSearchable(col, rsmd.isSearchable(col));
0N/A /*
0N/A * The PostgreSQL drivers sometimes return negative columnDisplaySize,
0N/A * which causes an exception to be thrown. Check for it.
0N/A */
0N/A int size = rsmd.getColumnDisplaySize(col);
0N/A if (size < 0) {
0N/A size = 0;
0N/A }
0N/A md.setColumnDisplaySize(col, size);
0N/A md.setColumnLabel(col, rsmd.getColumnLabel(col));
0N/A md.setColumnName(col, rsmd.getColumnName(col));
0N/A md.setSchemaName(col, rsmd.getSchemaName(col));
0N/A /*
0N/A * Drivers return some strange values for precision, for non-numeric data, including reports of
0N/A * non-integer values; maybe we should check type, & set to 0 for non-numeric types.
0N/A */
0N/A int precision = rsmd.getPrecision(col);
0N/A if (precision < 0) {
0N/A precision = 0;
0N/A }
0N/A md.setPrecision(col, precision);
0N/A
0N/A /*
0N/A * It seems, from a bug report, that a driver can sometimes return a negative
0N/A * value for scale. javax.sql.rowset.RowSetMetaDataImpl will throw an exception
0N/A * if we attempt to set a negative value. As such, we'll check for this case.
0N/A */
0N/A int scale = rsmd.getScale(col);
0N/A if (scale < 0) {
0N/A scale = 0;
0N/A }
0N/A md.setScale(col, scale);
0N/A md.setTableName(col, rsmd.getTableName(col));
0N/A md.setCatalogName(col, rsmd.getCatalogName(col));
0N/A md.setColumnType(col, rsmd.getColumnType(col));
0N/A md.setColumnTypeName(col, rsmd.getColumnTypeName(col));
0N/A }
0N/A
0N/A if( conn != null){
0N/A // JDBC 4.0 mandates as does the Java EE spec that all DataBaseMetaData methods
0N/A // must be implemented, therefore, the previous fix for 5055528 is being backed out
2741N/A dbmslocatorsUpdateCopy = conn.getMetaData().locatorsUpdateCopy();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Populates this <code>CachedRowSetImpl</code> object with data,
0N/A * using the given connection to produce the result set from
0N/A * which data will be read. A second form of this method,
0N/A * which takes no arguments, uses the values from this rowset's
0N/A * user, password, and either url or data source properties to
0N/A * create a new database connection. The form of <code>execute</code>
0N/A * that is given a connection ignores these properties.
0N/A *
0N/A * @param conn A standard JDBC <code>Connection</code> object that this
0N/A * <code>CachedRowSet</code> object can pass to a synchronization provider
0N/A * to establish a connection to the data source
0N/A * @throws SQLException if an invalid <code>Connection</code> is supplied
0N/A * or an error occurs in establishing the connection to the
0N/A * data source
0N/A * @see #populate
0N/A * @see java.sql.Connection
0N/A */
0N/A public void execute(Connection conn) throws SQLException {
0N/A // store the connection so the reader can find it.
0N/A setConnection(conn);
0N/A
0N/A if(getPageSize() != 0){
0N/A crsReader = (CachedRowSetReader)provider.getRowSetReader();
0N/A crsReader.setStartPosition(1);
0N/A callWithCon = true;
0N/A crsReader.readData((RowSetInternal)this);
0N/A }
0N/A
0N/A // Now call the current reader's readData method
0N/A else {
0N/A rowSetReader.readData((RowSetInternal)this);
0N/A }
0N/A RowSetMD = (RowSetMetaDataImpl)this.getMetaData();
0N/A
0N/A if(conn != null){
0N/A // JDBC 4.0 mandates as does the Java EE spec that all DataBaseMetaData methods
0N/A // must be implemented, therefore, the previous fix for 5055528 is being backed out
0N/A dbmslocatorsUpdateCopy = conn.getMetaData().locatorsUpdateCopy();
0N/A }
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Sets this <code>CachedRowSetImpl</code> object's connection property
0N/A * to the given <code>Connection</code> object. This method is called
0N/A * internally by the version of the method <code>execute</code> that takes a
0N/A * <code>Connection</code> object as an argument. The reader for this
0N/A * <code>CachedRowSetImpl</code> object can retrieve the connection stored
0N/A * in the rowset's connection property by calling its
0N/A * <code>getConnection</code> method.
0N/A *
0N/A * @param connection the <code>Connection</code> object that was passed in
0N/A * to the method <code>execute</code> and is to be stored
0N/A * in this <code>CachedRowSetImpl</code> object's connection
0N/A * property
0N/A */
0N/A private void setConnection (Connection connection) {
0N/A conn = connection;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Propagates all row update, insert, and delete changes to the
0N/A * underlying data source backing this <code>CachedRowSetImpl</code>
0N/A * object.
0N/A * <P>
0N/A * <b>Note</b>In the reference implementation an optimistic concurrency implementation
0N/A * is provided as a sample implementation of a the <code>SyncProvider</code>
0N/A * abstract class.
0N/A * <P>
0N/A * This method fails if any of the updates cannot be propagated back
0N/A * to the data source. When it fails, the caller can assume that
0N/A * none of the updates are reflected in the data source.
0N/A * When an exception is thrown, the current row
0N/A * is set to the first "updated" row that resulted in an exception
0N/A * unless the row that caused the exception is a "deleted" row.
0N/A * In that case, when deleted rows are not shown, which is usually true,
0N/A * the current row is not affected.
0N/A * <P>
0N/A * If no <code>SyncProvider</code> is configured, the reference implementation
0N/A * leverages the <code>RIOptimisticProvider</code> available which provides the
0N/A * default and reference synchronization capabilities for disconnected
0N/A * <code>RowSets</code>.
0N/A *
0N/A * @throws SQLException if the cursor is on the insert row or the underlying
0N/A * reference synchronization provider fails to commit the updates
0N/A * to the datasource
0N/A * @throws SyncProviderException if an internal error occurs within the
0N/A * <code>SyncProvider</code> instance during either during the
0N/A * process or at any time when the <code>SyncProvider</code>
0N/A * instance touches the data source.
0N/A * @see #acceptChanges(java.sql.Connection)
0N/A * @see javax.sql.RowSetWriter
0N/A * @see javax.sql.rowset.spi.SyncProvider
0N/A */
0N/A public void acceptChanges() throws SyncProviderException {
0N/A if (onInsertRow == true) {
0N/A throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.invalidop").toString());
0N/A }
0N/A
0N/A int saveCursorPos = cursorPos;
0N/A boolean success = false;
0N/A boolean conflict = false;
0N/A
0N/A try {
0N/A if (rowSetWriter != null) {
0N/A saveCursorPos = cursorPos;
0N/A conflict = rowSetWriter.writeData((RowSetInternal)this);
0N/A cursorPos = saveCursorPos;
0N/A }
0N/A
0N/A if ((tXWriter) && this.COMMIT_ON_ACCEPT_CHANGES) {
0N/A // do commit/rollback's here
0N/A if (!conflict) {
0N/A tWriter = (TransactionalWriter)rowSetWriter;
0N/A tWriter.rollback();
0N/A success = false;
0N/A } else {
0N/A tWriter = (TransactionalWriter)rowSetWriter;
2795N/A if (tWriter instanceof CachedRowSetWriter) {
2795N/A ((CachedRowSetWriter)tWriter).commit(this, updateOnInsert);
2795N/A } else {
2795N/A tWriter.commit();
2795N/A }
2795N/A
0N/A success = true;
0N/A }
0N/A }
0N/A
0N/A if (success == true) {
0N/A setOriginal();
0N/A } else if (!(success) && !(this.COMMIT_ON_ACCEPT_CHANGES)) {
0N/A throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.accfailed").toString());
0N/A }
0N/A
0N/A } catch (SyncProviderException spe) {
0N/A throw spe;
0N/A } catch (SQLException e) {
0N/A e.printStackTrace();
0N/A throw new SyncProviderException(e.getMessage());
0N/A } catch (SecurityException e) {
0N/A throw new SyncProviderException(e.getMessage());
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Propagates all row update, insert, and delete changes to the
0N/A * data source backing this <code>CachedRowSetImpl</code> object
0N/A * using the given <code>Connection</code> object.
0N/A * <P>
0N/A * The reference implementation <code>RIOptimisticProvider</code>
0N/A * modifies its synchronization to a write back function given
0N/A * the updated connection
0N/A * The reference implementation modifies its synchronization behaviour
0N/A * via the <code>SyncProvider</code> to ensure the synchronization
0N/A * occurs according to the updated JDBC <code>Connection</code>
0N/A * properties.
0N/A *
0N/A * @param con a standard JDBC <code>Connection</code> object
0N/A * @throws SQLException if the cursor is on the insert row or the underlying
0N/A * synchronization provider fails to commit the updates
0N/A * back to the data source
0N/A * @see #acceptChanges
0N/A * @see javax.sql.RowSetWriter
0N/A * @see javax.sql.rowset.spi.SyncFactory
0N/A * @see javax.sql.rowset.spi.SyncProvider
0N/A */
0N/A public void acceptChanges(Connection con) throws SyncProviderException{
0N/A
3999N/A setConnection(con);
3999N/A acceptChanges();
3999N/A
0N/A }
0N/A
0N/A /**
0N/A * Restores this <code>CachedRowSetImpl</code> object to its original state,
0N/A * that is, its state before the last set of changes.
0N/A * <P>
0N/A * Before returning, this method moves the cursor before the first row
0N/A * and sends a <code>rowSetChanged</code> event to all registered
0N/A * listeners.
0N/A * @throws SQLException if an error is occurs rolling back the RowSet
0N/A * state to the definied original value.
0N/A * @see javax.sql.RowSetListener#rowSetChanged
0N/A */
0N/A public void restoreOriginal() throws SQLException {
0N/A Row currentRow;
0N/A for (Iterator i = rvh.iterator(); i.hasNext();) {
0N/A currentRow = (Row)i.next();
0N/A if (currentRow.getInserted() == true) {
0N/A i.remove();
0N/A --numRows;
0N/A } else {
0N/A if (currentRow.getDeleted() == true) {
0N/A currentRow.clearDeleted();
0N/A }
0N/A if (currentRow.getUpdated() == true) {
0N/A currentRow.clearUpdated();
0N/A }
0N/A }
0N/A }
0N/A // move to before the first
0N/A cursorPos = 0;
0N/A
0N/A // notify any listeners
0N/A notifyRowSetChanged();
0N/A }
0N/A
0N/A /**
0N/A * Releases the current contents of this <code>CachedRowSetImpl</code>
0N/A * object and sends a <code>rowSetChanged</code> event object to all
0N/A * registered listeners.
0N/A *
0N/A * @throws SQLException if an error occurs flushing the contents of
0N/A * RowSet.
0N/A * @see javax.sql.RowSetListener#rowSetChanged
0N/A */
0N/A public void release() throws SQLException {
0N/A initContainer();
0N/A notifyRowSetChanged();
0N/A }
0N/A
0N/A /**
0N/A * Cancels deletion of the current row and notifies listeners that
0N/A * a row has changed.
0N/A * <P>
0N/A * Note: This method can be ignored if deleted rows are not being shown,
0N/A * which is the normal case.
0N/A *
0N/A * @throws SQLException if the cursor is not on a valid row
0N/A */
0N/A public void undoDelete() throws SQLException {
0N/A if (getShowDeleted() == false) {
0N/A return;
0N/A }
0N/A // make sure we are on a row
0N/A checkCursor();
0N/A
0N/A // don't want this to happen...
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A
0N/A Row currentRow = (Row)getCurrentRow();
0N/A if (currentRow.getDeleted() == true) {
0N/A currentRow.clearDeleted();
0N/A --numDeleted;
0N/A notifyRowChanged();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Immediately removes the current row from this
0N/A * <code>CachedRowSetImpl</code> object if the row has been inserted, and
0N/A * also notifies listeners the a row has changed. An exception is thrown
0N/A * if the row is not a row that has been inserted or the cursor is before
0N/A * the first row, after the last row, or on the insert row.
0N/A * <P>
0N/A * This operation cannot be undone.
0N/A *
0N/A * @throws SQLException if an error occurs,
0N/A * the cursor is not on a valid row,
0N/A * or the row has not been inserted
0N/A */
0N/A public void undoInsert() throws SQLException {
0N/A // make sure we are on a row
0N/A checkCursor();
0N/A
0N/A // don't want this to happen...
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A
0N/A Row currentRow = (Row)getCurrentRow();
0N/A if (currentRow.getInserted() == true) {
0N/A rvh.remove(cursorPos-1);
0N/A --numRows;
0N/A notifyRowChanged();
0N/A } else {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.illegalop").toString());
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Immediately reverses the last update operation if the
0N/A * row has been modified. This method can be
0N/A * called to reverse updates on a all columns until all updates in a row have
0N/A * been rolled back to their originating state since the last synchronization
0N/A * (<code>acceptChanges</code>) or population. This method may also be called
0N/A * while performing updates to the insert row.
0N/A * <P>
0N/A * <code>undoUpdate</code may be called at any time during the life-time of a
0N/A * rowset, however after a synchronization has occurs this method has no
0N/A * affect until further modification to the RowSet data occurs.
0N/A *
0N/A * @throws SQLException if cursor is before the first row, after the last
0N/A * row in rowset.
0N/A * @see #undoDelete
0N/A * @see #undoInsert
0N/A * @see java.sql.ResultSet#cancelRowUpdates
0N/A */
0N/A public void undoUpdate() throws SQLException {
0N/A // if on insert row, cancel the insert row
0N/A // make the insert row flag,
0N/A // cursorPos back to the current row
0N/A moveToCurrentRow();
0N/A
0N/A // else if not on insert row
0N/A // call undoUpdate or undoInsert
0N/A undoDelete();
0N/A
0N/A undoInsert();
0N/A
0N/A }
0N/A
0N/A //--------------------------------------------------------------------
0N/A // Views
0N/A //--------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Returns a new <code>RowSet</code> object backed by the same data as
0N/A * that of this <code>CachedRowSetImpl</code> object and sharing a set of cursors
0N/A * with it. This allows cursors to interate over a shared set of rows, providing
0N/A * multiple views of the underlying data.
0N/A *
0N/A * @return a <code>RowSet</code> object that is a copy of this <code>CachedRowSetImpl</code>
0N/A * object and shares a set of cursors with it
0N/A * @throws SQLException if an error occurs or cloning is
0N/A * not supported
0N/A * @see javax.sql.RowSetEvent
0N/A * @see javax.sql.RowSetListener
0N/A */
0N/A public RowSet createShared() throws SQLException {
0N/A RowSet clone;
0N/A try {
0N/A clone = (RowSet)clone();
0N/A } catch (CloneNotSupportedException ex) {
0N/A throw new SQLException(ex.getMessage());
0N/A }
0N/A return clone;
0N/A }
0N/A
0N/A /**
0N/A * Returns a new <code>RowSet</code> object containing by the same data
0N/A * as this <code>CachedRowSetImpl</code> object. This method
0N/A * differs from the method <code>createCopy</code> in that it throws a
0N/A * <code>CloneNotSupportedException</code> object instead of an
0N/A * <code>SQLException</code> object, as the method <code>createShared</code>
0N/A * does. This <code>clone</code>
0N/A * method is called internally by the method <code>createShared</code>,
0N/A * which catches the <code>CloneNotSupportedException</code> object
0N/A * and in turn throws a new <code>SQLException</code> object.
0N/A *
0N/A * @return a copy of this <code>CachedRowSetImpl</code> object
0N/A * @throws CloneNotSupportedException if an error occurs when
0N/A * attempting to clone this <code>CachedRowSetImpl</code> object
0N/A * @see #createShared
0N/A */
0N/A protected Object clone() throws CloneNotSupportedException {
0N/A return (super.clone());
0N/A }
0N/A
0N/A /**
0N/A * Creates a <code>RowSet</code> object that is a deep copy of
0N/A * this <code>CachedRowSetImpl</code> object's data, including
0N/A * constraints. Updates made
0N/A * on a copy are not visible to the original rowset;
0N/A * a copy of a rowset is completely independent from the original.
0N/A * <P>
0N/A * Making a copy saves the cost of creating an identical rowset
0N/A * from first principles, which can be quite expensive.
0N/A * For example, it can eliminate the need to query a
0N/A * remote database server.
0N/A * @return a new <code>CachedRowSet</code> object that is a deep copy
0N/A * of this <code>CachedRowSet</code> object and is
0N/A * completely independent from this <code>CachedRowSetImpl</code>
0N/A * object.
0N/A * @throws SQLException if an error occurs in generating the copy of this
0N/A * of the <code>CachedRowSetImpl</code>
0N/A * @see #createShared
0N/A * @see javax.sql.RowSetEvent
0N/A * @see javax.sql.RowSetListener
0N/A */
0N/A public CachedRowSet createCopy() throws SQLException {
0N/A ObjectOutputStream out;
0N/A ByteArrayOutputStream bOut = new ByteArrayOutputStream();
0N/A try {
0N/A out = new ObjectOutputStream(bOut);
0N/A out.writeObject(this);
0N/A } catch (IOException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.clonefail").toString() , ex.getMessage()));
0N/A }
0N/A
0N/A ObjectInputStream in;
0N/A
0N/A try {
0N/A ByteArrayInputStream bIn = new ByteArrayInputStream(bOut.toByteArray());
0N/A in = new ObjectInputStream(bIn);
0N/A } catch (StreamCorruptedException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.clonefail").toString() , ex.getMessage()));
0N/A } catch (IOException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.clonefail").toString() , ex.getMessage()));
0N/A }
0N/A
0N/A try {
0N/A //return ((CachedRowSet)(in.readObject()));
0N/A CachedRowSetImpl crsTemp = (CachedRowSetImpl)in.readObject();
0N/A crsTemp.resBundle = this.resBundle;
0N/A return ((CachedRowSet)crsTemp);
0N/A
0N/A } catch (ClassNotFoundException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.clonefail").toString() , ex.getMessage()));
0N/A } catch (OptionalDataException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.clonefail").toString() , ex.getMessage()));
0N/A } catch (IOException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.clonefail").toString() , ex.getMessage()));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Creates a <code>RowSet</code> object that is a copy of
0N/A * this <code>CachedRowSetImpl</code> object's table structure
0N/A * and the constraints only.
0N/A * There will be no data in the object being returned.
0N/A * Updates made on a copy are not visible to the original rowset.
0N/A * <P>
0N/A * This helps in getting the underlying XML schema which can
0N/A * be used as the basis for populating a <code>WebRowSet</code>.
0N/A *
0N/A * @return a new <code>CachedRowSet</code> object that is a copy
0N/A * of this <code>CachedRowSetImpl</code> object's schema and
0N/A * retains all the constraints on the original rowset but contains
0N/A * no data
0N/A * @throws SQLException if an error occurs in generating the copy
0N/A * of the <code>CachedRowSet</code> object
0N/A * @see #createShared
0N/A * @see #createCopy
0N/A * @see #createCopyNoConstraints
0N/A * @see javax.sql.RowSetEvent
0N/A * @see javax.sql.RowSetListener
0N/A */
0N/A public CachedRowSet createCopySchema() throws SQLException {
0N/A // Copy everything except data i.e all constraints
0N/A
0N/A // Store the number of rows of "this"
0N/A // and make numRows equals zero.
0N/A // and make data also zero.
0N/A int nRows = numRows;
0N/A numRows = 0;
0N/A
0N/A CachedRowSet crs = this.createCopy();
0N/A
0N/A // reset this object back to number of rows.
0N/A numRows = nRows;
0N/A
0N/A return crs;
0N/A }
0N/A
0N/A /**
0N/A * Creates a <code>CachedRowSet</code> object that is a copy of
0N/A * this <code>CachedRowSetImpl</code> object's data only.
0N/A * All constraints set in this object will not be there
0N/A * in the returning object. Updates made
0N/A * on a copy are not visible to the original rowset.
0N/A *
0N/A * @return a new <code>CachedRowSet</code> object that is a deep copy
0N/A * of this <code>CachedRowSetImpl</code> object and is
0N/A * completely independent from this <code>CachedRowSetImpl</code> object
0N/A * @throws SQLException if an error occurs in generating the copy of the
0N/A * of the <code>CachedRowSet</code>
0N/A * @see #createShared
0N/A * @see #createCopy
0N/A * @see #createCopySchema
0N/A * @see javax.sql.RowSetEvent
0N/A * @see javax.sql.RowSetListener
0N/A */
0N/A public CachedRowSet createCopyNoConstraints() throws SQLException {
0N/A // Copy the whole data ONLY without any constraints.
0N/A CachedRowSetImpl crs;
0N/A crs = (CachedRowSetImpl)this.createCopy();
0N/A
0N/A crs.initProperties();
0N/A try {
0N/A crs.unsetMatchColumn(crs.getMatchColumnIndexes());
0N/A } catch(SQLException sqle) {
0N/A //do nothing, if the setMatchColumn is not set.
0N/A }
0N/A
0N/A try {
0N/A crs.unsetMatchColumn(crs.getMatchColumnNames());
0N/A } catch(SQLException sqle) {
0N/A //do nothing, if the setMatchColumn is not set.
0N/A }
0N/A
0N/A return crs;
0N/A }
0N/A
0N/A /**
0N/A * Converts this <code>CachedRowSetImpl</code> object to a collection
0N/A * of tables. The sample implementation utilitizes the <code>TreeMap</code>
0N/A * collection type.
0N/A * This class guarantees that the map will be in ascending key order,
0N/A * sorted according to the natural order for the key's class.
0N/A *
0N/A * @return a <code>Collection</code> object consisting of tables,
0N/A * each of which is a copy of a row in this
0N/A * <code>CachedRowSetImpl</code> object
0N/A * @throws SQLException if an error occurs in generating the collection
0N/A * @see #toCollection(int)
0N/A * @see #toCollection(String)
0N/A * @see java.util.TreeMap
0N/A */
0N/A public Collection<?> toCollection() throws SQLException {
0N/A
3999N/A TreeMap<Integer, Object> tMap = new TreeMap<>();
0N/A
0N/A for (int i = 0; i<numRows; i++) {
2828N/A tMap.put(Integer.valueOf(i), rvh.get(i));
0N/A }
0N/A
0N/A return (tMap.values());
0N/A }
0N/A
0N/A /**
0N/A * Returns the specified column of this <code>CachedRowSetImpl</code> object
0N/A * as a <code>Collection</code> object. This method makes a copy of the
0N/A * column's data and utilitizes the <code>Vector</code> to establish the
0N/A * collection. The <code>Vector</code> class implements a growable array
0N/A * objects allowing the individual components to be accessed using an
0N/A * an integer index similar to that of an array.
0N/A *
0N/A * @return a <code>Collection</code> object that contains the value(s)
0N/A * stored in the specified column of this
0N/A * <code>CachedRowSetImpl</code>
0N/A * object
0N/A * @throws SQLException if an error occurs generated the collection; or
0N/A * an invalid column is provided.
0N/A * @see #toCollection()
0N/A * @see #toCollection(String)
0N/A * @see java.util.Vector
0N/A */
0N/A public Collection<?> toCollection(int column) throws SQLException {
0N/A
0N/A int nRows = numRows;
3999N/A Vector<Object> vec = new Vector<>(nRows);
0N/A
0N/A // create a copy
0N/A CachedRowSetImpl crsTemp;
0N/A crsTemp = (CachedRowSetImpl) this.createCopy();
0N/A
0N/A while(nRows!=0) {
0N/A crsTemp.next();
0N/A vec.add(crsTemp.getObject(column));
0N/A nRows--;
0N/A }
0N/A
0N/A return (Collection)vec;
0N/A }
0N/A
0N/A /**
0N/A * Returns the specified column of this <code>CachedRowSetImpl</code> object
0N/A * as a <code>Collection</code> object. This method makes a copy of the
0N/A * column's data and utilitizes the <code>Vector</code> to establish the
0N/A * collection. The <code>Vector</code> class implements a growable array
0N/A * objects allowing the individual components to be accessed using an
0N/A * an integer index similar to that of an array.
0N/A *
0N/A * @return a <code>Collection</code> object that contains the value(s)
0N/A * stored in the specified column of this
0N/A * <code>CachedRowSetImpl</code>
0N/A * object
0N/A * @throws SQLException if an error occurs generated the collection; or
0N/A * an invalid column is provided.
0N/A * @see #toCollection()
0N/A * @see #toCollection(int)
0N/A * @see java.util.Vector
0N/A */
0N/A public Collection<?> toCollection(String column) throws SQLException {
0N/A return toCollection(getColIdxByName(column));
0N/A }
0N/A
0N/A //--------------------------------------------------------------------
0N/A // Advanced features
0N/A //--------------------------------------------------------------------
0N/A
0N/A
0N/A /**
0N/A * Returns the <code>SyncProvider</code> implementation being used
0N/A * with this <code>CachedRowSetImpl</code> implementation rowset.
0N/A *
0N/A * @return the SyncProvider used by the rowset. If not provider was
0N/A * set when the rowset was instantiated, the reference
0N/A * implementation (default) provider is returned.
0N/A * @throws SQLException if error occurs while return the
0N/A * <code>SyncProvider</code> instance.
0N/A */
0N/A public SyncProvider getSyncProvider() throws SQLException {
0N/A return provider;
0N/A }
0N/A
0N/A /**
0N/A * Sets the active <code>SyncProvider</code> and attempts to load
0N/A * load the new provider using the <code>SyncFactory</code> SPI.
0N/A *
0N/A * @throws SQLException if an error occurs while resetting the
0N/A * <code>SyncProvider</code>.
0N/A */
0N/A public void setSyncProvider(String providerStr) throws SQLException {
0N/A provider =
0N/A (SyncProvider)SyncFactory.getInstance(providerStr);
0N/A
0N/A rowSetReader = provider.getRowSetReader();
0N/A rowSetWriter = provider.getRowSetWriter();
0N/A }
0N/A
0N/A
0N/A //-----------------
0N/A // methods inherited from RowSet
0N/A //-----------------
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A
0N/A //---------------------------------------------------------------------
0N/A // Reading and writing data
0N/A //---------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Populates this <code>CachedRowSetImpl</code> object with data.
0N/A * This form of the method uses the rowset's user, password, and url or
0N/A * data source name properties to create a database
0N/A * connection. If properties that are needed
0N/A * have not been set, this method will throw an exception.
0N/A * <P>
0N/A * Another form of this method uses an existing JDBC <code>Connection</code>
0N/A * object instead of creating a new one; therefore, it ignores the
0N/A * properties used for establishing a new connection.
0N/A * <P>
0N/A * The query specified by the command property is executed to create a
0N/A * <code>ResultSet</code> object from which to retrieve data.
0N/A * The current contents of the rowset are discarded, and the
0N/A * rowset's metadata is also (re)set. If there are outstanding updates,
0N/A * they are also ignored.
0N/A * <P>
0N/A * The method <code>execute</code> closes any database connections that it
0N/A * creates.
0N/A *
0N/A * @throws SQLException if an error occurs or the
0N/A * necessary properties have not been set
0N/A */
0N/A public void execute() throws SQLException {
0N/A execute(null);
0N/A }
0N/A
0N/A
0N/A
0N/A //-----------------------------------
0N/A // Methods inherited from ResultSet
0N/A //-----------------------------------
0N/A
0N/A /**
0N/A * Moves the cursor down one row from its current position and
0N/A * returns <code>true</code> if the new cursor position is a
0N/A * valid row.
0N/A * The cursor for a new <code>ResultSet</code> object is initially
0N/A * positioned before the first row. The first call to the method
0N/A * <code>next</code> moves the cursor to the first row, making it
0N/A * the current row; the second call makes the second row the
0N/A * current row, and so on.
0N/A *
0N/A * <P>If an input stream from the previous row is open, it is
0N/A * implicitly closed. The <code>ResultSet</code> object's warning
0N/A * chain is cleared when a new row is read.
0N/A *
0N/A * @return <code>true</code> if the new current row is valid;
0N/A * <code>false</code> if there are no more rows
0N/A * @throws SQLException if an error occurs or
0N/A * the cursor is not positioned in the rowset, before
0N/A * the first row, or after the last row
0N/A */
0N/A public boolean next() throws SQLException {
0N/A /*
0N/A * make sure things look sane. The cursor must be
0N/A * positioned in the rowset or before first (0) or
0N/A * after last (numRows + 1)
0N/A */
0N/A if (cursorPos < 0 || cursorPos >= numRows + 1) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A // now move and notify
0N/A boolean ret = this.internalNext();
0N/A notifyCursorMoved();
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the next
0N/A * row and returns <code>true</code> if the cursor is still in the rowset;
0N/A * returns <code>false</code> if the cursor has moved to the position after
0N/A * the last row.
0N/A * <P>
0N/A * This method handles the cases where the cursor moves to a row that
0N/A * has been deleted.
0N/A * If this rowset shows deleted rows and the cursor moves to a row
0N/A * that has been deleted, this method moves the cursor to the next
0N/A * row until the cursor is on a row that has not been deleted.
0N/A * <P>
0N/A * The method <code>internalNext</code> is called by methods such as
0N/A * <code>next</code>, <code>absolute</code>, and <code>relative</code>,
0N/A * and, as its name implies, is only called internally.
0N/A * <p>
0N/A * This is a implementation only method and is not required as a standard
0N/A * implementation of the <code>CachedRowSet</code> interface.
0N/A *
0N/A * @return <code>true</code> if the cursor is on a valid row in this
0N/A * rowset; <code>false</code> if it is after the last row
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A protected boolean internalNext() throws SQLException {
0N/A boolean ret = false;
0N/A
0N/A do {
0N/A if (cursorPos < numRows) {
0N/A ++cursorPos;
0N/A ret = true;
0N/A } else if (cursorPos == numRows) {
0N/A // increment to after last
0N/A ++cursorPos;
0N/A ret = false;
0N/A break;
0N/A }
0N/A } while ((getShowDeleted() == false) && (rowDeleted() == true));
0N/A
0N/A /* each call to internalNext may increment cursorPos multiple
0N/A * times however, the absolutePos only increments once per call.
0N/A */
0N/A if (ret == true)
0N/A absolutePos++;
0N/A else
0N/A absolutePos = 0;
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Closes this <code>CachedRowSetImpl</code> objecy and releases any resources
0N/A * it was using.
0N/A *
0N/A * @throws SQLException if an error occurs when releasing any resources in use
0N/A * by this <code>CachedRowSetImpl</code> object
0N/A */
0N/A public void close() throws SQLException {
0N/A
0N/A // close all data structures holding
0N/A // the disconnected rowset
0N/A
0N/A cursorPos = 0;
0N/A absolutePos = 0;
0N/A numRows = 0;
0N/A numDeleted = 0;
0N/A
0N/A // set all insert(s), update(s) & delete(s),
0N/A // if at all, to their initial values.
0N/A initProperties();
0N/A
0N/A // clear the vector of it's present contents
0N/A rvh.clear();
0N/A
0N/A // this will make it eligible for gc
0N/A // rvh = null;
0N/A }
0N/A
0N/A /**
0N/A * Reports whether the last column read was SQL <code>NULL</code>.
0N/A * Note that you must first call the method <code>getXXX</code>
0N/A * on a column to try to read its value and then call the method
0N/A * <code>wasNull</code> to determine whether the value was
0N/A * SQL <code>NULL</code>.
0N/A *
0N/A * @return <code>true</code> if the value in the last column read
0N/A * was SQL <code>NULL</code>; <code>false</code> otherwise
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public boolean wasNull() throws SQLException {
0N/A return lastValueNull;
0N/A }
0N/A
0N/A /**
0N/A * Sets the field <code>lastValueNull</code> to the given
0N/A * <code>boolean</code> value.
0N/A *
0N/A * @param value <code>true</code> to indicate that the value of
0N/A * the last column read was SQL <code>NULL</code>;
0N/A * <code>false</code> to indicate that it was not
0N/A */
0N/A private void setLastValueNull(boolean value) {
0N/A lastValueNull = value;
0N/A }
0N/A
0N/A // Methods for accessing results by column index
0N/A
0N/A /**
0N/A * Checks to see whether the given index is a valid column number
0N/A * in this <code>CachedRowSetImpl</code> object and throws
0N/A * an <code>SQLException</code> if it is not. The index is out of bounds
0N/A * if it is less than <code>1</code> or greater than the number of
0N/A * columns in this rowset.
0N/A * <P>
0N/A * This method is called internally by the <code>getXXX</code> and
0N/A * <code>updateXXX</code> methods.
0N/A *
0N/A * @param idx the number of a column in this <code>CachedRowSetImpl</code>
0N/A * object; must be between <code>1</code> and the number of
0N/A * rows in this rowset
0N/A * @throws SQLException if the given index is out of bounds
0N/A */
0N/A private void checkIndex(int idx) throws SQLException {
0N/A if (idx < 1 || idx > RowSetMD.getColumnCount()) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcol").toString());
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Checks to see whether the cursor for this <code>CachedRowSetImpl</code>
0N/A * object is on a row in the rowset and throws an
0N/A * <code>SQLException</code> if it is not.
0N/A * <P>
0N/A * This method is called internally by <code>getXXX</code> methods, by
0N/A * <code>updateXXX</code> methods, and by methods that update, insert,
0N/A * or delete a row or that cancel a row update, insert, or delete.
0N/A *
0N/A * @throws SQLException if the cursor for this <code>CachedRowSetImpl</code>
0N/A * object is not on a valid row
0N/A */
0N/A private void checkCursor() throws SQLException {
0N/A if (isAfterLast() == true || isBeforeFirst() == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Returns the column number of the column with the given name in this
0N/A * <code>CachedRowSetImpl</code> object. This method throws an
0N/A * <code>SQLException</code> if the given name is not the name of
0N/A * one of the columns in this rowset.
0N/A *
0N/A * @param name a <code>String</code> object that is the name of a column in
0N/A * this <code>CachedRowSetImpl</code> object
0N/A * @throws SQLException if the given name does not match the name of one of
0N/A * the columns in this rowset
0N/A */
0N/A private int getColIdxByName(String name) throws SQLException {
0N/A RowSetMD = (RowSetMetaDataImpl)this.getMetaData();
0N/A int cols = RowSetMD.getColumnCount();
0N/A
0N/A for (int i=1; i <= cols; ++i) {
0N/A String colName = RowSetMD.getColumnName(i);
0N/A if (colName != null)
0N/A if (name.equalsIgnoreCase(colName))
0N/A return (i);
0N/A else
0N/A continue;
0N/A }
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalcolnm").toString());
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Returns the insert row or the current row of this
0N/A * <code>CachedRowSetImpl</code>object.
0N/A *
0N/A * @return the <code>Row</code> object on which this <code>CachedRowSetImpl</code>
0N/A * objects's cursor is positioned
0N/A */
0N/A protected BaseRow getCurrentRow() {
0N/A if (onInsertRow == true) {
0N/A return (BaseRow)insertRow;
0N/A } else {
0N/A return (BaseRow)(rvh.get(cursorPos - 1));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Removes the row on which the cursor is positioned.
0N/A * <p>
0N/A * This is a implementation only method and is not required as a standard
0N/A * implementation of the <code>CachedRowSet</code> interface.
0N/A *
0N/A * @throws SQLException if the cursor is positioned on the insert
0N/A * row
0N/A */
0N/A protected void removeCurrentRow() {
0N/A ((Row)getCurrentRow()).setDeleted();
4140N/A rvh.remove(cursorPos - 1);
0N/A --numRows;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>String</code> object.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>null</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, INTEGER, BIGINT, REAL,
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, <b>CHAR</b>, <b>VARCHAR</b></code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A */
0N/A public String getString(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A return value.toString();
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>boolean</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value as a <code>boolean</code> in the Java progamming language;
0N/A * if the value is SQL <code>NULL</code>, the result is <code>false</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>BOOLEAN</code> value
0N/A * @see #getBoolean(String)
0N/A */
0N/A public boolean getBoolean(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return false;
0N/A }
0N/A
0N/A // check for Boolean...
0N/A if (value instanceof Boolean) {
0N/A return ((Boolean)value).booleanValue();
0N/A }
0N/A
0N/A // convert to a Double and compare to zero
0N/A try {
0N/A Double d = new Double(value.toString());
0N/A if (d.compareTo(new Double((double)0)) == 0) {
0N/A return false;
0N/A } else {
0N/A return true;
0N/A }
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.boolfail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>byte</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value as a <code>byte</code> in the Java programming
0N/A * language; if the value is SQL <code>NULL</code>, the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code><b>TINYINT</b>, SMALLINT, INTEGER, BIGINT, REAL,
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return type.
0N/A * @see #getByte(String)
0N/A */
0N/A public byte getByte(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (byte)0;
0N/A }
0N/A try {
2828N/A return ((Byte.valueOf(value.toString())).byteValue());
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.bytefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>short</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>0</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, <b>SMALLINT</b>, INTEGER, BIGINT, REAL
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A * @see #getShort(String)
0N/A */
0N/A public short getShort(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (short)0;
0N/A }
0N/A
0N/A try {
2828N/A return ((Short.valueOf(value.toString().trim())).shortValue());
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.shortfail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as an
0N/A * <code>int</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>0</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, <b>INTEGER</b>, BIGINT, REAL
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A */
0N/A public int getInt(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (int)0;
0N/A }
0N/A
0N/A try {
2828N/A return ((Integer.valueOf(value.toString().trim())).intValue());
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.intfail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>long</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>0</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, INTEGER, <b>BIGINT</b>, REAL
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A * @see #getLong(String)
0N/A */
0N/A public long getLong(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (long)0;
0N/A }
0N/A try {
2828N/A return ((Long.valueOf(value.toString().trim())).longValue());
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.longfail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>float</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>0</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, INTEGER, BIGINT, <b>REAL</b>,
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A * @see #getFloat(String)
0N/A */
0N/A public float getFloat(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (float)0;
0N/A }
0N/A try {
0N/A return ((new Float(value.toString())).floatValue());
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.floatfail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>double</code> value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>0</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, INTEGER, BIGINT, REAL,
0N/A * <b>FLOAT</b>, <b>DOUBLE</b>, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A * @see #getDouble(String)
0N/A *
0N/A */
0N/A public double getDouble(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (double)0;
0N/A }
0N/A try {
0N/A return ((new Double(value.toString().trim())).doubleValue());
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.doublefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.math.BigDecimal</code> object.
0N/A * <P>
0N/A * This method is deprecated; use the version of <code>getBigDecimal</code>
0N/A * that does not take a scale parameter and returns a value with full
0N/A * precision.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @param scale the number of digits to the right of the decimal point in the
0N/A * value returned
0N/A * @return the column value with the specified number of digits to the right
0N/A * of the decimal point; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>null</code>
0N/A * @throws SQLException if the given column index is out of bounds,
0N/A * the cursor is not on a valid row, or this method fails
0N/A * @deprecated
0N/A */
0N/A public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
0N/A Object value;
0N/A BigDecimal bDecimal, retVal;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return (new BigDecimal(0));
0N/A }
0N/A
0N/A bDecimal = this.getBigDecimal(columnIndex);
0N/A
0N/A retVal = bDecimal.setScale(scale);
0N/A
0N/A return retVal;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>byte</code> array value.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value as a <code>byte</code> array in the Java programming
0N/A * language; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>null</code>
0N/A *
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code><b>BINARY</b>, <b>VARBINARY</b> or
0N/A * LONGVARBINARY</code> value.
0N/A * The bold SQL type designates the recommended return type.
0N/A * @see #getBytes(String)
0N/A */
0N/A public byte[] getBytes(int columnIndex) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isBinary(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A return (byte[])(getCurrentRow().getColumnObject(columnIndex));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.sql.Date</code> object.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value as a <code>java.sql.Data</code> object; if
0N/A * the value is SQL <code>NULL</code>, the
0N/A * result is <code>null</code>
0N/A * @throws SQLException if the given column index is out of bounds,
0N/A * the cursor is not on a valid row, or this method fails
0N/A */
0N/A public java.sql.Date getDate(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A /*
0N/A * The object coming back from the db could be
0N/A * a date, a timestamp, or a char field variety.
0N/A * If it's a date type return it, a timestamp
0N/A * we turn into a long and then into a date,
0N/A * char strings we try to parse. Yuck.
0N/A */
0N/A switch (RowSetMD.getColumnType(columnIndex)) {
0N/A case java.sql.Types.DATE: {
0N/A long sec = ((java.sql.Date)value).getTime();
0N/A return new java.sql.Date(sec);
0N/A }
0N/A case java.sql.Types.TIMESTAMP: {
0N/A long sec = ((java.sql.Timestamp)value).getTime();
0N/A return new java.sql.Date(sec);
0N/A }
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR: {
0N/A try {
0N/A DateFormat df = DateFormat.getDateInstance();
0N/A return ((java.sql.Date)(df.parse(value.toString())));
0N/A } catch (ParseException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.datefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A default: {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.datefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.sql.Time</code> object.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>null</code>
0N/A * @throws SQLException if the given column index is out of bounds,
0N/A * the cursor is not on a valid row, or this method fails
0N/A */
0N/A public java.sql.Time getTime(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A /*
0N/A * The object coming back from the db could be
0N/A * a date, a timestamp, or a char field variety.
0N/A * If it's a date type return it, a timestamp
0N/A * we turn into a long and then into a date,
0N/A * char strings we try to parse. Yuck.
0N/A */
0N/A switch (RowSetMD.getColumnType(columnIndex)) {
0N/A case java.sql.Types.TIME: {
0N/A return (java.sql.Time)value;
0N/A }
0N/A case java.sql.Types.TIMESTAMP: {
0N/A long sec = ((java.sql.Timestamp)value).getTime();
0N/A return new java.sql.Time(sec);
0N/A }
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR: {
0N/A try {
0N/A DateFormat tf = DateFormat.getTimeInstance();
0N/A return ((java.sql.Time)(tf.parse(value.toString())));
0N/A } catch (ParseException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.timefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A default: {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.timefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.sql.Timestamp</code> object.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * result is <code>null</code>
0N/A * @throws SQLException if the given column index is out of bounds,
0N/A * the cursor is not on a valid row, or this method fails
0N/A */
0N/A public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A /*
0N/A * The object coming back from the db could be
0N/A * a date, a timestamp, or a char field variety.
0N/A * If it's a date type return it; a timestamp
0N/A * we turn into a long and then into a date;
0N/A * char strings we try to parse. Yuck.
0N/A */
0N/A switch (RowSetMD.getColumnType(columnIndex)) {
0N/A case java.sql.Types.TIMESTAMP: {
0N/A return (java.sql.Timestamp)value;
0N/A }
0N/A case java.sql.Types.TIME: {
0N/A long sec = ((java.sql.Time)value).getTime();
0N/A return new java.sql.Timestamp(sec);
0N/A }
0N/A case java.sql.Types.DATE: {
0N/A long sec = ((java.sql.Date)value).getTime();
0N/A return new java.sql.Timestamp(sec);
0N/A }
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR: {
0N/A try {
0N/A DateFormat tf = DateFormat.getTimeInstance();
0N/A return ((java.sql.Timestamp)(tf.parse(value.toString())));
0N/A } catch (ParseException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.timefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A default: {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.timefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row of this
0N/A * <code>CachedRowSetImpl</code> object as a <code>java.io.InputStream</code>
0N/A * object.
0N/A *
0N/A * A column value can be retrieved as a stream of ASCII characters
0N/A * and then read in chunks from the stream. This method is particularly
0N/A * suitable for retrieving large <code>LONGVARCHAR</code> values. The JDBC
0N/A * driver will do any necessary conversion from the database format into ASCII.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must be
0N/A * read prior to getting the value of any other column. The next
0N/A * call to a get method implicitly closes the stream. . Also, a
0N/A * stream may return <code>0</code> for <code>CachedRowSetImpl.available()</code>
0N/A * whether there is data available or not.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of one-byte ASCII characters. If the value is SQL
0N/A * <code>NULL</code>, the result is <code>null</code>.
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>CHAR, VARCHAR</code>, <code><b>LONGVARCHAR</b></code>
0N/A * <code>BINARY, VARBINARY</code> or <code>LONGVARBINARY</code> value. The
0N/A * bold SQL type designates the recommended return types that this method is
0N/A * used to retrieve.
0N/A * @see #getAsciiStream(String)
0N/A */
0N/A public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // always free an old stream
0N/A asciiStream = null;
0N/A
0N/A // sanity check
0N/A checkIndex(columnIndex);
0N/A //make sure the cursor is on a vlid row
0N/A checkCursor();
0N/A
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A if (value == null) {
0N/A lastValueNull = true;
0N/A return null;
0N/A }
0N/A
0N/A try {
0N/A if (isString(RowSetMD.getColumnType(columnIndex))) {
0N/A asciiStream = new ByteArrayInputStream(((String)value).getBytes("ASCII"));
0N/A } else {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A } catch (java.io.UnsupportedEncodingException ex) {
0N/A throw new SQLException(ex.getMessage());
0N/A }
0N/A
0N/A return (java.io.InputStream)asciiStream;
0N/A }
0N/A
0N/A /**
0N/A * A column value can be retrieved as a stream of Unicode characters
0N/A * and then read in chunks from the stream. This method is particularly
0N/A * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
0N/A * do any necessary conversion from the database format into Unicode.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must be
0N/A * read prior to getting the value of any other column. The next
0N/A * call to a get method implicitly closes the stream. . Also, a
0N/A * stream may return 0 for available() whether there is data
0N/A * available or not.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of two byte Unicode characters. If the value is SQL NULL
0N/A * then the result is null.
0N/A * @throws SQLException if an error occurs
0N/A * @deprecated
0N/A */
0N/A public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
0N/A // always free an old stream
0N/A unicodeStream = null;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isBinary(RowSetMD.getColumnType(columnIndex)) == false &&
0N/A isString(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A Object value = getCurrentRow().getColumnObject(columnIndex);
0N/A if (value == null) {
0N/A lastValueNull = true;
0N/A return null;
0N/A }
0N/A
0N/A unicodeStream = new StringBufferInputStream(value.toString());
0N/A
0N/A return (java.io.InputStream)unicodeStream;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row of this
0N/A * <code>CachedRowSetImpl</code> object as a <code>java.io.InputStream</code>
0N/A * object.
0N/A * <P>
0N/A * A column value can be retrieved as a stream of uninterpreted bytes
0N/A * and then read in chunks from the stream. This method is particularly
0N/A * suitable for retrieving large <code>LONGVARBINARY</code> values.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must be
0N/A * read prior to getting the value of any other column. The next
0N/A * call to a get method implicitly closes the stream. Also, a
0N/A * stream may return <code>0</code> for
0N/A * <code>CachedRowSetImpl.available()</code> whether there is data
0N/A * available or not.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of uninterpreted bytes. If the value is SQL <code>NULL</code>
0N/A * then the result is <code>null</code>.
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>BINARY, VARBINARY</code> or <code><b>LONGVARBINARY</b></code>
0N/A * The bold type indicates the SQL type that this method is recommened
0N/A * to retrieve.
0N/A * @see #getBinaryStream(String)
0N/A */
0N/A public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException {
0N/A
0N/A // always free an old stream
0N/A binaryStream = null;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isBinary(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A Object value = getCurrentRow().getColumnObject(columnIndex);
0N/A if (value == null) {
0N/A lastValueNull = true;
0N/A return null;
0N/A }
0N/A
0N/A binaryStream = new ByteArrayInputStream((byte[])value);
0N/A
0N/A return (java.io.InputStream)binaryStream;
0N/A
0N/A }
0N/A
0N/A
0N/A // Methods for accessing results by column name
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>String</code> object.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
0N/A * BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, <b>CHAR</b>,
0N/A * <b>VARCHAR</b></code> or <code>LONGVARCHAR<</code> value. The bold SQL type
0N/A * designates the recommended return type.
0N/A */
0N/A public String getString(String columnName) throws SQLException {
0N/A return getString(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>boolean</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value as a <code>boolean</code> in the Java programming
0N/A * language; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>false</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>BOOLEAN</code> value
0N/A * @see #getBoolean(int)
0N/A */
0N/A public boolean getBoolean(String columnName) throws SQLException {
0N/A return getBoolean(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>byte</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value as a <code>byte</code> in the Java programming
0N/A * language; if the value is SQL <code>NULL</code>, the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code><B>TINYINT</B>, SMALLINT, INTEGER,
0N/A * BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The
0N/A * bold type designates the recommended return type
0N/A */
0N/A public byte getByte(String columnName) throws SQLException {
0N/A return getByte(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>short</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, <b>SMALLINT</b>, INTEGER
0N/A * BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return type.
0N/A * @see #getShort(int)
0N/A */
0N/A public short getShort(String columnName) throws SQLException {
0N/A return getShort(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as an <code>int</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column name is not the name
0N/A * of a column in this rowset,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, <b>INTEGER</b>, BIGINT, REAL
0N/A * FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return type.
0N/A */
0N/A public int getInt(String columnName) throws SQLException {
0N/A return getInt(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>long</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
0N/A * <b>BIGINT</b>, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return type.
0N/A * @see #getLong(int)
0N/A */
0N/A public long getLong(String columnName) throws SQLException {
0N/A return getLong(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>float</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
0N/A * BIGINT, <b>REAL</b>, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return type.
0N/A * @see #getFloat(String)
0N/A */
0N/A public float getFloat(String columnName) throws SQLException {
0N/A return getFloat(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row of this <code>CachedRowSetImpl</code> object
0N/A * as a <code>double</code> value.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>0</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
0N/A * BIGINT, REAL, <b>FLOAT</b>, <b>DOUBLE</b>, DECIMAL, NUMERIC, BIT, CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return types.
0N/A * @see #getDouble(int)
0N/A */
0N/A public double getDouble(String columnName) throws SQLException {
0N/A return getDouble(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>java.math.BigDecimal</code> object.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @param scale the number of digits to the right of the decimal point
0N/A * @return a java.math.BugDecimal object with <code><i>scale</i></code>
0N/A * number of digits to the right of the decimal point.
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
0N/A * BIGINT, REAL, FLOAT, DOUBLE, <b>DECIMAL</b>, <b>NUMERIC</b>, BIT CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return type that this method is used to
0N/A * retrieve.
0N/A * @deprecated Use the <code>getBigDecimal(String columnName)</code>
0N/A * method instead
0N/A */
0N/A public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
0N/A return getBigDecimal(getColIdxByName(columnName), scale);
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>byte</code> array.
0N/A * The bytes represent the raw values returned by the driver.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value as a <code>byte</code> array in the Java programming
0N/A * language; if the value is SQL <code>NULL</code>, the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code><b>BINARY</b>, <b>VARBINARY</b>
0N/A * </code> or <code>LONGVARBINARY</code> values
0N/A * The bold SQL type designates the recommended return type.
0N/A * @see #getBytes(int)
0N/A */
0N/A public byte[] getBytes(String columnName) throws SQLException {
0N/A return getBytes(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>java.sql.Date</code> object.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>DATE</code> or
0N/A * <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Date getDate(String columnName) throws SQLException {
0N/A return getDate(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>java.sql.Time</code> object.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if the given column name does not match one of
0N/A * this rowset's column names or the cursor is not on one of
0N/A * this rowset's rows or its insert row
0N/A */
0N/A public java.sql.Time getTime(String columnName) throws SQLException {
0N/A return getTime(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>java.sql.Timestamp</code> object.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if the given column name does not match one of
0N/A * this rowset's column names or the cursor is not on one of
0N/A * this rowset's rows or its insert row
0N/A */
0N/A public java.sql.Timestamp getTimestamp(String columnName) throws SQLException {
0N/A return getTimestamp(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row of this
0N/A * <code>CachedRowSetImpl</code> object as a <code>java.io.InputStream</code>
0N/A * object.
0N/A *
0N/A * A column value can be retrieved as a stream of ASCII characters
0N/A * and then read in chunks from the stream. This method is particularly
0N/A * suitable for retrieving large <code>LONGVARCHAR</code> values. The
0N/A * <code>SyncProvider</code> will rely on the JDBC driver to do any necessary
0N/A * conversion from the database format into ASCII format.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must
0N/A * be read prior to getting the value of any other column. The
0N/A * next call to a <code>getXXX</code> method implicitly closes the stream.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of one-byte ASCII characters. If the value is SQL
0N/A * <code>NULL</code>, the result is <code>null</code>.
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>CHAR, VARCHAR</code>, <code><b>LONGVARCHAR</b></code>
0N/A * <code>BINARY, VARBINARY</code> or <code>LONGVARBINARY</code> value. The
0N/A * bold SQL type designates the recommended return types that this method is
0N/A * used to retrieve.
0N/A * @see #getAsciiStream(int)
0N/A */
0N/A public java.io.InputStream getAsciiStream(String columnName) throws SQLException {
0N/A return getAsciiStream(getColIdxByName(columnName));
0N/A
0N/A }
0N/A
0N/A /**
0N/A * A column value can be retrieved as a stream of Unicode characters
0N/A * and then read in chunks from the stream. This method is particularly
0N/A * suitable for retrieving large <code>LONGVARCHAR</code> values.
0N/A * The JDBC driver will do any necessary conversion from the database
0N/A * format into Unicode.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must
0N/A * be read prior to getting the value of any other column. The
0N/A * next call to a <code>getXXX</code> method implicitly closes the stream.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of two-byte Unicode characters. If the value is
0N/A * SQL <code>NULL</code>, the result is <code>null</code>.
0N/A * @throws SQLException if the given column name does not match one of
0N/A * this rowset's column names or the cursor is not on one of
0N/A * this rowset's rows or its insert row
0N/A * @deprecated use the method <code>getCharacterStream</code> instead
0N/A */
0N/A public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
0N/A return getUnicodeStream(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row of this
0N/A * <code>CachedRowSetImpl</code> object as a <code>java.io.InputStream</code>
0N/A * object.
0N/A * <P>
0N/A * A column value can be retrieved as a stream of uninterpreted bytes
0N/A * and then read in chunks from the stream. This method is particularly
0N/A * suitable for retrieving large <code>LONGVARBINARY</code> values.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must be
0N/A * read prior to getting the value of any other column. The next
0N/A * call to a get method implicitly closes the stream. Also, a
0N/A * stream may return <code>0</code> for <code>CachedRowSetImpl.available()</code>
0N/A * whether there is data available or not.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of uninterpreted bytes. If the value is SQL
0N/A * <code>NULL</code>, the result is <code>null</code>.
0N/A * @throws SQLException if (1) the given column name is unknown,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>BINARY, VARBINARY</code> or <code><b>LONGVARBINARY</b></code>
0N/A * The bold type indicates the SQL type that this method is recommened
0N/A * to retrieve.
0N/A * @see #getBinaryStream(int)
0N/A *
0N/A */
0N/A public java.io.InputStream getBinaryStream(String columnName) throws SQLException {
0N/A return getBinaryStream(getColIdxByName(columnName));
0N/A }
0N/A
0N/A
0N/A // Advanced features:
0N/A
0N/A /**
0N/A * The first warning reported by calls on this <code>CachedRowSetImpl</code>
0N/A * object is returned. Subsequent <code>CachedRowSetImpl</code> warnings will
0N/A * be chained to this <code>SQLWarning</code>.
0N/A *
0N/A * <P>The warning chain is automatically cleared each time a new
0N/A * row is read.
0N/A *
0N/A * <P><B>Note:</B> This warning chain only covers warnings caused
0N/A * by <code>ResultSet</code> methods. Any warning caused by statement
0N/A * methods (such as reading OUT parameters) will be chained on the
0N/A * <code>Statement</code> object.
0N/A *
0N/A * @return the first SQLWarning or null
0N/A */
0N/A public SQLWarning getWarnings() {
0N/A return sqlwarn;
0N/A }
0N/A
0N/A /**
0N/A * Clears all the warnings reporeted for the <code>CachedRowSetImpl</code>
0N/A * object. After a call to this method, the <code>getWarnings</code> method
0N/A * returns <code>null</code> until a new warning is reported for this
0N/A * <code>CachedRowSetImpl</code> object.
0N/A */
0N/A public void clearWarnings() {
0N/A sqlwarn = null;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the name of the SQL cursor used by this
0N/A * <code>CachedRowSetImpl</code> object.
0N/A *
0N/A * <P>In SQL, a result table is retrieved through a cursor that is
0N/A * named. The current row of a <code>ResultSet</code> can be updated or deleted
0N/A * using a positioned update/delete statement that references the
0N/A * cursor name. To ensure that the cursor has the proper isolation
0N/A * level to support an update operation, the cursor's <code>SELECT</code>
0N/A * statement should be of the form <code>select for update</code>.
0N/A * If the <code>for update</code> clause
0N/A * is omitted, positioned updates may fail.
0N/A *
0N/A * <P>JDBC supports this SQL feature by providing the name of the
0N/A * SQL cursor used by a <code>ResultSet</code> object. The current row
0N/A * of a result set is also the current row of this SQL cursor.
0N/A *
0N/A * <P><B>Note:</B> If positioned updates are not supported, an
0N/A * <code>SQLException</code> is thrown.
0N/A *
0N/A * @return the SQL cursor name for this <code>CachedRowSetImpl</code> object's
0N/A * cursor
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public String getCursorName() throws SQLException {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.posupdate").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves a <code>ResultSetMetaData</code> object instance that
0N/A * contains information about the <code>CachedRowSet</code> object.
0N/A * However, applications should cast the returned object to a
0N/A * <code>RowSetMetaData</code> interface implementation. In the
0N/A * reference implementation, this cast can be done on the
0N/A * <code>RowSetMetaDataImpl</code> class.
0N/A * <P>
0N/A * For example:
0N/A * <pre>
0N/A * CachedRowSet crs = new CachedRowSetImpl();
0N/A * RowSetMetaDataImpl metaData =
0N/A * (RowSetMetaDataImpl)crs.getMetaData();
0N/A * // Set the number of columns in the RowSet object for
0N/A * // which this RowSetMetaDataImpl object was created to the
0N/A * // given number.
0N/A * metaData.setColumnCount(3);
0N/A * crs.setMetaData(metaData);
0N/A * </pre>
0N/A *
0N/A * @return the <code>ResultSetMetaData</code> object that describes this
0N/A * <code>CachedRowSetImpl</code> object's columns
0N/A * @throws SQLException if an error occurs in generating the RowSet
0N/A * meta data; or if the <code>CachedRowSetImpl</code> is empty.
0N/A * @see javax.sql.RowSetMetaData
0N/A */
0N/A public ResultSetMetaData getMetaData() throws SQLException {
0N/A return (ResultSetMetaData)RowSetMD;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as an
0N/A * <code>Object</code> value.
0N/A * <P>
0N/A * The type of the <code>Object</code> will be the default
0N/A * Java object type corresponding to the column's SQL type,
0N/A * following the mapping for built-in types specified in the JDBC 3.0
0N/A * specification.
0N/A * <P>
0N/A * This method may also be used to read datatabase-specific
0N/A * abstract data types.
0N/A * <P>
0N/A * This implementation of the method <code>getObject</code> extends its
0N/A * behavior so that it gets the attributes of an SQL structured type
0N/A * as an array of <code>Object</code> values. This method also custom
0N/A * maps SQL user-defined types to classes in the Java programming language.
0N/A * When the specified column contains
0N/A * a structured or distinct value, the behavior of this method is as
0N/A * if it were a call to the method <code>getObject(columnIndex,
0N/A * this.getStatement().getConnection().getTypeMap())</code>.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return a <code>java.lang.Object</code> holding the column value;
0N/A * if the value is SQL <code>NULL</code>, the result is <code>null</code>
0N/A * @throws SQLException if the given column index is out of bounds,
0N/A * the cursor is not on a valid row, or there is a problem getting
0N/A * the <code>Class</code> object for a custom mapping
0N/A * @see #getObject(String)
0N/A */
0N/A public Object getObject(int columnIndex) throws SQLException {
0N/A Object value;
3999N/A Map<String, Class<?>> map;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A if (value instanceof Struct) {
0N/A Struct s = (Struct)value;
0N/A map = getTypeMap();
0N/A // look up the class in the map
0N/A Class c = (Class)map.get(s.getSQLTypeName());
0N/A if (c != null) {
0N/A // create new instance of the class
0N/A SQLData obj = null;
0N/A try {
0N/A obj = (SQLData)c.newInstance();
0N/A } catch (java.lang.InstantiationException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(),
0N/A ex.getMessage()));
0N/A } catch (java.lang.IllegalAccessException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(),
0N/A ex.getMessage()));
0N/A }
0N/A // get the attributes from the struct
0N/A Object attribs[] = s.getAttributes(map);
0N/A // create the SQLInput "stream"
0N/A SQLInputImpl sqlInput = new SQLInputImpl(attribs, map);
0N/A // read the values...
0N/A obj.readSQL(sqlInput, s.getSQLTypeName());
0N/A return (Object)obj;
0N/A }
0N/A }
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as an
0N/A * <code>Object</code> value.
0N/A * <P>
0N/A * The type of the <code>Object</code> will be the default
0N/A * Java object type corresponding to the column's SQL type,
0N/A * following the mapping for built-in types specified in the JDBC 3.0
0N/A * specification.
0N/A * <P>
0N/A * This method may also be used to read datatabase-specific
0N/A * abstract data types.
0N/A * <P>
0N/A * This implementation of the method <code>getObject</code> extends its
0N/A * behavior so that it gets the attributes of an SQL structured type
0N/A * as an array of <code>Object</code> values. This method also custom
0N/A * maps SQL user-defined types to classes
0N/A * in the Java programming language. When the specified column contains
0N/A * a structured or distinct value, the behavior of this method is as
0N/A * if it were a call to the method <code>getObject(columnIndex,
0N/A * this.getStatement().getConnection().getTypeMap())</code>.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return a <code>java.lang.Object</code> holding the column value;
0N/A * if the value is SQL <code>NULL</code>, the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name does not match one of
0N/A * this rowset's column names, (2) the cursor is not
0N/A * on a valid row, or (3) there is a problem getting
0N/A * the <code>Class</code> object for a custom mapping
0N/A * @see #getObject(int)
0N/A */
0N/A public Object getObject(String columnName) throws SQLException {
0N/A return getObject(getColIdxByName(columnName));
0N/A }
0N/A
0N/A //----------------------------------------------------------------
0N/A
0N/A /**
0N/A * Maps the given column name for one of this <code>CachedRowSetImpl</code>
0N/A * object's columns to its column number.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return the column index of the given column name
0N/A * @throws SQLException if the given column name does not match one
0N/A * of this rowset's column names
0N/A */
0N/A public int findColumn(String columnName) throws SQLException {
0N/A return getColIdxByName(columnName);
0N/A }
0N/A
0N/A
0N/A //--------------------------JDBC 2.0-----------------------------------
0N/A
0N/A //---------------------------------------------------------------------
0N/A // Getter's and Setter's
0N/A //---------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>java.io.Reader</code> object.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must
0N/A * be read prior to getting the value of any other column. The
0N/A * next call to a <code>getXXX</code> method implicitly closes the stream.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return a Java character stream that delivers the database column value
0N/A * as a stream of two-byte unicode characters in a
0N/A * <code>java.io.Reader</code> object. If the value is
0N/A * SQL <code>NULL</code>, the result is <code>null</code>.
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>CHAR, VARCHAR, <b>LONGVARCHAR</b>, BINARY, VARBINARY</code> or
0N/A * <code>LONGVARBINARY</code> value.
0N/A * The bold SQL type designates the recommended return type.
0N/A * @see #getCharacterStream(String)
0N/A */
0N/A public java.io.Reader getCharacterStream(int columnIndex) throws SQLException{
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isBinary(RowSetMD.getColumnType(columnIndex))) {
0N/A Object value = getCurrentRow().getColumnObject(columnIndex);
0N/A if (value == null) {
0N/A lastValueNull = true;
0N/A return null;
0N/A }
0N/A charStream = new InputStreamReader
0N/A (new ByteArrayInputStream((byte[])value));
0N/A } else if (isString(RowSetMD.getColumnType(columnIndex))) {
0N/A Object value = getCurrentRow().getColumnObject(columnIndex);
0N/A if (value == null) {
0N/A lastValueNull = true;
0N/A return null;
0N/A }
0N/A charStream = new StringReader(value.toString());
0N/A } else {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A return (java.io.Reader)charStream;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value stored in the designated column
0N/A * of the current row as a <code>java.io.Reader</code> object.
0N/A *
0N/A * <P><B>Note:</B> All the data in the returned stream must
0N/A * be read prior to getting the value of any other column. The
0N/A * next call to a <code>getXXX</code> method implicitly closes the stream.
0N/A *
0N/A * @param columnName a <code>String</code> object giving the SQL name of
0N/A * a column in this <code>CachedRowSetImpl</code> object
0N/A * @return a Java input stream that delivers the database column value
0N/A * as a stream of two-byte Unicode characters. If the value is
0N/A * SQL <code>NULL</code>, the result is <code>null</code>.
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>CHAR, VARCHAR, <b>LONGVARCHAR</b>,
0N/A * BINARY, VARYBINARY</code> or <code>LONGVARBINARY</code> value.
0N/A * The bold SQL type designates the recommended return type.
0N/A */
0N/A public java.io.Reader getCharacterStream(String columnName) throws SQLException {
0N/A return getCharacterStream(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.math.BigDecimal</code> object.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @return a <code>java.math.BigDecimal</code> value with full precision;
0N/A * if the value is SQL <code>NULL</code>, the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>TINYINT, SMALLINT, INTEGER, BIGINT, REAL,
0N/A * FLOAT, DOUBLE, <b>DECIMAL</b>, <b>NUMERIC</b>, BIT, CHAR, VARCHAR</code>
0N/A * or <code>LONGVARCHAR</code> value. The bold SQL type designates the
0N/A * recommended return types that this method is used to retrieve.
0N/A * @see #getBigDecimal(String)
0N/A */
0N/A public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A try {
0N/A return (new BigDecimal(value.toString().trim()));
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.doublefail").toString(),
0N/A new Object[] {value.toString().trim(), columnIndex}));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.math.BigDecimal</code> object.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return a <code>java.math.BigDecimal</code> value with full precision;
0N/A * if the value is SQL <code>NULL</code>, the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
0N/A * BIGINT, REAL, FLOAT, DOUBLE, <b>DECIMAL</b>, <b>NUMERIC</b>, BIT CHAR,
0N/A * VARCHAR</code> or <code>LONGVARCHAR</code> value. The bold SQL type
0N/A * designates the recommended return type that this method is used to
0N/A * retrieve
0N/A * @see #getBigDecimal(int)
0N/A */
0N/A public BigDecimal getBigDecimal(String columnName) throws SQLException {
0N/A return getBigDecimal(getColIdxByName(columnName));
0N/A }
0N/A
0N/A //---------------------------------------------------------------------
0N/A // Traversal/Positioning
0N/A //---------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Returns the number of rows in this <code>CachedRowSetImpl</code> object.
0N/A *
0N/A * @return number of rows in the rowset
0N/A */
0N/A public int size() {
0N/A return numRows;
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the cursor is before the first row in this
0N/A * <code>CachedRowSetImpl</code> object.
0N/A *
0N/A * @return <code>true</code> if the cursor is before the first row;
0N/A * <code>false</code> otherwise or if the rowset contains no rows
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public boolean isBeforeFirst() throws SQLException {
0N/A if (cursorPos == 0 && numRows > 0) {
0N/A return true;
0N/A } else {
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the cursor is after the last row in this
0N/A * <code>CachedRowSetImpl</code> object.
0N/A *
0N/A * @return <code>true</code> if the cursor is after the last row;
0N/A * <code>false</code> otherwise or if the rowset contains no rows
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public boolean isAfterLast() throws SQLException {
0N/A if (cursorPos == numRows+1 && numRows > 0) {
0N/A return true;
0N/A } else {
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the cursor is on the first row in this
0N/A * <code>CachedRowSetImpl</code> object.
0N/A *
0N/A * @return <code>true</code> if the cursor is on the first row;
0N/A * <code>false</code> otherwise or if the rowset contains no rows
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public boolean isFirst() throws SQLException {
0N/A // this becomes nasty because of deletes.
0N/A int saveCursorPos = cursorPos;
0N/A int saveAbsoluteCursorPos = absolutePos;
0N/A internalFirst();
0N/A if (cursorPos == saveCursorPos) {
0N/A return true;
0N/A } else {
0N/A cursorPos = saveCursorPos;
0N/A absolutePos = saveAbsoluteCursorPos;
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the cursor is on the last row in this
0N/A * <code>CachedRowSetImpl</code> object.
0N/A * <P>
0N/A * Note: Calling the method <code>isLast</code> may be expensive
0N/A * because the JDBC driver might need to fetch ahead one row in order
0N/A * to determine whether the current row is the last row in this rowset.
0N/A *
0N/A * @return <code>true</code> if the cursor is on the last row;
0N/A * <code>false</code> otherwise or if this rowset contains no rows
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public boolean isLast() throws SQLException {
0N/A int saveCursorPos = cursorPos;
0N/A int saveAbsoluteCursorPos = absolutePos;
0N/A boolean saveShowDeleted = getShowDeleted();
0N/A setShowDeleted(true);
0N/A internalLast();
0N/A if (cursorPos == saveCursorPos) {
0N/A setShowDeleted(saveShowDeleted);
0N/A return true;
0N/A } else {
0N/A setShowDeleted(saveShowDeleted);
0N/A cursorPos = saveCursorPos;
0N/A absolutePos = saveAbsoluteCursorPos;
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the front of
0N/A * the rowset, just before the first row. This method has no effect if
0N/A * this rowset contains no rows.
0N/A *
0N/A * @throws SQLException if an error occurs or the type of this rowset
0N/A * is <code>ResultSet.TYPE_FORWARD_ONLY</code>
0N/A */
0N/A public void beforeFirst() throws SQLException {
0N/A if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.beforefirst").toString());
0N/A }
0N/A cursorPos = 0;
0N/A absolutePos = 0;
0N/A notifyCursorMoved();
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the end of
0N/A * the rowset, just after the last row. This method has no effect if
0N/A * this rowset contains no rows.
0N/A *
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public void afterLast() throws SQLException {
0N/A if (numRows > 0) {
0N/A cursorPos = numRows + 1;
0N/A absolutePos = 0;
0N/A notifyCursorMoved();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the first row
0N/A * and returns <code>true</code> if the operation was successful. This
0N/A * method also notifies registered listeners that the cursor has moved.
0N/A *
0N/A * @return <code>true</code> if the cursor is on a valid row;
0N/A * <code>false</code> otherwise or if there are no rows in this
0N/A * <code>CachedRowSetImpl</code> object
0N/A * @throws SQLException if the type of this rowset
0N/A * is <code>ResultSet.TYPE_FORWARD_ONLY</code>
0N/A */
0N/A public boolean first() throws SQLException {
0N/A if(getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.first").toString());
0N/A }
0N/A
0N/A // move and notify
0N/A boolean ret = this.internalFirst();
0N/A notifyCursorMoved();
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the first
0N/A * row and returns <code>true</code> if the operation is successful.
0N/A * <P>
0N/A * This method is called internally by the methods <code>first</code>,
0N/A * <code>isFirst</code>, and <code>absolute</code>.
0N/A * It in turn calls the method <code>internalNext</code> in order to
0N/A * handle the case where the first row is a deleted row that is not visible.
0N/A * <p>
0N/A * This is a implementation only method and is not required as a standard
0N/A * implementation of the <code>CachedRowSet</code> interface.
0N/A *
0N/A * @return <code>true</code> if the cursor moved to the first row;
0N/A * <code>false</code> otherwise
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A protected boolean internalFirst() throws SQLException {
0N/A boolean ret = false;
0N/A
0N/A if (numRows > 0) {
0N/A cursorPos = 1;
0N/A if ((getShowDeleted() == false) && (rowDeleted() == true)) {
0N/A ret = internalNext();
0N/A } else {
0N/A ret = true;
0N/A }
0N/A }
0N/A
0N/A if (ret == true)
0N/A absolutePos = 1;
0N/A else
0N/A absolutePos = 0;
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the last row
0N/A * and returns <code>true</code> if the operation was successful. This
0N/A * method also notifies registered listeners that the cursor has moved.
0N/A *
0N/A * @return <code>true</code> if the cursor is on a valid row;
0N/A * <code>false</code> otherwise or if there are no rows in this
0N/A * <code>CachedRowSetImpl</code> object
0N/A * @throws SQLException if the type of this rowset
0N/A * is <code>ResultSet.TYPE_FORWARD_ONLY</code>
0N/A */
0N/A public boolean last() throws SQLException {
0N/A if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.last").toString());
0N/A }
0N/A
0N/A // move and notify
0N/A boolean ret = this.internalLast();
0N/A notifyCursorMoved();
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the last
0N/A * row and returns <code>true</code> if the operation is successful.
0N/A * <P>
0N/A * This method is called internally by the method <code>last</code>
0N/A * when rows have been deleted and the deletions are not visible.
0N/A * The method <code>internalLast</code> handles the case where the
0N/A * last row is a deleted row that is not visible by in turn calling
0N/A * the method <code>internalPrevious</code>.
0N/A * <p>
0N/A * This is a implementation only method and is not required as a standard
0N/A * implementation of the <code>CachedRowSet</code> interface.
0N/A *
0N/A * @return <code>true</code> if the cursor moved to the last row;
0N/A * <code>false</code> otherwise
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A protected boolean internalLast() throws SQLException {
0N/A boolean ret = false;
0N/A
0N/A if (numRows > 0) {
0N/A cursorPos = numRows;
0N/A if ((getShowDeleted() == false) && (rowDeleted() == true)) {
0N/A ret = internalPrevious();
0N/A } else {
0N/A ret = true;
0N/A }
0N/A }
0N/A if (ret == true)
0N/A absolutePos = numRows - numDeleted;
0N/A else
0N/A absolutePos = 0;
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Returns the number of the current row in this <code>CachedRowSetImpl</code>
0N/A * object. The first row is number 1, the second number 2, and so on.
0N/A *
0N/A * @return the number of the current row; <code>0</code> if there is no
0N/A * current row
0N/A * @throws SQLException if an error occurs; or if the <code>CacheRowSetImpl</code>
0N/A * is empty
0N/A */
0N/A public int getRow() throws SQLException {
0N/A // are we on a valid row? Valid rows are between first and last
0N/A if (numRows > 0 &&
0N/A cursorPos > 0 &&
0N/A cursorPos < (numRows + 1) &&
0N/A (getShowDeleted() == false && rowDeleted() == false)) {
0N/A return absolutePos;
0N/A } else if (getShowDeleted() == true) {
0N/A return cursorPos;
0N/A } else {
0N/A return 0;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the row number
0N/A * specified.
0N/A *
0N/A * <p>If the number is positive, the cursor moves to an absolute row with
0N/A * respect to the beginning of the rowset. The first row is row 1, the second
0N/A * is row 2, and so on. For example, the following command, in which
0N/A * <code>crs</code> is a <code>CachedRowSetImpl</code> object, moves the cursor
0N/A * to the fourth row, starting from the beginning of the rowset.
0N/A * <PRE><code>
0N/A *
0N/A * crs.absolute(4);
0N/A *
0N/A * </code> </PRE>
0N/A * <P>
0N/A * If the number is negative, the cursor moves to an absolute row position
0N/A * with respect to the end of the rowset. For example, calling
0N/A * <code>absolute(-1)</code> positions the cursor on the last row,
0N/A * <code>absolute(-2)</code> moves it on the next-to-last row, and so on.
0N/A * If the <code>CachedRowSetImpl</code> object <code>crs</code> has five rows,
0N/A * the following command moves the cursor to the fourth-to-last row, which
0N/A * in the case of a rowset with five rows, is also the second row, counting
0N/A * from the beginning.
0N/A * <PRE><code>
0N/A *
0N/A * crs.absolute(-4);
0N/A *
0N/A * </code> </PRE>
0N/A *
0N/A * If the number specified is larger than the number of rows, the cursor
0N/A * will move to the position after the last row. If the number specified
0N/A * would move the cursor one or more rows before the first row, the cursor
0N/A * moves to the position before the first row.
0N/A * <P>
0N/A * Note: Calling <code>absolute(1)</code> is the same as calling the
0N/A * method <code>first()</code>. Calling <code>absolute(-1)</code> is the
0N/A * same as calling <code>last()</code>.
0N/A *
0N/A * @param row a positive number to indicate the row, starting row numbering from
0N/A * the first row, which is <code>1</code>; a negative number to indicate
0N/A * the row, starting row numbering from the last row, which is
0N/A * <code>-1</code>; it must not be <code>0</code>
0N/A * @return <code>true</code> if the cursor is on the rowset; <code>false</code>
0N/A * otherwise
0N/A * @throws SQLException if the given cursor position is <code>0</code> or the
0N/A * type of this rowset is <code>ResultSet.TYPE_FORWARD_ONLY</code>
0N/A */
0N/A public boolean absolute( int row ) throws SQLException {
0N/A if (row == 0 || getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.absolute").toString());
0N/A }
0N/A
0N/A if (row > 0) { // we are moving foward
0N/A if (row > numRows) {
0N/A // fell off the end
0N/A afterLast();
0N/A return false;
0N/A } else {
0N/A if (absolutePos <= 0)
0N/A internalFirst();
0N/A }
0N/A } else { // we are moving backward
0N/A if (cursorPos + row < 0) {
0N/A // fell off the front
0N/A beforeFirst();
0N/A return false;
0N/A } else {
0N/A if (absolutePos >= 0)
0N/A internalLast();
0N/A }
0N/A }
0N/A
0N/A // Now move towards the absolute row that we're looking for
0N/A while (absolutePos != row) {
0N/A if (absolutePos < row) {
0N/A if (!internalNext())
0N/A break;
0N/A }
0N/A else {
0N/A if (!internalPrevious())
0N/A break;
0N/A }
0N/A }
0N/A
0N/A notifyCursorMoved();
0N/A
0N/A if (isAfterLast() || isBeforeFirst()) {
0N/A return false;
0N/A } else {
0N/A return true;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Moves the cursor the specified number of rows from the current
0N/A * position, with a positive number moving it forward and a
0N/A * negative number moving it backward.
0N/A * <P>
0N/A * If the number is positive, the cursor moves the specified number of
0N/A * rows toward the end of the rowset, starting at the current row.
0N/A * For example, the following command, in which
0N/A * <code>crs</code> is a <code>CachedRowSetImpl</code> object with 100 rows,
0N/A * moves the cursor forward four rows from the current row. If the
0N/A * current row is 50, the cursor would move to row 54.
0N/A * <PRE><code>
0N/A *
0N/A * crs.relative(4);
0N/A *
0N/A * </code> </PRE>
0N/A * <P>
0N/A * If the number is negative, the cursor moves back toward the beginning
0N/A * the specified number of rows, starting at the current row.
0N/A * For example, calling the method
0N/A * <code>absolute(-1)</code> positions the cursor on the last row,
0N/A * <code>absolute(-2)</code> moves it on the next-to-last row, and so on.
0N/A * If the <code>CachedRowSetImpl</code> object <code>crs</code> has five rows,
0N/A * the following command moves the cursor to the fourth-to-last row, which
0N/A * in the case of a rowset with five rows, is also the second row
0N/A * from the beginning.
0N/A * <PRE><code>
0N/A *
0N/A * crs.absolute(-4);
0N/A *
0N/A * </code> </PRE>
0N/A *
0N/A * If the number specified is larger than the number of rows, the cursor
0N/A * will move to the position after the last row. If the number specified
0N/A * would move the cursor one or more rows before the first row, the cursor
0N/A * moves to the position before the first row. In both cases, this method
0N/A * throws an <code>SQLException</code>.
0N/A * <P>
0N/A * Note: Calling <code>absolute(1)</code> is the same as calling the
0N/A * method <code>first()</code>. Calling <code>absolute(-1)</code> is the
0N/A * same as calling <code>last()</code>. Calling <code>relative(0)</code>
0N/A * is valid, but it does not change the cursor position.
0N/A *
0N/A * @param rows an <code>int</code> indicating the number of rows to move
0N/A * the cursor, starting at the current row; a positive number
0N/A * moves the cursor forward; a negative number moves the cursor
0N/A * backward; must not move the cursor past the valid
0N/A * rows
0N/A * @return <code>true</code> if the cursor is on a row in this
0N/A * <code>CachedRowSetImpl</code> object; <code>false</code>
0N/A * otherwise
0N/A * @throws SQLException if there are no rows in this rowset, the cursor is
0N/A * positioned either before the first row or after the last row, or
0N/A * the rowset is type <code>ResultSet.TYPE_FORWARD_ONLY</code>
0N/A */
0N/A public boolean relative(int rows) throws SQLException {
0N/A if (numRows == 0 || isBeforeFirst() ||
0N/A isAfterLast() || getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.relative").toString());
0N/A }
0N/A
0N/A if (rows == 0) {
0N/A return true;
0N/A }
0N/A
0N/A if (rows > 0) { // we are moving forward
0N/A if (cursorPos + rows > numRows) {
0N/A // fell off the end
0N/A afterLast();
0N/A } else {
0N/A for (int i=0; i < rows; i++) {
0N/A if (!internalNext())
0N/A break;
0N/A }
0N/A }
0N/A } else { // we are moving backward
0N/A if (cursorPos + rows < 0) {
0N/A // fell off the front
0N/A beforeFirst();
0N/A } else {
0N/A for (int i=rows; i < 0; i++) {
0N/A if (!internalPrevious())
0N/A break;
0N/A }
0N/A }
0N/A }
0N/A notifyCursorMoved();
0N/A
0N/A if (isAfterLast() || isBeforeFirst()) {
0N/A return false;
0N/A } else {
0N/A return true;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Moves this <code>CachedRowSetImpl</code> object's cursor to the
0N/A * previous row and returns <code>true</code> if the cursor is on
0N/A * a valid row or <code>false</code> if it is not.
0N/A * This method also notifies all listeners registered with this
0N/A * <code>CachedRowSetImpl</code> object that its cursor has moved.
0N/A * <P>
0N/A * Note: calling the method <code>previous()</code> is not the same
0N/A * as calling the method <code>relative(-1)</code>. This is true
0N/A * because it is possible to call <code>previous()</code> from the insert
0N/A * row, from after the last row, or from the current row, whereas
0N/A * <code>relative</code> may only be called from the current row.
0N/A * <P>
0N/A * The method <code>previous</code> may used in a <code>while</code>
0N/A * loop to iterate through a rowset starting after the last row
0N/A * and moving toward the beginning. The loop ends when <code>previous</code>
0N/A * returns <code>false</code>, meaning that there are no more rows.
0N/A * For example, the following code fragment retrieves all the data in
0N/A * the <code>CachedRowSetImpl</code> object <code>crs</code>, which has
0N/A * three columns. Note that the cursor must initially be positioned
0N/A * after the last row so that the first call to the method
0N/A * <code>previous</code> places the cursor on the last line.
0N/A * <PRE> <code>
0N/A *
0N/A * crs.afterLast();
0N/A * while (previous()) {
0N/A * String name = crs.getString(1);
0N/A * int age = crs.getInt(2);
0N/A * short ssn = crs.getShort(3);
0N/A * System.out.println(name + " " + age + " " + ssn);
0N/A * }
0N/A *
0N/A * </code> </PRE>
0N/A * This method throws an <code>SQLException</code> if the cursor is not
0N/A * on a row in the rowset, before the first row, or after the last row.
0N/A *
0N/A * @return <code>true</code> if the cursor is on a valid row;
0N/A * <code>false</code> if it is before the first row or after the
0N/A * last row
0N/A * @throws SQLException if the cursor is not on a valid position or the
0N/A * type of this rowset is <code>ResultSet.TYPE_FORWARD_ONLY</code>
0N/A */
0N/A public boolean previous() throws SQLException {
0N/A if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.last").toString());
0N/A }
0N/A /*
0N/A * make sure things look sane. The cursor must be
0N/A * positioned in the rowset or before first (0) or
0N/A * after last (numRows + 1)
0N/A */
0N/A if (cursorPos < 0 || cursorPos > numRows + 1) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A // move and notify
0N/A boolean ret = this.internalPrevious();
0N/A notifyCursorMoved();
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A /**
0N/A * Moves the cursor to the previous row in this <code>CachedRowSetImpl</code>
0N/A * object, skipping past deleted rows that are not visible; returns
0N/A * <code>true</code> if the cursor is on a row in this rowset and
0N/A * <code>false</code> when the cursor goes before the first row.
0N/A * <P>
0N/A * This method is called internally by the method <code>previous</code>.
0N/A * <P>
0N/A * This is a implementation only method and is not required as a standard
0N/A * implementation of the <code>CachedRowSet</code> interface.
0N/A *
0N/A * @return <code>true</code> if the cursor is on a row in this rowset;
0N/A * <code>false</code> when the cursor reaches the position before
0N/A * the first row
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A protected boolean internalPrevious() throws SQLException {
0N/A boolean ret = false;
0N/A
0N/A do {
0N/A if (cursorPos > 1) {
0N/A --cursorPos;
0N/A ret = true;
0N/A } else if (cursorPos == 1) {
0N/A // decrement to before first
0N/A --cursorPos;
0N/A ret = false;
0N/A break;
0N/A }
0N/A } while ((getShowDeleted() == false) && (rowDeleted() == true));
0N/A
0N/A /*
0N/A * Each call to internalPrevious may move the cursor
0N/A * over multiple rows, the absolute postion moves one one row
0N/A */
0N/A if (ret == true)
0N/A --absolutePos;
0N/A else
0N/A absolutePos = 0;
0N/A
0N/A return ret;
0N/A }
0N/A
0N/A
0N/A //---------------------------------------------------------------------
0N/A // Updates
0N/A //---------------------------------------------------------------------
0N/A
0N/A /**
0N/A * Indicates whether the current row of this <code>CachedRowSetImpl</code>
0N/A * object has been updated. The value returned
0N/A * depends on whether this rowset can detect updates: <code>false</code>
0N/A * will always be returned if it does not detect updates.
0N/A *
0N/A * @return <code>true</code> if the row has been visibly updated
0N/A * by the owner or another and updates are detected;
0N/A * <code>false</code> otherwise
0N/A * @throws SQLException if the cursor is on the insert row or not
0N/A * not on a valid row
0N/A *
0N/A * @see DatabaseMetaData#updatesAreDetected
0N/A */
0N/A public boolean rowUpdated() throws SQLException {
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidop").toString());
0N/A }
0N/A return(((Row)getCurrentRow()).getUpdated());
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the designated column of the current row of
0N/A * this <code>CachedRowSetImpl</code> object has been updated. The
0N/A * value returned depends on whether this rowset can detcted updates:
0N/A * <code>false</code> will always be returned if it does not detect updates.
0N/A *
0N/A * @param idx the index identifier of the column that may be have been updated.
0N/A * @return <code>true</code> is the designated column has been updated
0N/A * and the rowset detects updates; <code>false</code> if the rowset has not
0N/A * been updated or the rowset does not detect updates
0N/A * @throws SQLException if the cursor is on the insert row or not
0N/A * on a valid row
0N/A * @see DatabaseMetaData#updatesAreDetected
0N/A */
0N/A public boolean columnUpdated(int idx) throws SQLException {
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidop").toString());
0N/A }
0N/A return (((Row)getCurrentRow()).getColUpdated(idx - 1));
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the designated column of the current row of
0N/A * this <code>CachedRowSetImpl</code> object has been updated. The
0N/A * value returned depends on whether this rowset can detcted updates:
0N/A * <code>false</code> will always be returned if it does not detect updates.
0N/A *
0N/A * @param columnName the <code>String</code> column name column that may be have
0N/A * been updated.
0N/A * @return <code>true</code> is the designated column has been updated
0N/A * and the rowset detects updates; <code>false</code> if the rowset has not
0N/A * been updated or the rowset does not detect updates
0N/A * @throws SQLException if the cursor is on the insert row or not
0N/A * on a valid row
0N/A * @see DatabaseMetaData#updatesAreDetected
0N/A */
0N/A public boolean columnUpdated(String columnName) throws SQLException {
0N/A return columnUpdated(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the current row has been inserted. The value returned
0N/A * depends on whether or not the rowset can detect visible inserts.
0N/A *
0N/A * @return <code>true</code> if a row has been inserted and inserts are detected;
0N/A * <code>false</code> otherwise
0N/A * @throws SQLException if the cursor is on the insert row or not
0N/A * not on a valid row
0N/A *
0N/A * @see DatabaseMetaData#insertsAreDetected
0N/A */
0N/A public boolean rowInserted() throws SQLException {
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidop").toString());
0N/A }
0N/A return(((Row)getCurrentRow()).getInserted());
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the current row has been deleted. A deleted row
0N/A * may leave a visible "hole" in a rowset. This method can be used to
0N/A * detect such holes if the rowset can detect deletions. This method
0N/A * will always return <code>false</code> if this rowset cannot detect
0N/A * deletions.
0N/A *
0N/A * @return <code>true</code> if (1)the current row is blank, indicating that
0N/A * the row has been deleted, and (2)deletions are detected;
0N/A * <code>false</code> otherwise
0N/A * @throws SQLException if the cursor is on a valid row in this rowset
0N/A * @see DatabaseMetaData#deletesAreDetected
0N/A */
0N/A public boolean rowDeleted() throws SQLException {
0N/A // make sure the cursor is on a valid row
0N/A
0N/A if (isAfterLast() == true ||
0N/A isBeforeFirst() == true ||
0N/A onInsertRow == true) {
0N/A
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A return(((Row)getCurrentRow()).getDeleted());
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the given SQL data type is a numberic type.
0N/A *
0N/A * @param type one of the constants from <code>java.sql.Types</code>
0N/A * @return <code>true</code> if the given type is <code>NUMERIC</code>,'
0N/A * <code>DECIMAL</code>, <code>BIT</code>, <code>TINYINT</code>,
0N/A * <code>SMALLINT</code>, <code>INTEGER</code>, <code>BIGINT</code>,
0N/A * <code>REAL</code>, <code>DOUBLE</code>, or <code>FLOAT</code>;
0N/A * <code>false</code> otherwise
0N/A */
0N/A private boolean isNumeric(int type) {
0N/A switch (type) {
0N/A case java.sql.Types.NUMERIC:
0N/A case java.sql.Types.DECIMAL:
0N/A case java.sql.Types.BIT:
0N/A case java.sql.Types.TINYINT:
0N/A case java.sql.Types.SMALLINT:
0N/A case java.sql.Types.INTEGER:
0N/A case java.sql.Types.BIGINT:
0N/A case java.sql.Types.REAL:
0N/A case java.sql.Types.DOUBLE:
0N/A case java.sql.Types.FLOAT:
0N/A return true;
0N/A default:
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the given SQL data type is a string type.
0N/A *
0N/A * @param type one of the constants from <code>java.sql.Types</code>
0N/A * @return <code>true</code> if the given type is <code>CHAR</code>,'
0N/A * <code>VARCHAR</code>, or <code>LONGVARCHAR</code>;
0N/A * <code>false</code> otherwise
0N/A */
0N/A private boolean isString(int type) {
0N/A switch (type) {
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR:
0N/A return true;
0N/A default:
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the given SQL data type is a binary type.
0N/A *
0N/A * @param type one of the constants from <code>java.sql.Types</code>
0N/A * @return <code>true</code> if the given type is <code>BINARY</code>,'
0N/A * <code>VARBINARY</code>, or <code>LONGVARBINARY</code>;
0N/A * <code>false</code> otherwise
0N/A */
0N/A private boolean isBinary(int type) {
0N/A switch (type) {
0N/A case java.sql.Types.BINARY:
0N/A case java.sql.Types.VARBINARY:
0N/A case java.sql.Types.LONGVARBINARY:
0N/A return true;
0N/A default:
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the given SQL data type is a temporal type.
0N/A * This method is called internally by the conversion methods
0N/A * <code>convertNumeric</code> and <code>convertTemporal</code>.
0N/A *
0N/A * @param type one of the constants from <code>java.sql.Types</code>
0N/A * @return <code>true</code> if the given type is <code>DATE</code>,
0N/A * <code>TIME</code>, or <code>TIMESTAMP</code>;
0N/A * <code>false</code> otherwise
0N/A */
0N/A private boolean isTemporal(int type) {
0N/A switch (type) {
0N/A case java.sql.Types.DATE:
0N/A case java.sql.Types.TIME:
0N/A case java.sql.Types.TIMESTAMP:
0N/A return true;
0N/A default:
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Indicates whether the given SQL data type is a boolean type.
0N/A * This method is called internally by the conversion methods
0N/A * <code>convertNumeric</code> and <code>convertBoolean</code>.
0N/A *
0N/A * @param type one of the constants from <code>java.sql.Types</code>
0N/A * @return <code>true</code> if the given type is <code>BIT</code>,
0N/A * , or <code>BOOLEAN</code>;
0N/A * <code>false</code> otherwise
0N/A */
0N/A private boolean isBoolean(int type) {
0N/A switch (type) {
0N/A case java.sql.Types.BIT:
0N/A case java.sql.Types.BOOLEAN:
0N/A return true;
0N/A default:
0N/A return false;
0N/A }
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Converts the given <code>Object</code> in the Java programming language
0N/A * to the standard mapping for the specified SQL target data type.
0N/A * The conversion must be to a string or numeric type, but there are no
0N/A * restrictions on the type to be converted. If the source type and target
0N/A * type are the same, the given object is simply returned.
0N/A *
0N/A * @param srcObj the <code>Object</code> in the Java programming language
0N/A * that is to be converted to the target type
0N/A * @param srcType the data type that is the standard mapping in SQL of the
0N/A * object to be converted; must be one of the constants in
0N/A * <code>java.sql.Types</code>
0N/A * @param trgType the SQL data type to which to convert the given object;
0N/A * must be one of the following constants in
0N/A * <code>java.sql.Types</code>: <code>NUMERIC</code>,
0N/A * <code>DECIMAL</code>, <code>BIT</code>, <code>TINYINT</code>,
0N/A * <code>SMALLINT</code>, <code>INTEGER</code>, <code>BIGINT</code>,
0N/A * <code>REAL</code>, <code>DOUBLE</code>, <code>FLOAT</code>,
0N/A * <code>VARCHAR</code>, <code>LONGVARCHAR</code>, or <code>CHAR</code>
0N/A * @return an <code>Object</code> value.that is
0N/A * the standard object mapping for the target SQL type
0N/A * @throws SQLException if the given target type is not one of the string or
0N/A * numeric types in <code>java.sql.Types</code>
0N/A */
0N/A private Object convertNumeric(Object srcObj, int srcType,
0N/A int trgType) throws SQLException {
0N/A
0N/A if (srcType == trgType) {
0N/A return srcObj;
0N/A }
0N/A
0N/A if (isNumeric(trgType) == false && isString(trgType) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString() + trgType);
0N/A }
0N/A
0N/A try {
0N/A switch (trgType) {
0N/A case java.sql.Types.BIT:
2828N/A Integer i = Integer.valueOf(srcObj.toString().trim());
2828N/A return i.equals(Integer.valueOf((int)0)) ?
2828N/A Boolean.valueOf(false) :
2828N/A Boolean.valueOf(true);
0N/A case java.sql.Types.TINYINT:
2828N/A return Byte.valueOf(srcObj.toString().trim());
0N/A case java.sql.Types.SMALLINT:
2828N/A return Short.valueOf(srcObj.toString().trim());
0N/A case java.sql.Types.INTEGER:
2828N/A return Integer.valueOf(srcObj.toString().trim());
0N/A case java.sql.Types.BIGINT:
2828N/A return Long.valueOf(srcObj.toString().trim());
0N/A case java.sql.Types.NUMERIC:
0N/A case java.sql.Types.DECIMAL:
0N/A return new BigDecimal(srcObj.toString().trim());
0N/A case java.sql.Types.REAL:
0N/A case java.sql.Types.FLOAT:
0N/A return new Float(srcObj.toString().trim());
0N/A case java.sql.Types.DOUBLE:
0N/A return new Double(srcObj.toString().trim());
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR:
2823N/A return srcObj.toString();
0N/A default:
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString()+ trgType);
0N/A }
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString() + trgType);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Converts the given <code>Object</code> in the Java programming language
0N/A * to the standard object mapping for the specified SQL target data type.
0N/A * The conversion must be to a string or temporal type, and there are also
0N/A * restrictions on the type to be converted.
0N/A * <P>
0N/A * <TABLE ALIGN="CENTER" BORDER CELLPADDING=10 BORDERCOLOR="#0000FF"
0N/A * <CAPTION ALIGN="CENTER"><B>Parameters and Return Values</B></CAPTION>
0N/A * <TR>
0N/A * <TD><B>Source SQL Type</B>
0N/A * <TD><B>Target SQL Type</B>
0N/A * <TD><B>Object Returned</B>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD><code>TIMESTAMP</code>
0N/A * <TD><code>DATE</code>
0N/A * <TD><code>java.sql.Date</code>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD><code>TIMESTAMP</code>
0N/A * <TD><code>TIME</code>
0N/A * <TD><code>java.sql.Time</code>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD><code>TIME</code>
0N/A * <TD><code>TIMESTAMP</code>
0N/A * <TD><code>java.sql.Timestamp</code>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD><code>DATE</code>, <code>TIME</code>, or <code>TIMESTAMP</code>
0N/A * <TD><code>CHAR</code>, <code>VARCHAR</code>, or <code>LONGVARCHAR</code>
0N/A * <TD><code>java.lang.String</code>
0N/A * </TR>
0N/A * </TABLE>
0N/A * <P>
0N/A * If the source type and target type are the same,
0N/A * the given object is simply returned.
0N/A *
0N/A * @param srcObj the <code>Object</code> in the Java programming language
0N/A * that is to be converted to the target type
0N/A * @param srcType the data type that is the standard mapping in SQL of the
0N/A * object to be converted; must be one of the constants in
0N/A * <code>java.sql.Types</code>
0N/A * @param trgType the SQL data type to which to convert the given object;
0N/A * must be one of the following constants in
0N/A * <code>java.sql.Types</code>: <code>DATE</code>,
0N/A * <code>TIME</code>, <code>TIMESTAMP</code>, <code>CHAR</code>,
0N/A * <code>VARCHAR</code>, or <code>LONGVARCHAR</code>
0N/A * @return an <code>Object</code> value.that is
0N/A * the standard object mapping for the target SQL type
0N/A * @throws SQLException if the given target type is not one of the string or
0N/A * temporal types in <code>java.sql.Types</code>
0N/A */
0N/A private Object convertTemporal(Object srcObj,
0N/A int srcType, int trgType) throws SQLException {
0N/A
0N/A if (srcType == trgType) {
0N/A return srcObj;
0N/A }
0N/A
0N/A if (isNumeric(trgType) == true ||
0N/A (isString(trgType) == false && isTemporal(trgType) == false)) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A try {
0N/A switch (trgType) {
0N/A case java.sql.Types.DATE:
0N/A if (srcType == java.sql.Types.TIMESTAMP) {
0N/A return new java.sql.Date(((java.sql.Timestamp)srcObj).getTime());
0N/A } else {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A case java.sql.Types.TIMESTAMP:
0N/A if (srcType == java.sql.Types.TIME) {
0N/A return new Timestamp(((java.sql.Time)srcObj).getTime());
0N/A } else {
0N/A return new Timestamp(((java.sql.Date)srcObj).getTime());
0N/A }
0N/A case java.sql.Types.TIME:
0N/A if (srcType == java.sql.Types.TIMESTAMP) {
0N/A return new Time(((java.sql.Timestamp)srcObj).getTime());
0N/A } else {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR:
2823N/A return srcObj.toString();
0N/A default:
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Converts the given <code>Object</code> in the Java programming language
0N/A * to the standard mapping for the specified SQL target data type.
0N/A * The conversion must be to a string or numeric type, but there are no
0N/A * restrictions on the type to be converted. If the source type and target
0N/A * type are the same, the given object is simply returned.
0N/A *
0N/A * @param srcObj the <code>Object</code> in the Java programming language
0N/A * that is to be converted to the target type
0N/A * @param srcType the data type that is the standard mapping in SQL of the
0N/A * object to be converted; must be one of the constants in
0N/A * <code>java.sql.Types</code>
0N/A * @param trgType the SQL data type to which to convert the given object;
0N/A * must be one of the following constants in
0N/A * <code>java.sql.Types</code>: <code>BIT</code>,
0N/A * or <code>BOOLEAN</code>
0N/A * @return an <code>Object</code> value.that is
0N/A * the standard object mapping for the target SQL type
0N/A * @throws SQLException if the given target type is not one of the Boolean
0N/A * types in <code>java.sql.Types</code>
0N/A */
0N/A private Object convertBoolean(Object srcObj, int srcType,
0N/A int trgType) throws SQLException {
0N/A
0N/A if (srcType == trgType) {
0N/A return srcObj;
0N/A }
0N/A
0N/A if (isNumeric(trgType) == true ||
0N/A (isString(trgType) == false && isBoolean(trgType) == false)) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A
0N/A try {
0N/A switch (trgType) {
0N/A case java.sql.Types.BIT:
2828N/A Integer i = Integer.valueOf(srcObj.toString().trim());
2828N/A return i.equals(Integer.valueOf((int)0)) ?
2828N/A Boolean.valueOf(false) :
2828N/A Boolean.valueOf(true);
0N/A case java.sql.Types.BOOLEAN:
2828N/A return Boolean.valueOf(srcObj.toString().trim());
0N/A default:
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString()+ trgType);
0N/A }
0N/A } catch (NumberFormatException ex) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString() + trgType);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated nullable column in the current row or the
0N/A * insert row of this <code>CachedRowSetImpl</code> object with
0N/A * <code>null</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset; however, another method must be called to complete
0N/A * the update process. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to mark the row as updated
0N/A * and to notify listeners that the row has changed.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called to insert the new row into this rowset and to notify
0N/A * listeners that a row has changed.
0N/A * <P>
0N/A * In order to propagate updates in this rowset to the underlying
0N/A * data source, an application must call the method {@link #acceptChanges}
0N/A * after it calls either <code>updateRow</code> or <code>insertRow</code>.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateNull(int columnIndex) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A BaseRow row = getCurrentRow();
0N/A row.setColumnObject(columnIndex, null);
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>boolean</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBoolean(int columnIndex, boolean x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
2828N/A Object obj = convertBoolean(Boolean.valueOf(x),
0N/A java.sql.Types.BIT,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>byte</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateByte(int columnIndex, byte x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
2828N/A Object obj = convertNumeric(Byte.valueOf(x),
0N/A java.sql.Types.TINYINT,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>short</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateShort(int columnIndex, short x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
2828N/A Object obj = convertNumeric(Short.valueOf(x),
0N/A java.sql.Types.SMALLINT,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>int</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateInt(int columnIndex, int x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
2828N/A Object obj = convertNumeric(Integer.valueOf(x),
0N/A java.sql.Types.INTEGER,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>long</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateLong(int columnIndex, long x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
2828N/A Object obj = convertNumeric(Long.valueOf(x),
0N/A java.sql.Types.BIGINT,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>float</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateFloat(int columnIndex, float x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A Object obj = convertNumeric(new Float(x),
0N/A java.sql.Types.REAL,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>double</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateDouble(int columnIndex, double x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A Object obj = convertNumeric(new Double(x),
0N/A java.sql.Types.DOUBLE,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.math.BigDecimal</code> object.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A Object obj = convertNumeric(x,
0N/A java.sql.Types.NUMERIC,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>String</code> object.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to mark the row as updated.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called to insert the new row into this rowset and mark it
0N/A * as inserted. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A * <P>
0N/A * The method <code>acceptChanges</code> must be called if the
0N/A * updated values are to be written back to the underlying database.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateString(int columnIndex, String x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>byte</code> array.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBytes(int columnIndex, byte x[]) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isBinary(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Date</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, (3) the type of the designated column is not
0N/A * an SQL <code>DATE</code> or <code>TIMESTAMP</code>, or
0N/A * (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateDate(int columnIndex, java.sql.Date x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A Object obj = convertTemporal(x,
0N/A java.sql.Types.DATE,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Time</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, (3) the type of the designated column is not
0N/A * an SQL <code>TIME</code> or <code>TIMESTAMP</code>, or
0N/A * (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateTime(int columnIndex, java.sql.Time x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A Object obj = convertTemporal(x,
0N/A java.sql.Types.TIME,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Timestamp</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, (3) the type of the designated column is not
0N/A * an SQL <code>DATE</code>, <code>TIME</code>, or
0N/A * <code>TIMESTAMP</code>, or (4) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A Object obj = convertTemporal(x,
0N/A java.sql.Types.TIMESTAMP,
0N/A RowSetMD.getColumnType(columnIndex));
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, obj);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * ASCII stream value.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @param length the number of one-byte ASCII characters in the stream
0N/A * @throws SQLException if this method is invoked
0N/A */
0N/A public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException {
0N/A // sanity Check
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A
0N/A if (isString(RowSetMD.getColumnType(columnIndex)) == false &&
0N/A isBinary(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A byte buf[] = new byte[length];
0N/A try {
0N/A int charsRead = 0;
0N/A do {
0N/A charsRead += x.read(buf, charsRead, length - charsRead);
0N/A } while (charsRead != length);
0N/A //Changed the condition check to check for length instead of -1
0N/A } catch (java.io.IOException ex) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.asciistream").toString());
0N/A }
0N/A String str = new String(buf);
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, str);
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.io.InputStream</code> object.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value; must be a <code>java.io.InputStream</code>
0N/A * containing <code>BINARY</code>, <code>VARBINARY</code>, or
0N/A * <code>LONGVARBINARY</code> data
0N/A * @param length the length of the stream in bytes
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, (3) the data in the stream is not binary, or
0N/A * (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBinaryStream(int columnIndex, java.io.InputStream x,int length) throws SQLException {
0N/A // sanity Check
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isBinary(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A byte buf[] = new byte[length];
0N/A try {
0N/A int bytesRead = 0;
0N/A do {
0N/A bytesRead += x.read(buf, bytesRead, length - bytesRead);
0N/A } while (bytesRead != -1);
0N/A } catch (java.io.IOException ex) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.binstream").toString());
0N/A }
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, buf);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.io.Reader</code> object.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value; must be a <code>java.io.Reader</code>
0N/A * containing <code>BINARY</code>, <code>VARBINARY</code>,
0N/A * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
0N/A * or <code>LONGVARCHAR</code> data
0N/A * @param length the length of the stream in characters
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, (3) the data in the stream is not a binary or
0N/A * character type, or (4) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws SQLException {
0N/A // sanity Check
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (isString(RowSetMD.getColumnType(columnIndex)) == false &&
0N/A isBinary(RowSetMD.getColumnType(columnIndex)) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A char buf[] = new char[length];
0N/A try {
0N/A int charsRead = 0;
0N/A do {
0N/A charsRead += x.read(buf, charsRead, length - charsRead);
0N/A } while (charsRead != length);
0N/A //Changed the condition checking to check for length instead of -1
0N/A } catch (java.io.IOException ex) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.binstream").toString());
0N/A }
0N/A String str = new String(buf);
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, str);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Object</code> value. The <code>scale</code> parameter indicates
0N/A * the number of digits to the right of the decimal point and is ignored
0N/A * if the new column value is not a type that will be mapped to an SQL
0N/A * <code>DECIMAL</code> or <code>NUMERIC</code> value.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @param scale the number of digits to the right of the decimal point (for
0N/A * <code>DECIMAL</code> and <code>NUMERIC</code> types only)
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateObject(int columnIndex, Object x, int scale) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A int type = RowSetMD.getColumnType(columnIndex);
0N/A if (type == Types.DECIMAL || type == Types.NUMERIC) {
0N/A ((java.math.BigDecimal)x).setScale(scale);
0N/A }
0N/A getCurrentRow().setColumnObject(columnIndex, x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Object</code> value.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateObject(int columnIndex, Object x) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A getCurrentRow().setColumnObject(columnIndex, x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated nullable column in the current row or the
0N/A * insert row of this <code>CachedRowSetImpl</code> object with
0N/A * <code>null</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateNull(String columnName) throws SQLException {
0N/A updateNull(getColIdxByName(columnName));
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>boolean</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBoolean(String columnName, boolean x) throws SQLException {
0N/A updateBoolean(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>byte</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateByte(String columnName, byte x) throws SQLException {
0N/A updateByte(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>short</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateShort(String columnName, short x) throws SQLException {
0N/A updateShort(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>int</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateInt(String columnName, int x) throws SQLException {
0N/A updateInt(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>long</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateLong(String columnName, long x) throws SQLException {
0N/A updateLong(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>float</code> value.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateFloat(String columnName, float x) throws SQLException {
0N/A updateFloat(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>double</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateDouble(String columnName, double x) throws SQLException {
0N/A updateDouble(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.math.BigDecimal</code> object.
0N/A * <P>
0N/A * This method updates a column value in the current row or the insert
0N/A * row of this rowset, but it does not update the database.
0N/A * If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException {
0N/A updateBigDecimal(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>String</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateString(String columnName, String x) throws SQLException {
0N/A updateString(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>byte</code> array.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBytes(String columnName, byte x[]) throws SQLException {
0N/A updateBytes(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Date</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, (3) the type
0N/A * of the designated column is not an SQL <code>DATE</code> or
0N/A * <code>TIMESTAMP</code>, or (4) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateDate(String columnName, java.sql.Date x) throws SQLException {
0N/A updateDate(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Time</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, (3) the type
0N/A * of the designated column is not an SQL <code>TIME</code> or
0N/A * <code>TIMESTAMP</code>, or (4) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateTime(String columnName, java.sql.Time x) throws SQLException {
0N/A updateTime(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Timestamp</code> object.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if the given column index is out of bounds or
0N/A * the cursor is not on one of this rowset's rows or its
0N/A * insert row
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, (3) the type
0N/A * of the designated column is not an SQL <code>DATE</code>,
0N/A * <code>TIME</code>, or <code>TIMESTAMP</code>, or (4) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException {
0N/A updateTimestamp(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * ASCII stream value.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @param length the number of one-byte ASCII characters in the stream
0N/A */
0N/A public void updateAsciiStream(String columnName,
0N/A java.io.InputStream x,
0N/A int length) throws SQLException {
0N/A updateAsciiStream(getColIdxByName(columnName), x, length);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.io.InputStream</code> object.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value; must be a <code>java.io.InputStream</code>
0N/A * containing <code>BINARY</code>, <code>VARBINARY</code>, or
0N/A * <code>LONGVARBINARY</code> data
0N/A * @param length the length of the stream in bytes
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, (3) the data
0N/A * in the stream is not binary, or (4) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBinaryStream(String columnName, java.io.InputStream x, int length) throws SQLException {
0N/A updateBinaryStream(getColIdxByName(columnName), x, length);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.io.Reader</code> object.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param reader the new column value; must be a
0N/A * <code>java.io.Reader</code> containing <code>BINARY</code>,
0N/A * <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>,
0N/A * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> data
0N/A * @param length the length of the stream in characters
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, (3) the data
0N/A * in the stream is not a binary or character type, or (4) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateCharacterStream(String columnName,
0N/A java.io.Reader reader,
0N/A int length) throws SQLException {
0N/A updateCharacterStream(getColIdxByName(columnName), reader, length);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Object</code> value. The <code>scale</code> parameter
0N/A * indicates the number of digits to the right of the decimal point
0N/A * and is ignored if the new column value is not a type that will be
0N/A * mapped to an SQL <code>DECIMAL</code> or <code>NUMERIC</code> value.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @param scale the number of digits to the right of the decimal point (for
0N/A * <code>DECIMAL</code> and <code>NUMERIC</code> types only)
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateObject(String columnName, Object x, int scale) throws SQLException {
0N/A updateObject(getColIdxByName(columnName), x, scale);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Object</code> value.
0N/A * <P>
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param x the new column value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateObject(String columnName, Object x) throws SQLException {
0N/A updateObject(getColIdxByName(columnName), x);
0N/A }
0N/A
0N/A /**
0N/A * Inserts the contents of this <code>CachedRowSetImpl</code> object's insert
0N/A * row into this rowset immediately following the current row.
0N/A * If the current row is the
0N/A * position after the last row or before the first row, the new row will
0N/A * be inserted at the end of the rowset. This method also notifies
0N/A * listeners registered with this rowset that the row has changed.
0N/A * <P>
0N/A * The cursor must be on the insert row when this method is called.
0N/A *
0N/A * @throws SQLException if (1) the cursor is not on the insert row,
0N/A * (2) one or more of the non-nullable columns in the insert
0N/A * row has not been given a value, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void insertRow() throws SQLException {
0N/A int pos;
0N/A
0N/A if (onInsertRow == false ||
0N/A insertRow.isCompleteRow(RowSetMD) == false) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.failedins").toString());
0N/A }
0N/A // Added the setting of parameters that are passed
0N/A // to setXXX methods after an empty CRS Object is
0N/A // created through RowSetMetaData object
0N/A Object [] toInsert = getParams();
0N/A
0N/A for(int i = 0;i < toInsert.length; i++) {
0N/A insertRow.setColumnObject(i+1,toInsert[i]);
0N/A }
0N/A
0N/A Row insRow = new Row(RowSetMD.getColumnCount(),
0N/A insertRow.getOrigRow());
0N/A insRow.setInserted();
0N/A /*
0N/A * The new row is inserted into the RowSet
0N/A * immediately following the current row.
0N/A *
0N/A * If we are afterlast then the rows are
0N/A * inserted at the end.
0N/A */
0N/A if (currentRow >= numRows || currentRow < 0) {
0N/A pos = numRows;
0N/A } else {
0N/A pos = currentRow;
0N/A }
0N/A
0N/A rvh.add(pos, insRow);
0N/A ++numRows;
0N/A // notify the listeners that the row changed.
0N/A notifyRowChanged();
0N/A }
0N/A
0N/A /**
0N/A * Marks the current row of this <code>CachedRowSetImpl</code> object as
0N/A * updated and notifies listeners registered with this rowset that the
0N/A * row has changed.
0N/A * <P>
0N/A * This method cannot be called when the cursor is on the insert row, and
0N/A * it should be called before the cursor moves to another row. If it is
0N/A * called after the cursor moves to another row, this method has no effect,
0N/A * and the updates made before the cursor moved will be lost.
0N/A *
0N/A * @throws SQLException if the cursor is on the insert row or this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateRow() throws SQLException {
0N/A // make sure we aren't on the insert row
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.updateins").toString());
0N/A }
0N/A
0N/A ((Row)getCurrentRow()).setUpdated();
0N/A
0N/A // notify the listeners that the row changed.
0N/A notifyRowChanged();
0N/A }
0N/A
0N/A /**
0N/A * Deletes the current row from this <code>CachedRowSetImpl</code> object and
0N/A * notifies listeners registered with this rowset that a row has changed.
0N/A * This method cannot be called when the cursor is on the insert row.
0N/A * <P>
0N/A * This method marks the current row as deleted, but it does not delete
0N/A * the row from the underlying data source. The method
0N/A * <code>acceptChanges</code> must be called to delete the row in
0N/A * the data source.
0N/A *
0N/A * @throws SQLException if (1) this method is called when the cursor
0N/A * is on the insert row, before the first row, or after the
0N/A * last row or (2) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void deleteRow() throws SQLException {
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A ((Row)getCurrentRow()).setDeleted();
0N/A ++numDeleted;
0N/A
0N/A // notify the listeners that the row changed.
0N/A notifyRowChanged();
0N/A }
0N/A
0N/A /**
0N/A * Sets the current row with its original value and marks the row as
0N/A * not updated, thus undoing any changes made to the row since the
0N/A * last call to the methods <code>updateRow</code> or <code>deleteRow</code>.
0N/A * This method should be called only when the cursor is on a row in
0N/A * this rowset.
0N/A *
0N/A * @throws SQLException if the cursor is on the insert row, before the
0N/A * first row, or after the last row
0N/A */
0N/A public void refreshRow() throws SQLException {
0N/A // make sure we are on a row
0N/A checkCursor();
0N/A
0N/A // don't want this to happen...
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A
0N/A Row currentRow = (Row)getCurrentRow();
0N/A // just undo any changes made to this row.
0N/A currentRow.clearUpdated();
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Rolls back any updates made to the current row of this
0N/A * <code>CachedRowSetImpl</code> object and notifies listeners that
0N/A * a row has changed. To have an effect, this method
0N/A * must be called after an <code>updateXXX</code> method has been
0N/A * called and before the method <code>updateRow</code> has been called.
0N/A * If no updates have been made or the method <code>updateRow</code>
0N/A * has already been called, this method has no effect.
0N/A *
0N/A * @throws SQLException if the cursor is on the insert row, before the
0N/A * first row, or after the last row
0N/A */
0N/A public void cancelRowUpdates() throws SQLException {
0N/A // make sure we are on a row
0N/A checkCursor();
0N/A
0N/A // don't want this to happen...
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
0N/A }
0N/A
0N/A Row currentRow = (Row)getCurrentRow();
0N/A if (currentRow.getUpdated() == true) {
0N/A currentRow.clearUpdated();
0N/A notifyRowChanged();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Moves the cursor for this <code>CachedRowSetImpl</code> object
0N/A * to the insert row. The current row in the rowset is remembered
0N/A * while the cursor is on the insert row.
0N/A * <P>
0N/A * The insert row is a special row associated with an updatable
0N/A * rowset. It is essentially a buffer where a new row may
0N/A * be constructed by calling the appropriate <code>updateXXX</code>
0N/A * methods to assign a value to each column in the row. A complete
0N/A * row must be constructed; that is, every column that is not nullable
0N/A * must be assigned a value. In order for the new row to become part
0N/A * of this rowset, the method <code>insertRow</code> must be called
0N/A * before the cursor is moved back to the rowset.
0N/A * <P>
0N/A * Only certain methods may be invoked while the cursor is on the insert
0N/A * row; many methods throw an exception if they are called while the
0N/A * cursor is there. In addition to the <code>updateXXX</code>
0N/A * and <code>insertRow</code> methods, only the <code>getXXX</code> methods
0N/A * may be called when the cursor is on the insert row. A <code>getXXX</code>
0N/A * method should be called on a column only after an <code>updateXXX</code>
0N/A * method has been called on that column; otherwise, the value returned is
0N/A * undetermined.
0N/A *
0N/A * @throws SQLException if this <code>CachedRowSetImpl</code> object is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void moveToInsertRow() throws SQLException {
0N/A if (getConcurrency() == ResultSet.CONCUR_READ_ONLY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.movetoins").toString());
0N/A }
0N/A if (insertRow == null) {
0N/A if (RowSetMD == null)
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.movetoins1").toString());
0N/A int numCols = RowSetMD.getColumnCount();
0N/A if (numCols > 0) {
0N/A insertRow = new InsertRow(numCols);
0N/A } else {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.movetoins2").toString());
0N/A }
0N/A }
0N/A onInsertRow = true;
0N/A // %%% setCurrentRow called in BaseRow
0N/A
0N/A currentRow = cursorPos;
0N/A cursorPos = -1;
0N/A
0N/A insertRow.initInsertRow();
0N/A }
0N/A
0N/A /**
0N/A * Moves the cursor for this <code>CachedRowSetImpl</code> object to
0N/A * the current row. The current row is the row the cursor was on
0N/A * when the method <code>moveToInsertRow</code> was called.
0N/A * <P>
0N/A * Calling this method has no effect unless it is called while the
0N/A * cursor is on the insert row.
0N/A *
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public void moveToCurrentRow() throws SQLException {
0N/A if (onInsertRow == false) {
0N/A return;
0N/A } else {
0N/A cursorPos = currentRow;
0N/A onInsertRow = false;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Returns <code>null</code>.
0N/A *
0N/A * @return <code>null</code>
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public Statement getStatement() throws SQLException {
0N/A return null;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as an <code>Object</code> in
0N/A * the Java programming language, using the given
0N/A * <code>java.util.Map</code> object to custom map the value if
0N/A * appropriate.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param map a <code>java.util.Map</code> object showing the mapping
0N/A * from SQL type names to classes in the Java programming
0N/A * language
0N/A * @return an <code>Object</code> representing the SQL value
0N/A * @throws SQLException if the given column index is out of bounds or
0N/A * the cursor is not on one of this rowset's rows or its
0N/A * insert row
0N/A */
0N/A public Object getObject(int columnIndex,
0N/A java.util.Map<String,Class<?>> map)
0N/A throws SQLException
0N/A {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A if (value instanceof Struct) {
0N/A Struct s = (Struct)value;
0N/A
0N/A // look up the class in the map
0N/A Class c = (Class)map.get(s.getSQLTypeName());
0N/A if (c != null) {
0N/A // create new instance of the class
0N/A SQLData obj = null;
0N/A try {
0N/A obj = (SQLData)c.newInstance();
0N/A } catch (java.lang.InstantiationException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(),
0N/A ex.getMessage()));
0N/A } catch (java.lang.IllegalAccessException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.unableins").toString(),
0N/A ex.getMessage()));
0N/A }
0N/A // get the attributes from the struct
0N/A Object attribs[] = s.getAttributes(map);
0N/A // create the SQLInput "stream"
0N/A SQLInputImpl sqlInput = new SQLInputImpl(attribs, map);
0N/A // read the values...
0N/A obj.readSQL(sqlInput, s.getSQLTypeName());
0N/A return (Object)obj;
0N/A }
0N/A }
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>Ref</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @return a <code>Ref</code> object representing an SQL<code> REF</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>REF</code> value
0N/A * @see #getRef(String)
0N/A */
0N/A public Ref getRef(int columnIndex) throws SQLException {
0N/A Ref value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (RowSetMD.getColumnType(columnIndex) != java.sql.Types.REF) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A setLastValueNull(false);
0N/A value = (Ref)(getCurrentRow().getColumnObject(columnIndex));
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>Blob</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @return a <code>Blob</code> object representing an SQL <code>BLOB</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>BLOB</code> value
0N/A * @see #getBlob(String)
0N/A */
0N/A public Blob getBlob(int columnIndex) throws SQLException {
0N/A Blob value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (RowSetMD.getColumnType(columnIndex) != java.sql.Types.BLOB) {
0N/A System.out.println(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.type").toString(), RowSetMD.getColumnType(columnIndex)));
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A setLastValueNull(false);
0N/A value = (Blob)(getCurrentRow().getColumnObject(columnIndex));
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>Clob</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @return a <code>Clob</code> object representing an SQL <code>CLOB</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>CLOB</code> value
0N/A * @see #getClob(String)
0N/A */
0N/A public Clob getClob(int columnIndex) throws SQLException {
0N/A Clob value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (RowSetMD.getColumnType(columnIndex) != java.sql.Types.CLOB) {
0N/A System.out.println(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.type").toString(), RowSetMD.getColumnType(columnIndex)));
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A setLastValueNull(false);
0N/A value = (Clob)(getCurrentRow().getColumnObject(columnIndex));
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as an <code>Array</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @return an <code>Array</code> object representing an SQL
0N/A * <code>ARRAY</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>ARRAY</code> value
0N/A * @see #getArray(String)
0N/A */
0N/A public Array getArray(int columnIndex) throws SQLException {
0N/A java.sql.Array value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (RowSetMD.getColumnType(columnIndex) != java.sql.Types.ARRAY) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A setLastValueNull(false);
0N/A value = (java.sql.Array)(getCurrentRow().getColumnObject(columnIndex));
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as an <code>Object</code> in
0N/A * the Java programming language, using the given
0N/A * <code>java.util.Map</code> object to custom map the value if
0N/A * appropriate.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param map a <code>java.util.Map</code> object showing the mapping
0N/A * from SQL type names to classes in the Java programming
0N/A * language
0N/A * @return an <code>Object</code> representing the SQL value
0N/A * @throws SQLException if the given column name is not the name of
0N/A * a column in this rowset or the cursor is not on one of
0N/A * this rowset's rows or its insert row
0N/A */
0N/A public Object getObject(String columnName,
0N/A java.util.Map<String,Class<?>> map)
0N/A throws SQLException {
0N/A return getObject(getColIdxByName(columnName), map);
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>Ref</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param colName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return a <code>Ref</code> object representing an SQL<code> REF</code> value
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the column value
0N/A * is not an SQL <code>REF</code> value
0N/A * @see #getRef(int)
0N/A */
0N/A public Ref getRef(String colName) throws SQLException {
0N/A return getRef(getColIdxByName(colName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>Blob</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param colName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return a <code>Blob</code> object representing an SQL <code>BLOB</code> value
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>BLOB</code> value
0N/A * @see #getBlob(int)
0N/A */
0N/A public Blob getBlob(String colName) throws SQLException {
0N/A return getBlob(getColIdxByName(colName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>Clob</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param colName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return a <code>Clob</code> object representing an SQL
0N/A * <code>CLOB</code> value
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>CLOB</code> value
0N/A * @see #getClob(int)
0N/A */
0N/A public Clob getClob(String colName) throws SQLException {
0N/A return getClob(getColIdxByName(colName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as an <code>Array</code> object
0N/A * in the Java programming langugage.
0N/A *
0N/A * @param colName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @return an <code>Array</code> object representing an SQL
0N/A * <code>ARRAY</code> value
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>ARRAY</code> value
0N/A * @see #getArray(int)
0N/A */
0N/A public Array getArray(String colName) throws SQLException {
0N/A return getArray(getColIdxByName(colName));
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a <code>java.sql.Date</code>
0N/A * object, using the given <code>Calendar</code> object to construct an
0N/A * appropriate millisecond value for the date.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @param cal the <code>java.util.Calendar</code> object to use in
0N/A * constructing the date
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>DATE</code> or
0N/A * <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A value = convertTemporal(value,
0N/A RowSetMD.getColumnType(columnIndex),
0N/A java.sql.Types.DATE);
0N/A
0N/A // create a default calendar
0N/A Calendar defaultCal = Calendar.getInstance();
0N/A // set this Calendar to the time we have
0N/A defaultCal.setTime((java.util.Date)value);
0N/A
0N/A /*
0N/A * Now we can pull the pieces of the date out
0N/A * of the default calendar and put them into
0N/A * the user provided calendar
0N/A */
0N/A cal.set(Calendar.YEAR, defaultCal.get(Calendar.YEAR));
0N/A cal.set(Calendar.MONTH, defaultCal.get(Calendar.MONTH));
0N/A cal.set(Calendar.DAY_OF_MONTH, defaultCal.get(Calendar.DAY_OF_MONTH));
0N/A
0N/A /*
0N/A * This looks a little odd but it is correct -
0N/A * Calendar.getTime() returns a Date...
0N/A */
0N/A return new java.sql.Date(cal.getTime().getTime());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a <code>java.sql.Date</code>
0N/A * object, using the given <code>Calendar</code> object to construct an
0N/A * appropriate millisecond value for the date.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param cal the <code>java.util.Calendar</code> object to use in
0N/A * constructing the date
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>DATE</code> or
0N/A * <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Date getDate(String columnName, Calendar cal) throws SQLException {
0N/A return getDate(getColIdxByName(columnName), cal);
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a <code>java.sql.Time</code>
0N/A * object, using the given <code>Calendar</code> object to construct an
0N/A * appropriate millisecond value for the date.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @param cal the <code>java.util.Calendar</code> object to use in
0N/A * constructing the date
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TIME</code> or
0N/A * <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A value = convertTemporal(value,
0N/A RowSetMD.getColumnType(columnIndex),
0N/A java.sql.Types.TIME);
0N/A
0N/A // create a default calendar
0N/A Calendar defaultCal = Calendar.getInstance();
0N/A // set the time in the default calendar
0N/A defaultCal.setTime((java.util.Date)value);
0N/A
0N/A /*
0N/A * Now we can pull the pieces of the date out
0N/A * of the default calendar and put them into
0N/A * the user provided calendar
0N/A */
0N/A cal.set(Calendar.HOUR_OF_DAY, defaultCal.get(Calendar.HOUR_OF_DAY));
0N/A cal.set(Calendar.MINUTE, defaultCal.get(Calendar.MINUTE));
0N/A cal.set(Calendar.SECOND, defaultCal.get(Calendar.SECOND));
0N/A
0N/A return new java.sql.Time(cal.getTime().getTime());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a <code>java.sql.Time</code>
0N/A * object, using the given <code>Calendar</code> object to construct an
0N/A * appropriate millisecond value for the date.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param cal the <code>java.util.Calendar</code> object to use in
0N/A * constructing the date
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TIME</code> or
0N/A * <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Time getTime(String columnName, Calendar cal) throws SQLException {
0N/A return getTime(getColIdxByName(columnName), cal);
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a <code>java.sql.Timestamp</code>
0N/A * object, using the given <code>Calendar</code> object to construct an
0N/A * appropriate millisecond value for the date.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in the rowset
0N/A * @param cal the <code>java.util.Calendar</code> object to use in
0N/A * constructing the date
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>TIME</code> or
0N/A * <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
0N/A Object value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A setLastValueNull(false);
0N/A value = getCurrentRow().getColumnObject(columnIndex);
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A value = convertTemporal(value,
0N/A RowSetMD.getColumnType(columnIndex),
0N/A java.sql.Types.TIMESTAMP);
0N/A
0N/A // create a default calendar
0N/A Calendar defaultCal = Calendar.getInstance();
0N/A // set the time in the default calendar
0N/A defaultCal.setTime((java.util.Date)value);
0N/A
0N/A /*
0N/A * Now we can pull the pieces of the date out
0N/A * of the default calendar and put them into
0N/A * the user provided calendar
0N/A */
0N/A cal.set(Calendar.YEAR, defaultCal.get(Calendar.YEAR));
0N/A cal.set(Calendar.MONTH, defaultCal.get(Calendar.MONTH));
0N/A cal.set(Calendar.DAY_OF_MONTH, defaultCal.get(Calendar.DAY_OF_MONTH));
0N/A cal.set(Calendar.HOUR_OF_DAY, defaultCal.get(Calendar.HOUR_OF_DAY));
0N/A cal.set(Calendar.MINUTE, defaultCal.get(Calendar.MINUTE));
0N/A cal.set(Calendar.SECOND, defaultCal.get(Calendar.SECOND));
0N/A
0N/A return new java.sql.Timestamp(cal.getTime().getTime());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>CachedRowSetImpl</code> object as a
0N/A * <code>java.sql.Timestamp</code> object, using the given
0N/A * <code>Calendar</code> object to construct an appropriate
0N/A * millisecond value for the date.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param cal the <code>java.util.Calendar</code> object to use in
0N/A * constructing the date
0N/A * @return the column value; if the value is SQL <code>NULL</code>,
0N/A * the result is <code>null</code>
0N/A * @throws SQLException if (1) the given column name is not the name of
0N/A * a column in this rowset, (2) the cursor is not on one of
0N/A * this rowset's rows or its insert row, or (3) the designated
0N/A * column does not store an SQL <code>DATE</code>,
0N/A * <code>TIME</code>, or <code>TIMESTAMP</code> value
0N/A */
0N/A public java.sql.Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException {
0N/A return getTimestamp(getColIdxByName(columnName), cal);
0N/A }
0N/A
0N/A /*
0N/A * RowSetInternal Interface
0N/A */
0N/A
0N/A /**
0N/A * Retrieves the <code>Connection</code> object passed to this
0N/A * <code>CachedRowSetImpl</code> object. This connection may be
0N/A * used to populate this rowset with data or to write data back
0N/A * to its underlying data source.
0N/A *
0N/A * @return the <code>Connection</code> object passed to this rowset;
0N/A * may be <code>null</code> if there is no connection
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public Connection getConnection() throws SQLException{
0N/A return conn;
0N/A }
0N/A
0N/A /**
0N/A * Sets the metadata for this <code>CachedRowSetImpl</code> object
0N/A * with the given <code>RowSetMetaData</code> object.
0N/A *
0N/A * @param md a <code>RowSetMetaData</code> object instance containing
0N/A * metadata about the columsn in the rowset
0N/A * @throws SQLException if invalid meta data is supplied to the
0N/A * rowset
0N/A */
0N/A public void setMetaData(RowSetMetaData md) throws SQLException {
0N/A RowSetMD =(RowSetMetaDataImpl) md;
0N/A }
0N/A
0N/A /**
0N/A * Returns a result set containing the original value of the rowset. The
0N/A * original value is the state of the <code>CachedRowSetImpl</code> after the
0N/A * last population or synchronization (whichever occured most recently) with
0N/A * the data source.
0N/A * <p>
0N/A * The cursor is positioned before the first row in the result set.
0N/A * Only rows contained in the result set returned by <code>getOriginal()</code>
0N/A * are said to have an original value.
0N/A *
0N/A * @return the original result set of the rowset
0N/A * @throws SQLException if an error occurs produce the
0N/A * <code>ResultSet</code> object
0N/A */
0N/A public ResultSet getOriginal() throws SQLException {
0N/A CachedRowSetImpl crs = new CachedRowSetImpl();
0N/A crs.RowSetMD = RowSetMD;
0N/A crs.numRows = numRows;
0N/A crs.cursorPos = 0;
0N/A
0N/A // make sure we don't get someone playing with these
0N/A // %%% is this now necessary ???
0N/A //crs.setReader(null);
0N/A //crs.setWriter(null);
0N/A int colCount = RowSetMD.getColumnCount();
0N/A Row orig;
0N/A
0N/A for (Iterator i = rvh.iterator(); i.hasNext();) {
0N/A orig = new Row(colCount, ((Row)i.next()).getOrigRow());
0N/A crs.rvh.add(orig);
0N/A }
0N/A return (ResultSet)crs;
0N/A }
0N/A
0N/A /**
0N/A * Returns a result set containing the original value of the current
0N/A * row only.
0N/A * The original value is the state of the <code>CachedRowSetImpl</code> after
0N/A * the last population or synchronization (whichever occured most recently)
0N/A * with the data source.
0N/A *
0N/A * @return the original result set of the row
0N/A * @throws SQLException if there is no current row
0N/A * @see #setOriginalRow
0N/A */
0N/A public ResultSet getOriginalRow() throws SQLException {
0N/A CachedRowSetImpl crs = new CachedRowSetImpl();
0N/A crs.RowSetMD = RowSetMD;
0N/A crs.numRows = 1;
0N/A crs.cursorPos = 0;
2741N/A crs.setTypeMap(this.getTypeMap());
0N/A
0N/A // make sure we don't get someone playing with these
0N/A // %%% is this now necessary ???
0N/A //crs.setReader(null);
0N/A //crs.setWriter(null);
0N/A
0N/A Row orig = new Row(RowSetMD.getColumnCount(),
0N/A getCurrentRow().getOrigRow());
0N/A
0N/A crs.rvh.add(orig);
0N/A
0N/A return (ResultSet)crs;
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Marks the current row in this rowset as being an original row.
0N/A *
0N/A * @throws SQLException if there is no current row
0N/A * @see #getOriginalRow
0N/A */
0N/A public void setOriginalRow() throws SQLException {
0N/A if (onInsertRow == true) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidop").toString());
0N/A }
0N/A
0N/A Row row = (Row)getCurrentRow();
0N/A makeRowOriginal(row);
0N/A
0N/A // this can happen if deleted rows are being shown
0N/A if (row.getDeleted() == true) {
0N/A removeCurrentRow();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Makes the given row of this rowset the original row by clearing any
0N/A * settings that mark the row as having been inserted, deleted, or updated.
0N/A * This method is called internally by the methods
0N/A * <code>setOriginalRow</code>
0N/A * and <code>setOriginal</code>.
0N/A *
0N/A * @param row the row to be made the original row
0N/A */
0N/A private void makeRowOriginal(Row row) {
0N/A if (row.getInserted() == true) {
0N/A row.clearInserted();
0N/A }
0N/A
0N/A if (row.getUpdated() == true) {
0N/A row.moveCurrentToOrig();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Marks all rows in this rowset as being original rows. Any updates
0N/A * made to the rows become the original values for the rowset.
0N/A * Calls to the method <code>setOriginal</code> connot be reversed.
0N/A *
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public void setOriginal() throws SQLException {
0N/A for (Iterator i = rvh.iterator(); i.hasNext();) {
0N/A Row row = (Row)i.next();
0N/A makeRowOriginal(row);
0N/A // remove deleted rows from the collection.
0N/A if (row.getDeleted() == true) {
0N/A i.remove();
0N/A --numRows;
0N/A }
0N/A }
0N/A numDeleted = 0;
0N/A
0N/A // notify any listeners that the rowset has changed
0N/A notifyRowSetChanged();
0N/A }
0N/A
0N/A /**
0N/A * Returns an identifier for the object (table) that was used to create this
0N/A * rowset.
0N/A *
0N/A * @return a <code>String</code> object that identifies the table from
0N/A * which this <code>CachedRowSetImpl</code> object was derived
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public String getTableName() throws SQLException {
0N/A return tableName;
0N/A }
0N/A
0N/A /**
0N/A * Sets the identifier for the table from which this rowset was derived
0N/A * to the given table name.
0N/A *
0N/A * @param tabName a <code>String</code> object that identifies the
0N/A * table from which this <code>CachedRowSetImpl</code> object
0N/A * was derived
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A public void setTableName(String tabName) throws SQLException {
0N/A if (tabName == null)
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.tablename").toString());
0N/A else
2823N/A tableName = tabName;
0N/A }
0N/A
0N/A /**
0N/A * Returns the columns that make a key to uniquely identify a
0N/A * row in this <code>CachedRowSetImpl</code> object.
0N/A *
0N/A * @return an array of column numbers that constitutes a primary
0N/A * key for this rowset. This array should be empty
0N/A * if no column is representitive of a primary key
0N/A * @throws SQLException if the rowset is empty or no columns
0N/A * are designated as primary keys
0N/A * @see #setKeyColumns
0N/A */
0N/A public int[] getKeyColumns() throws SQLException {
0N/A return keyCols;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets this <code>CachedRowSetImpl</code> object's
0N/A * <code>keyCols</code> field with the given array of column
0N/A * numbers, which forms a key for uniquely identifying a row
0N/A * in this rowset.
0N/A *
0N/A * @param keys an array of <code>int</code> indicating the
0N/A * columns that form a primary key for this
0N/A * <code>CachedRowSetImpl</code> object; every
0N/A * element in the array must be greater than
0N/A * <code>0</code> and less than or equal to the number
0N/A * of columns in this rowset
0N/A * @throws SQLException if any of the numbers in the
0N/A * given array is not valid for this rowset
0N/A * @see #getKeyColumns
0N/A */
0N/A public void setKeyColumns(int [] keys) throws SQLException {
0N/A int numCols = 0;
0N/A if (RowSetMD != null) {
0N/A numCols = RowSetMD.getColumnCount();
0N/A if (keys.length > numCols)
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.keycols").toString());
0N/A }
0N/A keyCols = new int[keys.length];
0N/A for (int i = 0; i < keys.length; i++) {
0N/A if (RowSetMD != null && (keys[i] <= 0 ||
0N/A keys[i] > numCols)) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcol").toString() +
0N/A keys[i]);
0N/A }
0N/A keyCols[i] = keys[i];
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>Ref</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param ref the new column <code>java.sql.Ref</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateRef(int columnIndex, java.sql.Ref ref) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A // SerialClob will help in getting the byte array and storing it.
0N/A // We need to be checking DatabaseMetaData.locatorsUpdatorCopy()
0N/A // or through RowSetMetaData.locatorsUpdatorCopy()
0N/A getCurrentRow().setColumnObject(columnIndex, new SerialRef(ref));
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>double</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param ref the new column <code>java.sql.Ref</code> value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateRef(String columnName, java.sql.Ref ref) throws SQLException {
0N/A updateRef(getColIdxByName(columnName), ref);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>double</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param c the new column <code>Clob</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateClob(int columnIndex, Clob c) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A // SerialClob will help in getting the byte array and storing it.
0N/A // We need to be checking DatabaseMetaData.locatorsUpdatorCopy()
0N/A // or through RowSetMetaData.locatorsUpdatorCopy()
0N/A
0N/A if(dbmslocatorsUpdateCopy){
0N/A getCurrentRow().setColumnObject(columnIndex, new SerialClob(c));
0N/A }
0N/A else{
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.opnotsupp").toString());
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>double</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param c the new column <code>Clob</code> value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateClob(String columnName, Clob c) throws SQLException {
0N/A updateClob(getColIdxByName(columnName), c);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.sql.Blob</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param b the new column <code>Blob</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBlob(int columnIndex, Blob b) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A // SerialBlob will help in getting the byte array and storing it.
0N/A // We need to be checking DatabaseMetaData.locatorsUpdatorCopy()
0N/A // or through RowSetMetaData.locatorsUpdatorCopy()
0N/A
0N/A if(dbmslocatorsUpdateCopy){
0N/A getCurrentRow().setColumnObject(columnIndex, new SerialBlob(b));
0N/A }
0N/A else{
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.opnotsupp").toString());
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.sql.Blob </code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param b the new column <code>Blob</code> value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateBlob(String columnName, Blob b) throws SQLException {
0N/A updateBlob(getColIdxByName(columnName), b);
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.sql.Array</code> values.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnIndex the first column is <code>1</code>, the second
0N/A * is <code>2</code>, and so on; must be <code>1</code> or larger
0N/A * and equal to or less than the number of columns in this rowset
0N/A * @param a the new column <code>Array</code> value
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) this rowset is
0N/A * <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateArray(int columnIndex, Array a) throws SQLException {
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A // SerialArray will help in getting the byte array and storing it.
0N/A // We need to be checking DatabaseMetaData.locatorsUpdatorCopy()
0N/A // or through RowSetMetaData.locatorsUpdatorCopy()
0N/A getCurrentRow().setColumnObject(columnIndex, new SerialArray(a));
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated column in either the current row or the insert
0N/A * row of this <code>CachedRowSetImpl</code> object with the given
0N/A * <code>java.sql.Array</code> value.
0N/A *
0N/A * This method updates a column value in either the current row or
0N/A * the insert row of this rowset, but it does not update the
0N/A * database. If the cursor is on a row in the rowset, the
0N/A * method {@link #updateRow} must be called to update the database.
0N/A * If the cursor is on the insert row, the method {@link #insertRow}
0N/A * must be called, which will insert the new row into both this rowset
0N/A * and the database. Both of these methods must be called before the
0N/A * cursor moves to another row.
0N/A *
0N/A * @param columnName a <code>String</code> object that must match the
0N/A * SQL name of a column in this rowset, ignoring case
0N/A * @param a the new column <code>Array</code> value
0N/A * @throws SQLException if (1) the given column name does not match the
0N/A * name of a column in this rowset, (2) the cursor is not on
0N/A * one of this rowset's rows or its insert row, or (3) this
0N/A * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
0N/A */
0N/A public void updateArray(String columnName, Array a) throws SQLException {
0N/A updateArray(getColIdxByName(columnName), a);
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>java.net.URL</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @return a java.net.URL object containing the resource reference described by
0N/A * the URL
0N/A * @throws SQLException if (1) the given column index is out of bounds,
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>DATALINK</code> value.
0N/A * @see #getURL(String)
0N/A */
0N/A public java.net.URL getURL(int columnIndex) throws SQLException {
0N/A //throw new SQLException("Operation not supported");
0N/A
0N/A java.net.URL value;
0N/A
0N/A // sanity check.
0N/A checkIndex(columnIndex);
0N/A // make sure the cursor is on a valid row
0N/A checkCursor();
0N/A
0N/A if (RowSetMD.getColumnType(columnIndex) != java.sql.Types.DATALINK) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
0N/A }
0N/A
0N/A setLastValueNull(false);
0N/A value = (java.net.URL)(getCurrentRow().getColumnObject(columnIndex));
0N/A
0N/A // check for SQL NULL
0N/A if (value == null) {
0N/A setLastValueNull(true);
0N/A return null;
0N/A }
0N/A
0N/A return value;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in this
0N/A * <code>CachedRowSetImpl</code> object as a <code>java.net.URL</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @return a java.net.URL object containing the resource reference described by
0N/A * the URL
0N/A * @throws SQLException if (1) the given column name not the name of a column
0N/A * in this rowset, or
0N/A * (2) the cursor is not on one of this rowset's rows or its
0N/A * insert row, or (3) the designated column does not store an
0N/A * SQL <code>DATALINK</code> value.
0N/A * @see #getURL(int)
0N/A */
0N/A public java.net.URL getURL(String columnName) throws SQLException {
0N/A return getURL(getColIdxByName(columnName));
0N/A
0N/A }
0N/A
0N/A /**
0N/A * The first warning reported by calls on this <code>CachedRowSetImpl</code>
0N/A * object is returned. Subsequent <code>CachedRowSetImpl</code> warnings will
0N/A * be chained to this <code>SQLWarning</code>. All <code>RowSetWarnings</code>
0N/A * warnings are generated in the disconnected environment and remain a
0N/A * seperate warning chain to that provided by the <code>getWarnings</code>
0N/A * method.
0N/A *
0N/A * <P>The warning chain is automatically cleared each time a new
0N/A * row is read.
0N/A *
0N/A * <P><B>Note:</B> This warning chain only covers warnings caused
0N/A * by <code>CachedRowSet</code> (and their child interface)
0N/A * methods. All <code>SQLWarnings</code> can be obtained using the
0N/A * <code>getWarnings</code> method which tracks warnings generated
0N/A * by the underlying JDBC driver.
0N/A * @return the first SQLWarning or null
0N/A *
0N/A */
0N/A public RowSetWarning getRowSetWarnings() {
0N/A try {
0N/A notifyCursorMoved();
0N/A } catch (SQLException e) {} // mask exception
0N/A return rowsetWarning;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * The function tries to isolate the tablename when only setCommand
0N/A * is set and not setTablename is called provided there is only one table
0N/A * name in the query else just leaves the setting of table name as such.
0N/A * If setTablename is set later it will over ride this table name
0N/A * value so retrieved.
0N/A *
0N/A * @return the tablename if only one table in query else return ""
0N/A */
0N/A private String buildTableName(String command) throws SQLException {
0N/A
0N/A // If we have a query from one table,
0N/A // we set the table name implicitly
0N/A // else user has to explicitly set the table name.
0N/A
0N/A int indexFrom, indexComma;
0N/A String strTablename ="";
0N/A command = command.trim();
0N/A
0N/A // Query can be a select, insert or update
0N/A
0N/A if(command.toLowerCase().startsWith("select")) {
0N/A // look for "from" keyword, after that look for a
0N/A // comma after from. If comma is there don't set
0N/A // table name else isolate table name.
0N/A
0N/A indexFrom = command.toLowerCase().indexOf("from");
0N/A indexComma = command.indexOf(",", indexFrom);
0N/A
0N/A if(indexComma == -1) {
0N/A // implies only one table
0N/A strTablename = (command.substring(indexFrom+"from".length(),command.length())).trim();
0N/A
0N/A String tabName = strTablename;
0N/A
0N/A int idxWhere = tabName.toLowerCase().indexOf("where");
0N/A
0N/A /**
0N/A * Adding the addtional check for conditions following the table name.
0N/A * If a condition is found truncate it.
0N/A **/
0N/A
0N/A if(idxWhere != -1)
0N/A {
0N/A tabName = tabName.substring(0,idxWhere).trim();
0N/A }
0N/A
0N/A strTablename = tabName;
0N/A
0N/A } else {
0N/A //strTablename="";
0N/A }
0N/A
0N/A } else if(command.toLowerCase().startsWith("insert")) {
0N/A //strTablename="";
0N/A } else if(command.toLowerCase().startsWith("update")) {
0N/A //strTablename="";
0N/A }
0N/A return strTablename;
0N/A }
0N/A
0N/A /**
0N/A * Commits all changes performed by the <code>acceptChanges()</code>
0N/A * methods
0N/A *
0N/A * @see java.sql.Connection#commit
0N/A */
0N/A public void commit() throws SQLException {
0N/A conn.commit();
0N/A }
0N/A
0N/A /**
0N/A * Rolls back all changes performed by the <code>acceptChanges()</code>
0N/A * methods
0N/A *
0N/A * @see java.sql.Connection#rollback
0N/A */
0N/A public void rollback() throws SQLException {
0N/A conn.rollback();
0N/A }
0N/A
0N/A /**
0N/A * Rolls back all changes performed by the <code>acceptChanges()</code>
0N/A * to the last <code>Savepoint</code> transaction marker.
0N/A *
0N/A * @see java.sql.Connection#rollback(Savepoint)
0N/A */
0N/A public void rollback(Savepoint s) throws SQLException {
0N/A conn.rollback(s);
0N/A }
0N/A
0N/A /**
0N/A * Unsets the designated parameter to the given int array.
0N/A * This was set using <code>setMatchColumn</code>
0N/A * as the column which will form the basis of the join.
0N/A * <P>
0N/A * The parameter value unset by this method should be same
0N/A * as was set.
0N/A *
0N/A * @param columnIdxes the index into this rowset
0N/A * object's internal representation of parameter values
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds or if the columnIdx is
0N/A * not the same as set using <code>setMatchColumn(int [])</code>
0N/A */
0N/A public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
0N/A
0N/A int i_val;
0N/A for( int j= 0 ;j < columnIdxes.length; j++) {
0N/A i_val = (Integer.parseInt(iMatchColumns.get(j).toString()));
0N/A if(columnIdxes[j] != i_val) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols").toString());
0N/A }
0N/A }
0N/A
0N/A for( int i = 0;i < columnIdxes.length ;i++) {
2828N/A iMatchColumns.set(i,Integer.valueOf(-1));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Unsets the designated parameter to the given String array.
0N/A * This was set using <code>setMatchColumn</code>
0N/A * as the column which will form the basis of the join.
0N/A * <P>
0N/A * The parameter value unset by this method should be same
0N/A * as was set.
0N/A *
0N/A * @param columnIdxes the index into this rowset
0N/A * object's internal representation of parameter values
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds or if the columnName is
0N/A * not the same as set using <code>setMatchColumn(String [])</code>
0N/A */
0N/A public void unsetMatchColumn(String[] columnIdxes) throws SQLException {
0N/A
0N/A for(int j = 0 ;j < columnIdxes.length; j++) {
0N/A if( !columnIdxes[j].equals(strMatchColumns.get(j)) ){
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols").toString());
0N/A }
0N/A }
0N/A
0N/A for(int i = 0 ; i < columnIdxes.length; i++) {
0N/A strMatchColumns.set(i,null);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the column name as <code>String</code> array
0N/A * that was set using <code>setMatchColumn(String [])</code>
0N/A * for this rowset.
0N/A *
0N/A * @return a <code>String</code> array object that contains the column names
0N/A * for the rowset which has this the match columns
0N/A *
0N/A * @throws SQLException if an error occurs or column name is not set
0N/A */
0N/A public String[] getMatchColumnNames() throws SQLException {
0N/A
0N/A String []str_temp = new String[strMatchColumns.size()];
0N/A
0N/A if( strMatchColumns.get(0) == null) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString());
0N/A }
0N/A
0N/A strMatchColumns.copyInto(str_temp);
0N/A return str_temp;
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the column id as <code>int</code> array that was set using
0N/A * <code>setMatchColumn(int [])</code> for this rowset.
0N/A *
0N/A * @return a <code>int</code> array object that contains the column ids
0N/A * for the rowset which has this as the match columns.
0N/A *
0N/A * @throws SQLException if an error occurs or column index is not set
0N/A */
0N/A public int[] getMatchColumnIndexes() throws SQLException {
0N/A
0N/A Integer []int_temp = new Integer[iMatchColumns.size()];
0N/A int [] i_temp = new int[iMatchColumns.size()];
0N/A int i_val;
0N/A
0N/A i_val = ((Integer)iMatchColumns.get(0)).intValue();
0N/A
0N/A if( i_val == -1 ) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString());
0N/A }
0N/A
0N/A
0N/A iMatchColumns.copyInto(int_temp);
0N/A
0N/A for(int i = 0; i < int_temp.length; i++) {
0N/A i_temp[i] = (int_temp[i]).intValue();
0N/A }
0N/A
0N/A return i_temp;
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given int array.
0N/A * This forms the basis of the join for the
0N/A * <code>JoinRowSet</code> as the column which will form the basis of the
0N/A * join.
0N/A * <P>
0N/A * The parameter value set by this method is stored internally and
0N/A * will be supplied as the appropriate parameter in this rowset's
0N/A * command when the method <code>getMatchColumnIndexes</code> is called.
0N/A *
0N/A * @param columnIdxes the indexes into this rowset
0N/A * object's internal representation of parameter values; the
0N/A * first parameter is 0, the second is 1, and so on; must be
0N/A * <code>0</code> or greater
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds
0N/A */
0N/A public void setMatchColumn(int[] columnIdxes) throws SQLException {
0N/A
0N/A for(int j = 0 ; j < columnIdxes.length; j++) {
0N/A if( columnIdxes[j] < 0 ) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
0N/A }
0N/A }
0N/A for(int i = 0 ;i < columnIdxes.length; i++) {
2828N/A iMatchColumns.add(i,Integer.valueOf(columnIdxes[i]));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given String array.
0N/A * This forms the basis of the join for the
0N/A * <code>JoinRowSet</code> as the column which will form the basis of the
0N/A * join.
0N/A * <P>
0N/A * The parameter value set by this method is stored internally and
0N/A * will be supplied as the appropriate parameter in this rowset's
0N/A * command when the method <code>getMatchColumn</code> is called.
0N/A *
0N/A * @param columnNames the name of the column into this rowset
0N/A * object's internal representation of parameter values
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds
0N/A */
0N/A public void setMatchColumn(String[] columnNames) throws SQLException {
0N/A
0N/A for(int j = 0; j < columnNames.length; j++) {
0N/A if( columnNames[j] == null || columnNames[j].equals("")) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString());
0N/A }
0N/A }
0N/A for( int i = 0; i < columnNames.length; i++) {
0N/A strMatchColumns.add(i,columnNames[i]);
0N/A }
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>int</code>
0N/A * object. This forms the basis of the join for the
0N/A * <code>JoinRowSet</code> as the column which will form the basis of the
0N/A * join.
0N/A * <P>
0N/A * The parameter value set by this method is stored internally and
0N/A * will be supplied as the appropriate parameter in this rowset's
0N/A * command when the method <code>getMatchColumn</code> is called.
0N/A *
0N/A * @param columnIdx the index into this rowset
0N/A * object's internal representation of parameter values; the
0N/A * first parameter is 0, the second is 1, and so on; must be
0N/A * <code>0</code> or greater
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds
0N/A */
0N/A public void setMatchColumn(int columnIdx) throws SQLException {
0N/A // validate, if col is ok to be set
0N/A if(columnIdx < 0) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
0N/A } else {
0N/A // set iMatchColumn
2828N/A iMatchColumns.set(0, Integer.valueOf(columnIdx));
0N/A //strMatchColumn = null;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>String</code>
0N/A * object. This forms the basis of the join for the
0N/A * <code>JoinRowSet</code> as the column which will form the basis of the
0N/A * join.
0N/A * <P>
0N/A * The parameter value set by this method is stored internally and
0N/A * will be supplied as the appropriate parameter in this rowset's
0N/A * command when the method <code>getMatchColumn</code> is called.
0N/A *
0N/A * @param columnName the name of the column into this rowset
0N/A * object's internal representation of parameter values
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds
0N/A */
0N/A public void setMatchColumn(String columnName) throws SQLException {
0N/A // validate, if col is ok to be set
2828N/A if(columnName == null || (columnName= columnName.trim()).equals("") ) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString());
0N/A } else {
0N/A // set strMatchColumn
0N/A strMatchColumns.set(0, columnName);
0N/A //iMatchColumn = -1;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Unsets the designated parameter to the given <code>int</code>
0N/A * object. This was set using <code>setMatchColumn</code>
0N/A * as the column which will form the basis of the join.
0N/A * <P>
0N/A * The parameter value unset by this method should be same
0N/A * as was set.
0N/A *
0N/A * @param columnIdx the index into this rowset
0N/A * object's internal representation of parameter values
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds or if the columnIdx is
0N/A * not the same as set using <code>setMatchColumn(int)</code>
0N/A */
0N/A public void unsetMatchColumn(int columnIdx) throws SQLException {
0N/A // check if we are unsetting the SAME column
2828N/A if(! iMatchColumns.get(0).equals(Integer.valueOf(columnIdx) ) ) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
0N/A } else if(strMatchColumns.get(0) != null) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch1").toString());
0N/A } else {
0N/A // that is, we are unsetting it.
2828N/A iMatchColumns.set(0, Integer.valueOf(-1));
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Unsets the designated parameter to the given <code>String</code>
0N/A * object. This was set using <code>setMatchColumn</code>
0N/A * as the column which will form the basis of the join.
0N/A * <P>
0N/A * The parameter value unset by this method should be same
0N/A * as was set.
0N/A *
0N/A * @param columnName the index into this rowset
0N/A * object's internal representation of parameter values
0N/A * @throws SQLException if an error occurs or the
0N/A * parameter index is out of bounds or if the columnName is
0N/A * not the same as set using <code>setMatchColumn(String)</code>
0N/A */
0N/A public void unsetMatchColumn(String columnName) throws SQLException {
0N/A // check if we are unsetting the same column
0N/A columnName = columnName.trim();
0N/A
0N/A if(!((strMatchColumns.get(0)).equals(columnName))) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
0N/A } else if( ((Integer)(iMatchColumns.get(0))).intValue() > 0) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch2").toString());
0N/A } else {
0N/A strMatchColumns.set(0, null); // that is, we are unsetting it.
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Notifies registered listeners that a RowSet object in the given RowSetEvent
0N/A * object has populated a number of additional rows. The <code>numRows</code> parameter
0N/A * ensures that this event will only be fired every <code>numRow</code>.
0N/A * <p>
0N/A * The source of the event can be retrieved with the method event.getSource.
0N/A *
0N/A * @param event a <code>RowSetEvent</code> object that contains the
0N/A * <code>RowSet</code> object that is the source of the events
0N/A * @param numRows when populating, the number of rows interval on which the
0N/A * <code>CachedRowSet</code> populated should fire; the default value
0N/A * is zero; cannot be less than <code>fetchSize</code> or zero
0N/A */
0N/A public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
0N/A
0N/A if( numRows < 0 || numRows < getFetchSize()) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.numrows").toString());
0N/A }
0N/A
0N/A if(size() % numRows == 0) {
0N/A RowSetEvent event_temp = new RowSetEvent(this);
0N/A event = event_temp;
0N/A notifyRowSetChanged();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Populates this <code>CachedRowSet</code> object with data from
0N/A * the given <code>ResultSet</code> object. While related to the <code>populate(ResultSet)</code>
0N/A * method, an additional parameter is provided to allow starting position within
0N/A * the <code>ResultSet</code> from where to populate the CachedRowSet
0N/A * instance.
0N/A *
0N/A * This method is an alternative to the method <code>execute</code>
0N/A * for filling the rowset with data. The method <code>populate</code>
0N/A * does not require that the properties needed by the method
0N/A * <code>execute</code>, such as the <code>command</code> property,
0N/A * be set. This is true because the method <code>populate</code>
0N/A * is given the <code>ResultSet</code> object from
0N/A * which to get data and thus does not need to use the properties
0N/A * required for setting up a connection and executing this
0N/A * <code>CachedRowSetImpl</code> object's command.
0N/A * <P>
0N/A * After populating this rowset with data, the method
0N/A * <code>populate</code> sets the rowset's metadata and
0N/A * then sends a <code>RowSetChangedEvent</code> object
0N/A * to all registered listeners prior to returning.
0N/A *
0N/A * @param data the <code>ResultSet</code> object containing the data
0N/A * to be read into this <code>CachedRowSetImpl</code> object
0N/A * @param start the integer specifing the position in the
0N/A * <code>ResultSet</code> object to popultate the
0N/A * <code>CachedRowSetImpl</code> object.
0N/A * @throws SQLException if an error occurs; or the max row setting is
0N/A * violated while populating the RowSet.Also id the start position
0N/A * is negative.
0N/A * @see #execute
0N/A */
0N/A public void populate(ResultSet data, int start) throws SQLException{
0N/A
0N/A int rowsFetched;
0N/A Row currentRow;
0N/A int numCols;
0N/A int i;
3999N/A Map<String, Class<?>> map = getTypeMap();
0N/A Object obj;
0N/A int mRows;
0N/A
0N/A cursorPos = 0;
0N/A if(populatecallcount == 0){
0N/A if(start < 0){
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.startpos").toString());
0N/A }
0N/A if(getMaxRows() == 0){
0N/A data.absolute(start);
0N/A while(data.next()){
0N/A totalRows++;
0N/A }
0N/A totalRows++;
0N/A }
0N/A startPos = start;
0N/A }
0N/A populatecallcount = populatecallcount +1;
0N/A resultSet = data;
0N/A if((endPos - startPos) >= getMaxRows() && (getMaxRows() > 0)){
0N/A endPos = prevEndPos;
0N/A pagenotend = false;
0N/A return;
0N/A }
0N/A
0N/A if((maxRowsreached != getMaxRows() || maxRowsreached != totalRows) && pagenotend) {
0N/A startPrev = start - getPageSize();
0N/A }
0N/A
0N/A if( pageSize == 0){
0N/A prevEndPos = endPos;
0N/A endPos = start + getMaxRows() ;
0N/A }
0N/A else{
0N/A prevEndPos = endPos;
0N/A endPos = start + getPageSize();
0N/A }
0N/A
0N/A
0N/A if (start == 1){
0N/A resultSet.beforeFirst();
0N/A }
0N/A else {
0N/A resultSet.absolute(start -1);
0N/A }
0N/A if( pageSize == 0) {
3999N/A rvh = new Vector<Object>(getMaxRows());
0N/A
0N/A }
0N/A else{
3999N/A rvh = new Vector<Object>(getPageSize());
0N/A }
0N/A
0N/A if (data == null) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.populate").toString());
0N/A }
0N/A
0N/A // get the meta data for this ResultSet
0N/A RSMD = data.getMetaData();
0N/A
0N/A // set up the metadata
0N/A RowSetMD = new RowSetMetaDataImpl();
0N/A initMetaData(RowSetMD, RSMD);
0N/A
0N/A // release the meta-data so that aren't tempted to use it.
0N/A RSMD = null;
0N/A numCols = RowSetMD.getColumnCount();
0N/A mRows = this.getMaxRows();
0N/A rowsFetched = 0;
0N/A currentRow = null;
0N/A
0N/A if(!data.next() && mRows == 0){
0N/A endPos = prevEndPos;
0N/A pagenotend = false;
0N/A return;
0N/A }
0N/A
0N/A data.previous();
0N/A
0N/A while ( data.next()) {
0N/A
0N/A currentRow = new Row(numCols);
0N/A if(pageSize == 0){
0N/A if ( rowsFetched >= mRows && mRows > 0) {
0N/A rowsetWarning.setNextException(new SQLException("Populating rows "
0N/A + "setting has exceeded max row setting"));
0N/A break;
0N/A }
0N/A }
0N/A else {
0N/A if ( (rowsFetched >= pageSize) ||( maxRowsreached >= mRows && mRows > 0)) {
0N/A rowsetWarning.setNextException(new SQLException("Populating rows "
0N/A + "setting has exceeded max row setting"));
0N/A break;
0N/A }
0N/A }
0N/A
0N/A for ( i = 1; i <= numCols; i++) {
0N/A /*
0N/A * check if the user has set a map. If no map
0N/A * is set then use plain getObject. This lets
0N/A * us work with drivers that do not support
0N/A * getObject with a map in fairly sensible way
0N/A */
0N/A if (map == null) {
0N/A obj = data.getObject(i);
0N/A } else {
0N/A obj = data.getObject(i, map);
0N/A }
0N/A /*
0N/A * the following block checks for the various
0N/A * types that we have to serialize in order to
0N/A * store - right now only structs have been tested
0N/A */
0N/A if (obj instanceof Struct) {
0N/A obj = new SerialStruct((Struct)obj, map);
0N/A } else if (obj instanceof SQLData) {
0N/A obj = new SerialStruct((SQLData)obj, map);
0N/A } else if (obj instanceof Blob) {
0N/A obj = new SerialBlob((Blob)obj);
0N/A } else if (obj instanceof Clob) {
0N/A obj = new SerialClob((Clob)obj);
0N/A } else if (obj instanceof java.sql.Array) {
0N/A obj = new SerialArray((java.sql.Array)obj, map);
0N/A }
0N/A
0N/A ((Row)currentRow).initColumnObject(i, obj);
0N/A }
0N/A rowsFetched++;
0N/A maxRowsreached++;
0N/A rvh.add(currentRow);
0N/A }
0N/A numRows = rowsFetched ;
0N/A // Also rowsFetched should be equal to rvh.size()
0N/A // notify any listeners that the rowset has changed
0N/A notifyRowSetChanged();
0N/A
0N/A }
0N/A
0N/A /**
0N/A * The nextPage gets the next page, that is a <code>CachedRowSetImpl</code> object
0N/A * containing the number of rows specified by page size.
0N/A * @return boolean value true indicating whether there are more pages to come and
0N/A * false indicating that this is the last page.
0N/A * @throws SQLException if an error occurs or this called before calling populate.
0N/A */
0N/A public boolean nextPage() throws SQLException {
0N/A
0N/A if (populatecallcount == 0){
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.nextpage").toString());
0N/A }
0N/A // Fix for 6554186
0N/A onFirstPage = false;
0N/A if(callWithCon){
0N/A crsReader.setStartPosition(endPos);
0N/A crsReader.readData((RowSetInternal)this);
0N/A resultSet = null;
0N/A }
0N/A else {
0N/A populate(resultSet,endPos);
0N/A }
0N/A return pagenotend;
0N/A }
0N/A
0N/A /**
0N/A * This is the setter function for setting the size of the page, which specifies
0N/A * how many rows have to be retrived at a time.
0N/A *
0N/A * @param size which is the page size
0N/A * @throws SQLException if size is less than zero or greater than max rows.
0N/A */
0N/A public void setPageSize (int size) throws SQLException {
0N/A if (size < 0) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.pagesize").toString());
0N/A }
0N/A if (size > getMaxRows() && getMaxRows() != 0) {
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.pagesize1").toString());
0N/A }
0N/A pageSize = size;
0N/A }
0N/A
0N/A /**
0N/A * This is the getter function for the size of the page.
0N/A *
0N/A * @return an integer that is the page size.
0N/A */
0N/A public int getPageSize() {
0N/A return pageSize;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the data present in the page prior to the page from where it is
0N/A * called.
0N/A * @return boolean value true if it retrieves the previous page, flase if it
0N/A * is on the first page.
0N/A * @throws SQLException if it is called before populate is called or ResultSet
0N/A * is of type <code>ResultSet.TYPE_FORWARD_ONLY</code> or if an error
0N/A * occurs.
0N/A */
0N/A public boolean previousPage() throws SQLException {
0N/A int pS;
0N/A int mR;
0N/A int rem;
0N/A
0N/A pS = getPageSize();
0N/A mR = maxRowsreached;
0N/A
0N/A if (populatecallcount == 0){
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.nextpage").toString());
0N/A }
0N/A
0N/A if( !callWithCon){
0N/A if(resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY){
0N/A throw new SQLException (resBundle.handleGetObject("cachedrowsetimpl.fwdonly").toString());
0N/A }
0N/A }
0N/A
0N/A pagenotend = true;
0N/A
0N/A if(startPrev < startPos ){
0N/A onFirstPage = true;
0N/A return false;
0N/A }
0N/A
0N/A if(onFirstPage){
0N/A return false;
0N/A }
0N/A
0N/A rem = mR % pS;
0N/A
0N/A if(rem == 0){
0N/A maxRowsreached -= (2 * pS);
0N/A if(callWithCon){
0N/A crsReader.setStartPosition(startPrev);
0N/A crsReader.readData((RowSetInternal)this);
0N/A resultSet = null;
0N/A }
0N/A else {
0N/A populate(resultSet,startPrev);
0N/A }
0N/A return true;
0N/A }
0N/A else
0N/A {
0N/A maxRowsreached -= (pS + rem);
0N/A if(callWithCon){
0N/A crsReader.setStartPosition(startPrev);
0N/A crsReader.readData((RowSetInternal)this);
0N/A resultSet = null;
0N/A }
0N/A else {
0N/A populate(resultSet,startPrev);
0N/A }
0N/A return true;
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Goes to the page number passed as the parameter
0N/A * @param page , the page loaded on a call to this function
0N/A * @return true if the page exists false otherwise
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A /*
0N/A public boolean absolutePage(int page) throws SQLException{
0N/A
0N/A boolean isAbs = true, retVal = true;
0N/A int counter;
0N/A
0N/A if( page <= 0 ){
0N/A throw new SQLException("Absolute positoin is invalid");
0N/A }
0N/A counter = 0;
0N/A
0N/A firstPage();
0N/A counter++;
0N/A while((counter < page) && isAbs) {
0N/A isAbs = nextPage();
0N/A counter ++;
0N/A }
0N/A
0N/A if( !isAbs && counter < page){
0N/A retVal = false;
0N/A }
0N/A else if(counter == page){
0N/A retVal = true;
0N/A }
0N/A
0N/A return retVal;
0N/A }
0N/A */
0N/A
0N/A
0N/A /**
0N/A * Goes to the page number passed as the parameter from the current page.
0N/A * The parameter can take postive or negative value accordingly.
0N/A * @param page , the page loaded on a call to this function
0N/A * @return true if the page exists false otherwise
0N/A * @throws SQLException if an error occurs
0N/A */
0N/A /*
0N/A public boolean relativePage(int page) throws SQLException {
0N/A
0N/A boolean isRel = true,retVal = true;
0N/A int counter;
0N/A
0N/A if(page > 0){
0N/A counter = 0;
0N/A while((counter < page) && isRel){
0N/A isRel = nextPage();
0N/A counter++;
0N/A }
0N/A
0N/A if(!isRel && counter < page){
0N/A retVal = false;
0N/A }
0N/A else if( counter == page){
0N/A retVal = true;
0N/A }
0N/A return retVal;
0N/A }
0N/A else {
0N/A counter = page;
0N/A isRel = true;
0N/A while((counter < 0) && isRel){
0N/A isRel = previousPage();
0N/A counter++;
0N/A }
0N/A
0N/A if( !isRel && counter < 0){
0N/A retVal = false;
0N/A }
0N/A else if(counter == 0){
0N/A retVal = true;
0N/A }
0N/A return retVal;
0N/A }
0N/A }
0N/A */
0N/A
0N/A /**
0N/A * Retrieves the first page of data as specified by the page size.
0N/A * @return boolean value true if present on first page, false otherwise
0N/A * @throws SQLException if it called before populate or ResultSet is of
0N/A * type <code>ResultSet.TYPE_FORWARD_ONLY</code> or an error occurs
0N/A */
0N/A /*
0N/A public boolean firstPage() throws SQLException {
0N/A if (populatecallcount == 0){
0N/A throw new SQLException("Populate the data before calling ");
0N/A }
0N/A if( !callWithCon){
0N/A if(resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY) {
0N/A throw new SQLException("Result of type forward only");
0N/A }
0N/A }
0N/A endPos = 0;
0N/A maxRowsreached = 0;
0N/A pagenotend = true;
0N/A if(callWithCon){
0N/A crsReader.setStartPosition(startPos);
0N/A crsReader.readData((RowSetInternal)this);
0N/A resultSet = null;
0N/A }
0N/A else {
0N/A populate(resultSet,startPos);
0N/A }
0N/A onFirstPage = true;
0N/A return onFirstPage;
0N/A }
0N/A */
0N/A
0N/A /**
0N/A * Retrives the last page of data as specified by the page size.
0N/A * @return boolean value tur if present on the last page, false otherwise
0N/A * @throws SQLException if called before populate or if an error occurs.
0N/A */
0N/A /*
0N/A public boolean lastPage() throws SQLException{
0N/A int pS;
0N/A int mR;
0N/A int quo;
0N/A int rem;
0N/A
0N/A pS = getPageSize();
0N/A mR = getMaxRows();
0N/A
0N/A if(pS == 0){
0N/A onLastPage = true;
0N/A return onLastPage;
0N/A }
0N/A
0N/A if(getMaxRows() == 0){
0N/A mR = totalRows;
0N/A }
0N/A
0N/A if (populatecallcount == 0){
0N/A throw new SQLException("Populate the data before calling ");
0N/A }
0N/A
0N/A onFirstPage = false;
0N/A
0N/A if((mR % pS) == 0){
0N/A quo = mR / pS;
0N/A int start = startPos + (pS * (quo - 1));
0N/A maxRowsreached = mR - pS;
0N/A if(callWithCon){
0N/A crsReader.setStartPosition(start);
0N/A crsReader.readData((RowSetInternal)this);
0N/A resultSet = null;
0N/A }
0N/A else {
0N/A populate(resultSet,start);
0N/A }
0N/A onLastPage = true;
0N/A return onLastPage;
0N/A }
0N/A else {
0N/A quo = mR /pS;
0N/A rem = mR % pS;
0N/A int start = startPos + (pS * quo);
0N/A maxRowsreached = mR - (rem);
0N/A if(callWithCon){
0N/A crsReader.setStartPosition(start);
0N/A crsReader.readData((RowSetInternal)this);
0N/A resultSet = null;
0N/A }
0N/A else {
0N/A populate(resultSet,start);
0N/A }
0N/A onLastPage = true;
0N/A return onLastPage;
0N/A }
0N/A }
0N/A */
0N/A
0N/A /**
0N/A * Sets the status for the row on which the cursor is positioned. The insertFlag is used
0N/A * to mention the toggle status for this row
0N/A * @param insertFlag if it is true - marks this row as inserted
0N/A * if it is false - marks it as not a newly inserted row
0N/A * @throws SQLException if an error occurs while doing this operation
0N/A */
0N/A public void setRowInserted(boolean insertFlag) throws SQLException {
0N/A
0N/A checkCursor();
0N/A
0N/A if(onInsertRow == true)
0N/A throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidop").toString());
0N/A
0N/A if( insertFlag ) {
0N/A ((Row)getCurrentRow()).setInserted();
0N/A } else {
0N/A ((Row)getCurrentRow()).clearInserted();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated <code>SQL XML</code> parameter as a
0N/A * <code>SQLXML</code> object in the Java programming language.
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @return a SQLXML object that maps an SQL XML value
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public SQLXML getSQLXML(int columnIndex) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated <code>SQL XML</code> parameter as a
0N/A * <code>SQLXML</code> object in the Java programming language.
0N/A * @param colName the name of the column from which to retrieve the value
0N/A * @return a SQLXML object that maps an SQL XML value
0N/A * @throws SQLException if a database access error occurs
0N/A */
0N/A public SQLXML getSQLXML(String colName) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row of this
0N/A * <code>ResultSet</code> object as a java.sql.RowId object in the Java
0N/A * programming language.
0N/A *
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @return the column value if the value is a SQL <code>NULL</code> the
0N/A * value returned is <code>null</code>
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public RowId getRowId(int columnIndex) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row of this
0N/A * <code>ResultSet</code> object as a java.sql.RowId object in the Java
0N/A * programming language.
0N/A *
0N/A * @param columnName the name of the column
0N/A * @return the column value if the value is a SQL <code>NULL</code> the
0N/A * value returned is <code>null</code>
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public RowId getRowId(String columnName) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a <code>RowId</code> value. The updater
0N/A * methods are used to update column values in the current row or the insert
0N/A * row. The updater methods do not update the underlying database; instead
0N/A * the <code>updateRow<code> or <code>insertRow</code> methods are called
0N/A * to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @param x the column value
0N/A * @throws SQLException if a database access occurs
0N/A * @since 6.0
0N/A */
0N/A public void updateRowId(int columnIndex, RowId x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a <code>RowId</code> value. The updater
0N/A * methods are used to update column values in the current row or the insert
0N/A * row. The updater methods do not update the underlying database; instead
0N/A * the <code>updateRow<code> or <code>insertRow</code> methods are called
0N/A * to update the database.
0N/A *
0N/A * @param columnName the name of the column
0N/A * @param x the column value
0N/A * @throws SQLException if a database access occurs
0N/A * @since 6.0
0N/A */
0N/A public void updateRowId(String columnName, RowId x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the holdability of this ResultSet object
0N/A * @return either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
0N/A * @throws SQLException if a database error occurs
0N/A * @since 6.0
0N/A */
0N/A public int getHoldability() throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves whether this ResultSet object has been closed. A ResultSet is closed if the
0N/A * method close has been called on it, or if it is automatically closed.
0N/A * @return true if this ResultSet object is closed; false if it is still open
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public boolean isClosed() throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * This method is used for updating columns that support National Character sets.
0N/A * It can be used for updating NCHAR,NVARCHAR and LONGNVARCHAR columns.
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @param nString the value for the column to be updated
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public void updateNString(int columnIndex, String nString) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * This method is used for updating columns that support National Character sets.
0N/A * It can be used for updating NCHAR,NVARCHAR and LONGNVARCHAR columns.
0N/A * @param columnName name of the Column
0N/A * @param nString the value for the column to be updated
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public void updateNString(String columnName, String nString) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /*o
0N/A * This method is used for updating SQL <code>NCLOB</code> type that maps
0N/A * to <code>java.sql.Types.NCLOB</code>
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @param nClob the value for the column to be updated
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * This method is used for updating SQL <code>NCLOB</code> type that maps
0N/A * to <code>java.sql.Types.NCLOB</code>
0N/A * @param columnName name of the column
0N/A * @param nClob the value for the column to be updated
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public void updateNClob(String columnName, NClob nClob) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>ResultSet</code> object as a <code>NClob</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param i the first column is 1, the second is 2, ...
0N/A * @return a <code>NClob</code> object representing the SQL
0N/A * <code>NCLOB</code> value in the specified column
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public NClob getNClob(int i) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>ResultSet</code> object as a <code>NClob</code> object
0N/A * in the Java programming language.
0N/A *
0N/A * @param colName the name of the column from which to retrieve the value
0N/A * @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
0N/A * value in the specified column
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 6.0
0N/A */
0N/A public NClob getNClob(String colName) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException {
0N/A return null;
0N/A }
0N/A
0N/A public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
0N/A return false;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an
0N/A * SQL <code>XML</code> value when it sends it to the database.
0N/A * @param parameterIndex index of the first parameter is 1, the second is 2, ...
0N/A * @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an
0N/A * <code>SQL XML</code> value when it sends it to the database.
0N/A * @param parameterName the name of the parameter
0N/A * @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
0N/A * driver converts this to a SQL <code>ROWID</code> value when it sends it
0N/A * to the database
0N/A *
0N/A * @param parameterIndex the first parameter is 1, the second is 2, ...
0N/A * @param x the parameter value
0N/A * @throws SQLException if a database access error occurs
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setRowId(int parameterIndex, RowId x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
0N/A * driver converts this to a SQL <code>ROWID</code> when it sends it to the
0N/A * database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setRowId(String parameterName, RowId x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The
0N/A * <code>Reader</code> reads the data till end-of-file is reached. The
0N/A * driver does the necessary conversion from Java character format to
0N/A * the national character set in the database.
0N/A
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setNCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param parameterIndex of the first parameter is 1, the second is 2, ...
0N/A * @param value the parameter value
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur ; if a database access error occurs; or
0N/A * this method is called on a closed <code>PreparedStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>java.sql.NClob</code> object. The object
0N/A * implements the <code>java.sql.NClob</code> interface. This <code>NClob</code>
0N/A * object maps to a SQL <code>NCLOB</code>.
0N/A * @param parameterName the name of the column to be set
0N/A * @param value the parameter value
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; or if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setNClob(String parameterName, NClob value) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>ResultSet</code> object as a
0N/A * <code>java.io.Reader</code> object.
0N/A * It is intended for use when
0N/A * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
0N/A * and <code>LONGNVARCHAR</code> columns.
0N/A *
0N/A * @return a <code>java.io.Reader</code> object that contains the column
0N/A * value; if the value is SQL <code>NULL</code>, the value returned is
0N/A * <code>null</code> in the Java programming language.
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public java.io.Reader getNCharacterStream(int columnIndex) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>ResultSet</code> object as a
0N/A * <code>java.io.Reader</code> object.
0N/A * It is intended for use when
0N/A * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
0N/A * and <code>LONGNVARCHAR</code> columns.
0N/A *
0N/A * @param columnName the name of the column
0N/A * @return a <code>java.io.Reader</code> object that contains the column
0N/A * value; if the value is SQL <code>NULL</code>, the value returned is
0N/A * <code>null</code> in the Java programming language
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public java.io.Reader getNCharacterStream(String columnName) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Updates the designated column with a <code>java.sql.SQLXML</code> value.
0N/A * The updater
0N/A * methods are used to update column values in the current row or the insert
0N/A * row. The updater methods do not update the underlying database; instead
0N/A * the <code>updateRow</code> or <code>insertRow</code> methods are called
0N/A * to update the database.
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @param xmlObject the value for the column to be updated
0N/A * @throws SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a <code>java.sql.SQLXML</code> value.
0N/A * The updater
0N/A * methods are used to update column values in the current row or the insert
0N/A * row. The updater methods do not update the underlying database; instead
0N/A * the <code>updateRow</code> or <code>insertRow</code> methods are called
0N/A * to update the database.
0N/A *
0N/A * @param columnName the name of the column
0N/A * @param xmlObject the column value
0N/A * @throws SQLException if a database access occurs
0N/A * @since 1.6
0N/A */
0N/A public void updateSQLXML(String columnName, SQLXML xmlObject) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>ResultSet</code> object as
0N/A * a <code>String</code> in the Java programming language.
0N/A * It is intended for use when
0N/A * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
0N/A * and <code>LONGNVARCHAR</code> columns.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * value returned is <code>null</code>
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public String getNString(int columnIndex) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the value of the designated column in the current row
0N/A * of this <code>ResultSet</code> object as
0N/A * a <code>String</code> in the Java programming language.
0N/A * It is intended for use when
0N/A * accessing <code>NCHAR</code>,<code>NVARCHAR</code>
0N/A * and <code>LONGNVARCHAR</code> columns.
0N/A *
0N/A * @param columnName the SQL name of the column
0N/A * @return the column value; if the value is SQL <code>NULL</code>, the
0N/A * value returned is <code>null</code>
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public String getNString(String columnName) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value, which will
0N/A * have the specified number of bytes. The driver does the necessary conversion
0N/A * from Java character format to the national character set in the database.
0N/A * It is intended for use when updating NCHAR,NVARCHAR and LONGNVARCHAR columns.
0N/A * The updater methods are used to update column values in the current row or
0N/A * the insert row. The updater methods do not update the underlying database;
0N/A * instead the updateRow or insertRow methods are called to update the database.
0N/A *
0N/A * @param columnIndex - the first column is 1, the second is 2, ...
0N/A * @param x - the new column value
0N/A * @param length - the length of the stream
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void updateNCharacterStream(int columnIndex,
0N/A java.io.Reader x,
0N/A long length)
0N/A throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value, which will
0N/A * have the specified number of bytes. The driver does the necessary conversion
0N/A * from Java character format to the national character set in the database.
0N/A * It is intended for use when updating NCHAR,NVARCHAR and LONGNVARCHAR columns.
0N/A * The updater methods are used to update column values in the current row or
0N/A * the insert row. The updater methods do not update the underlying database;
0N/A * instead the updateRow or insertRow methods are called to update the database.
0N/A *
0N/A * @param columnName - name of the Column
0N/A * @param x - the new column value
0N/A * @param length - the length of the stream
0N/A * @exception SQLException if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void updateNCharacterStream(String columnName,
0N/A java.io.Reader x,
0N/A long length)
0N/A throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value. The
0N/A * driver does the necessary conversion from Java character format to
0N/A * the national character set in the database.
0N/A * It is intended for use when
0N/A * updating <code>NCHAR</code>,<code>NVARCHAR</code>
0N/A * and <code>LONGNVARCHAR</code> columns.
0N/A *
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateNCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateNCharacterStream(int columnIndex,
0N/A java.io.Reader x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value. The
0N/A * driver does the necessary conversion from Java character format to
0N/A * the national character set in the database.
0N/A * It is intended for use when
0N/A * updating <code>NCHAR</code>,<code>NVARCHAR</code>
0N/A * and <code>LONGNVARCHAR</code> columns.
0N/A *
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateNCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param reader the <code>java.io.Reader</code> object containing
0N/A * the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateNCharacterStream(String columnLabel,
0N/A java.io.Reader reader) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A//////////////////////////
0N/A
0N/A /**
0N/A * Updates the designated column using the given input stream, which
0N/A * will have the specified number of bytes.
0N/A * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code>. Data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from ASCII to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @param length the number of bytes in the parameter data.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given input stream, which
0N/A * will have the specified number of bytes.
0N/A * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code>. Data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from ASCII to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @param length the number of bytes in the parameter data.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given input stream.
0N/A * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code>. Data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from ASCII to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateBlob</code> which takes a length parameter.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given input stream.
0N/A * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code>. Data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from ASCII to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateBlob</code> which takes a length parameter.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object, which is the given number of characters long.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object, which is the given number of characters long.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateClob</code> which takes a length parameter.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateClob(int columnIndex, Reader reader) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateClob</code> which takes a length parameter.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateClob(String columnLabel, Reader reader) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object, which is the given number of characters long.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; this method is called on a closed result set,
0N/A * if a database access error occurs or
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object, which is the given number of characters long.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; this method is called on a closed result set;
0N/A * if a database access error occurs or
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateNClob</code> which takes a length parameter.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; this method is called on a closed result set,
0N/A * if a database access error occurs or
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateNClob(int columnIndex, Reader reader) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column using the given <code>Reader</code>
0N/A * object.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateNClob</code> which takes a length parameter.
0N/A * <p>
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; this method is called on a closed result set;
0N/A * if a database access error occurs or
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateNClob(String columnLabel, Reader reader) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with an ascii stream value, which will have
0N/A * the specified number of bytes.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @param length the length of the stream
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateAsciiStream(int columnIndex,
0N/A java.io.InputStream x,
0N/A long length) throws SQLException {
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a binary stream value, which will have
0N/A * the specified number of bytes.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @param length the length of the stream
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBinaryStream(int columnIndex,
0N/A java.io.InputStream x,
0N/A long length) throws SQLException {
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value, which will have
0N/A * the specified number of bytes.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @param length the length of the stream
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateCharacterStream(int columnIndex,
0N/A java.io.Reader x,
0N/A long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value, which will have
0N/A * the specified number of bytes.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param reader the <code>java.io.Reader</code> object containing
0N/A * the new column value
0N/A * @param length the length of the stream
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateCharacterStream(String columnLabel,
0N/A java.io.Reader reader,
0N/A long length) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A /**
0N/A * Updates the designated column with an ascii stream value, which will have
0N/A * the specified number of bytes..
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
0N/A * @param x the new column value
0N/A * @param length the length of the stream
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateAsciiStream(String columnLabel,
0N/A java.io.InputStream x,
0N/A long length) throws SQLException {
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a binary stream value, which will have
0N/A * the specified number of bytes.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
0N/A * @param x the new column value
0N/A * @param length the length of the stream
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBinaryStream(String columnLabel,
0N/A java.io.InputStream x,
0N/A long length) throws SQLException {
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a binary stream value.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateBinaryStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBinaryStream(int columnIndex,
0N/A java.io.InputStream x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Updates the designated column with a binary stream value.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateBinaryStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param x the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateBinaryStream(String columnLabel,
0N/A java.io.InputStream x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateCharacterStream(int columnIndex,
0N/A java.io.Reader x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with a character stream value.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param reader the <code>java.io.Reader</code> object containing
0N/A * the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateCharacterStream(String columnLabel,
0N/A java.io.Reader reader) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with an ascii stream value.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateAsciiStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnIndex the first column is 1, the second is 2, ...
0N/A * @param x the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateAsciiStream(int columnIndex,
0N/A java.io.InputStream x) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Updates the designated column with an ascii stream value.
0N/A * The updater methods are used to update column values in the
0N/A * current row or the insert row. The updater methods do not
0N/A * update the underlying database; instead the <code>updateRow</code> or
0N/A * <code>insertRow</code> methods are called to update the database.
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>updateAsciiStream</code> which takes a length parameter.
0N/A *
0N/A * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la
0N/Abel is the name of the column
0N/A * @param x the new column value
0N/A * @exception SQLException if a database access error occurs,
0N/A * the result set concurrency is <code>CONCUR_READ_ONLY</code>
0N/A * or this method is called on a closed result set
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void updateAsciiStream(String columnLabel,
0N/A java.io.InputStream x) throws SQLException {
0N/A
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.net.URL</code> value.
0N/A * The driver converts this to an SQL <code>DATALINK</code> value
0N/A * when it sends it to the database.
0N/A *
0N/A * @param parameterIndex the first parameter is 1, the second is 2, ...
0N/A * @param x the <code>java.net.URL</code> object to be set
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>PreparedStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.4
0N/A */
0N/A public void setURL(int parameterIndex, java.net.URL x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object.
0N/A * This method differs from the <code>setCharacterStream (int, Reader)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setNClob</code> which takes a length parameter.
0N/A *
0N/A * @param parameterIndex index of the first parameter is 1, the second is 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @throws SQLException if parameterIndex does not correspond to a parameter
0N/A * marker in the SQL statement;
0N/A * if the driver does not support national character sets;
0N/A * if the driver can detect that a data conversion
0N/A * error could occur; if a database access error occurs or
0N/A * this method is called on a closed <code>PreparedStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setNClob(int parameterIndex, Reader reader)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number
0N/A * of characters specified by length otherwise a <code>SQLException</code> will be
0N/A * generated when the <code>CallableStatement</code> is executed.
0N/A * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
0N/A *
0N/A * @param parameterName the name of the parameter to be set
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if parameterIndex does not correspond to a parameter
0N/A * marker in the SQL statement; if the length specified is less than zero;
0N/A * if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void setNClob(String parameterName, Reader reader, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object.
0N/A * This method differs from the <code>setCharacterStream (int, Reader)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setNClob</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @throws SQLException if the driver does not support national character sets;
0N/A * if the driver can detect that a data conversion
0N/A * error could occur; if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setNClob(String parameterName, Reader reader)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number
0N/A * of characters specified by length otherwise a <code>SQLException</code> will be
0N/A * generated when the <code>PreparedStatement</code> is executed.
0N/A * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
0N/A * @param parameterIndex index of the first parameter is 1, the second is 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if parameterIndex does not correspond to a parameter
0N/A * marker in the SQL statement; if the length specified is less than zero;
0N/A * if the driver does not support national character sets;
0N/A * if the driver can detect that a data conversion
0N/A * error could occur; if a database access error occurs or
0N/A * this method is called on a closed <code>PreparedStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setNClob(int parameterIndex, Reader reader, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this to
0N/Aa
0N/A * SQL <code>NCLOB</code> value when it sends it to the database.
0N/A * @param parameterIndex of the first parameter is 1, the second is 2, ...
0N/A * @param value the parameter value
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur ; or if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setNClob(int parameterIndex, NClob value) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated paramter to the given <code>String</code> object.
0N/A * The driver converts this to a SQL <code>NCHAR</code> or
0N/A * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
0N/A * (depending on the argument's
0N/A * size relative to the driver's limits on <code>NVARCHAR</code> values)
0N/A * when it sends it to the database.
0N/A *
0N/A * @param parameterIndex of the first parameter is 1, the second is 2, ...
0N/A * @param value the parameter value
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur ; or if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setNString(int parameterIndex, String value) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated paramter to the given <code>String</code> object.
0N/A * The driver converts this to a SQL <code>NCHAR</code> or
0N/A * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
0N/A * @param parameterName the name of the column to be set
0N/A * @param value the parameter value
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; or if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setNString(String parameterName, String value)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The
0N/A * <code>Reader</code> reads the data till end-of-file is reached. The
0N/A * driver does the necessary conversion from Java character format to
0N/A * the national character set in the database.
0N/A * @param parameterIndex of the first parameter is 1, the second is 2, ...
0N/A * @param value the parameter value
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur ; or if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The
0N/A * <code>Reader</code> reads the data till end-of-file is reached. The
0N/A * driver does the necessary conversion from Java character format to
0N/A * the national character set in the database.
0N/A * @param parameterName the name of the column to be set
0N/A * @param value the parameter value
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur; or if a database access error occurs
0N/A * @since 1.6
0N/A */
0N/A public void setNCharacterStream(String parameterName, Reader value, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The
0N/A * <code>Reader</code> reads the data till end-of-file is reached. The
0N/A * driver does the necessary conversion from Java character format to
0N/A * the national character set in the database.
0N/A
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setNCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param value the parameter value
0N/A * @throws SQLException if the driver does not support national
0N/A * character sets; if the driver can detect that a data conversion
0N/A * error could occur ; if a database access error occurs; or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setNCharacterStream(String parameterName, Reader value) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,
0N/A * using the given <code>Calendar</code> object. The driver uses
0N/A * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,
0N/A * which the driver then sends to the database. With a
0N/A * a <code>Calendar</code> object, the driver can calculate the timestamp
0N/A * taking into account a custom timezone. If no
0N/A * <code>Calendar</code> object is specified, the driver uses the default
0N/A * timezone, which is that of the virtual machine running the application.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @param cal the <code>Calendar</code> object the driver will use
0N/A * to construct the timestamp
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getTimestamp
0N/A * @since 1.4
0N/A */
0N/A public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number
0N/A * of characters specified by length otherwise a <code>SQLException</code> will be
0N/A * generated when the <code>CallableStatement</code> is executed.
0N/A * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
0N/A * @param parameterName the name of the parameter to be set
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if parameterIndex does not correspond to a parameter
0N/A * marker in the SQL statement; if the length specified is less than zero;
0N/A * a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setClob(String parameterName, Reader reader, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Clob</code> object.
0N/A * The driver converts this to an SQL <code>CLOB</code> value when it
0N/A * sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void setClob (String parameterName, Clob x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object.
0N/A * This method differs from the <code>setCharacterStream (int, Reader)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setClob</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @throws SQLException if a database access error occurs or this method is called on
0N/A * a closed <code>CallableStatement</code>
0N/A *
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setClob(String parameterName, Reader reader)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Date</code> value
0N/A * using the default time zone of the virtual machine that is running
0N/A * the application.
0N/A * The driver converts this
0N/A * to an SQL <code>DATE</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getDate
0N/A * @since 1.4
0N/A */
0N/A public void setDate(String parameterName, java.sql.Date x)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Date</code> value,
0N/A * using the given <code>Calendar</code> object. The driver uses
0N/A * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
0N/A * which the driver then sends to the database. With a
0N/A * a <code>Calendar</code> object, the driver can calculate the date
0N/A * taking into account a custom timezone. If no
0N/A * <code>Calendar</code> object is specified, the driver uses the default
0N/A * timezone, which is that of the virtual machine running the application.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @param cal the <code>Calendar</code> object the driver will use
0N/A * to construct the date
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getDate
0N/A * @since 1.4
0N/A */
0N/A public void setDate(String parameterName, java.sql.Date x, Calendar cal)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Time</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>TIME</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getTime
0N/A * @since 1.4
0N/A */
0N/A public void setTime(String parameterName, java.sql.Time x)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Time</code> value,
0N/A * using the given <code>Calendar</code> object. The driver uses
0N/A * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,
0N/A * which the driver then sends to the database. With a
0N/A * a <code>Calendar</code> object, the driver can calculate the time
0N/A * taking into account a custom timezone. If no
0N/A * <code>Calendar</code> object is specified, the driver uses the default
0N/A * timezone, which is that of the virtual machine running the application.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @param cal the <code>Calendar</code> object the driver will use
0N/A * to construct the time
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getTime
0N/A * @since 1.4
0N/A */
0N/A public void setTime(String parameterName, java.sql.Time x, Calendar cal)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object.
0N/A * This method differs from the <code>setCharacterStream (int, Reader)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setClob</code> which takes a length parameter.
0N/A *
0N/A * @param parameterIndex index of the first parameter is 1, the second is 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @throws SQLException if a database access error occurs, this method is called on
0N/A * a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter
0N/A * marker in the SQL statement
0N/A *
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setClob(int parameterIndex, Reader reader)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number
0N/A * of characters specified by length otherwise a <code>SQLException</code> will be
0N/A * generated when the <code>PreparedStatement</code> is executed.
0N/A *This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
0N/A * because it informs the driver that the parameter value should be sent to
0N/A * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the
0N/A * driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
0N/A * @param parameterIndex index of the first parameter is 1, the second is 2, ...
0N/A * @param reader An object that contains the data to set the parameter value to.
0N/A * @param length the number of characters in the parameter data.
0N/A * @throws SQLException if a database access error occurs, this method is called on
0N/A * a closed <code>PreparedStatement</code>, if parameterIndex does not correspond to a parameter
0N/A * marker in the SQL statement, or if the length specified is less than zero.
0N/A *
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setClob(int parameterIndex, Reader reader, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>InputStream</code> object. The inputstream must contain the number
0N/A * of characters specified by length otherwise a <code>SQLException</code> will be
0N/A * generated when the <code>PreparedStatement</code> is executed.
0N/A * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
0N/A * method because it informs the driver that the parameter value should be
0N/A * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
0N/A * the driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
0N/A * @param parameterIndex index of the first parameter is 1,
0N/A * the second is 2, ...
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @param length the number of bytes in the parameter data.
0N/A * @throws SQLException if a database access error occurs,
0N/A * this method is called on a closed <code>PreparedStatement</code>,
0N/A * if parameterIndex does not correspond
0N/A * to a parameter marker in the SQL statement, if the length specified
0N/A * is less than zero or if the number of bytes in the inputstream does not match
0N/A * the specfied length.
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setBlob(int parameterIndex, InputStream inputStream, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>InputStream</code> object.
0N/A * This method differs from the <code>setBinaryStream (int, InputStream)</code>
0N/A * method because it informs the driver that the parameter value should be
0N/A * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
0N/A * the driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setBlob</code> which takes a length parameter.
0N/A *
0N/A * @param parameterIndex index of the first parameter is 1,
0N/A * the second is 2, ...
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @throws SQLException if a database access error occurs,
0N/A * this method is called on a closed <code>PreparedStatement</code> or
0N/A * if parameterIndex does not correspond
0N/A * to a parameter marker in the SQL statement,
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setBlob(int parameterIndex, InputStream inputStream)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>InputStream</code> object. The <code>inputstream</code> must contain the number
0N/A * of characters specified by length, otherwise a <code>SQLException</code> will be
0N/A * generated when the <code>CallableStatement</code> is executed.
0N/A * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
0N/A * method because it informs the driver that the parameter value should be
0N/A * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
0N/A * the driver may have to do extra work to determine whether the parameter
0N/A * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
0N/A *
0N/A * @param parameterName the name of the parameter to be set
0N/A * the second is 2, ...
0N/A *
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @param length the number of bytes in the parameter data.
0N/A * @throws SQLException if parameterIndex does not correspond
0N/A * to a parameter marker in the SQL statement, or if the length specified
0N/A * is less than zero; if the number of bytes in the inputstream does not match
0N/A * the specfied length; if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setBlob(String parameterName, InputStream inputStream, long length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Blob</code> object.
0N/A * The driver converts this to an SQL <code>BLOB</code> value when it
0N/A * sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.6
0N/A */
0N/A public void setBlob (String parameterName, Blob x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to a <code>InputStream</code> object.
0N/A * This method differs from the <code>setBinaryStream (int, InputStream)</code>
0N/A * method because it informs the driver that the parameter value should be
0N/A * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,
0N/A * the driver may have to do extra work to determine whether the parameter
0N/A * data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
0N/A *
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setBlob</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param inputStream An object that contains the data to set the parameter
0N/A * value to.
0N/A * @throws SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A *
0N/A * @since 1.6
0N/A */
0N/A public void setBlob(String parameterName, InputStream inputStream)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the value of the designated parameter with the given object. The second
0N/A * argument must be an object type; for integral values, the
0N/A * <code>java.lang</code> equivalent objects should be used.
0N/A *
0N/A * <p>The given Java object will be converted to the given targetSqlType
0N/A * before being sent to the database.
0N/A *
0N/A * If the object has a custom mapping (is of a class implementing the
0N/A * interface <code>SQLData</code>),
0N/A * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it
0N/A * to the SQL data stream.
0N/A * If, on the other hand, the object is of a class implementing
0N/A * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,
0N/A * <code>Struct</code>, <code>java.net.URL</code>,
0N/A * or <code>Array</code>, the driver should pass it to the database as a
0N/A * value of the corresponding SQL type.
0N/A * <P>
0N/A * Note that this method may be used to pass datatabase-
0N/A * specific abstract data types.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the object containing the input parameter value
0N/A * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
0N/A * sent to the database. The scale argument may further qualify this type.
0N/A * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
0N/A * this is the number of digits after the decimal point. For all other
0N/A * types, this value will be ignored.
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
0N/A * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
0N/A * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
0N/A * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
0N/A * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
0N/A * or <code>STRUCT</code> data type and the JDBC driver does not support
0N/A * this data type
0N/A * @see Types
0N/A * @see #getObject
0N/A * @since 1.4
0N/A */
0N/A public void setObject(String parameterName, Object x, int targetSqlType, int scale)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the value of the designated parameter with the given object.
0N/A * This method is like the method <code>setObject</code>
0N/A * above, except that it assumes a scale of zero.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the object containing the input parameter value
0N/A * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
0N/A * sent to the database
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is
0N/A * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
0N/A * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
0N/A * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
0N/A * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
0N/A * or <code>STRUCT</code> data type and the JDBC driver does not support
0N/A * this data type
0N/A * @see #getObject
0N/A * @since 1.4
0N/A */
0N/A public void setObject(String parameterName, Object x, int targetSqlType)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the value of the designated parameter with the given object.
0N/A * The second parameter must be of type <code>Object</code>; therefore, the
0N/A * <code>java.lang</code> equivalent objects should be used for built-in types.
0N/A *
0N/A * <p>The JDBC specification specifies a standard mapping from
0N/A * Java <code>Object</code> types to SQL types. The given argument
0N/A * will be converted to the corresponding SQL type before being
0N/A * sent to the database.
0N/A *
0N/A * <p>Note that this method may be used to pass datatabase-
0N/A * specific abstract data types, by using a driver-specific Java
0N/A * type.
0N/A *
0N/A * If the object is of a class implementing the interface <code>SQLData</code>,
0N/A * the JDBC driver should call the method <code>SQLData.writeSQL</code>
0N/A * to write it to the SQL data stream.
0N/A * If, on the other hand, the object is of a class implementing
0N/A * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,
0N/A * <code>Struct</code>, <code>java.net.URL</code>,
0N/A * or <code>Array</code>, the driver should pass it to the database as a
0N/A * value of the corresponding SQL type.
0N/A * <P>
0N/A * This method throws an exception if there is an ambiguity, for example, if the
0N/A * object is of a class implementing more than one of the interfaces named above.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the object containing the input parameter value
0N/A * @exception SQLException if a database access error occurs,
0N/A * this method is called on a closed <code>CallableStatement</code> or if the given
0N/A * <code>Object</code> parameter is ambiguous
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getObject
0N/A * @since 1.4
0N/A */
0N/A public void setObject(String parameterName, Object x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given input stream, which will have
0N/A * the specified number of bytes.
0N/A * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code>. Data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from ASCII to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the Java input stream that contains the ASCII parameter value
0N/A * @param length the number of bytes in the stream
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.4
0N/A */
0N/A public void setAsciiStream(String parameterName, java.io.InputStream x, int length)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given input stream, which will have
0N/A * the specified number of bytes.
0N/A * When a very large binary value is input to a <code>LONGVARBINARY</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the java input stream which contains the binary parameter value
0N/A * @param length the number of bytes in the stream
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.4
0N/A */
0N/A public void setBinaryStream(String parameterName, java.io.InputStream x,
0N/A int length) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>Reader</code>
0N/A * object, which is the given number of characters long.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param reader the <code>java.io.Reader</code> object that
0N/A * contains the UNICODE data used as the designated parameter
0N/A * @param length the number of characters in the stream
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.4
0N/A */
0N/A public void setCharacterStream(String parameterName,
0N/A java.io.Reader reader,
0N/A int length) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given input stream.
0N/A * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code>. Data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from ASCII to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setAsciiStream</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the Java input stream that contains the ASCII parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setAsciiStream(String parameterName, java.io.InputStream x)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given input stream.
0N/A * When a very large binary value is input to a <code>LONGVARBINARY</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.InputStream</code> object. The data will be read from the
0N/A * stream as needed until end-of-file is reached.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setBinaryStream</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the java input stream which contains the binary parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setBinaryStream(String parameterName, java.io.InputStream x)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>Reader</code>
0N/A * object.
0N/A * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
0N/A * parameter, it may be more practical to send it via a
0N/A * <code>java.io.Reader</code> object. The data will be read from the stream
0N/A * as needed until end-of-file is reached. The JDBC driver will
0N/A * do any necessary conversion from UNICODE to the database char format.
0N/A *
0N/A * <P><B>Note:</B> This stream object can either be a standard
0N/A * Java stream object or your own subclass that implements the
0N/A * standard interface.
0N/A * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
0N/A * it might be more efficient to use a version of
0N/A * <code>setCharacterStream</code> which takes a length parameter.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param reader the <code>java.io.Reader</code> object that contains the
0N/A * Unicode data
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0N/A * @since 1.6
0N/A */
0N/A public void setCharacterStream(String parameterName,
0N/A java.io.Reader reader) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given
0N/A * <code>java.math.BigDecimal</code> value.
0N/A * The driver converts this to an SQL <code>NUMERIC</code> value when
0N/A * it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getBigDecimal
0N/A * @since 1.4
0N/A */
0N/A public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>String</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
0N/A * (depending on the argument's
0N/A * size relative to the driver's limits on <code>VARCHAR</code> values)
0N/A * when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getString
0N/A * @since 1.4
0N/A */
0N/A public void setString(String parameterName, String x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java array of bytes.
0N/A * The driver converts this to an SQL <code>VARBINARY</code> or
0N/A * <code>LONGVARBINARY</code> (depending on the argument's size relative
0N/A * to the driver's limits on <code>VARBINARY</code> values) when it sends
0N/A * it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getBytes
0N/A * @since 1.4
0N/A */
0N/A public void setBytes(String parameterName, byte x[]) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.
0N/A * The driver
0N/A * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the
0N/A * database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getTimestamp
0N/A * @since 1.4
0N/A */
0N/A public void setTimestamp(String parameterName, java.sql.Timestamp x)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * Sets the designated parameter to SQL <code>NULL</code>.
0N/A *
0N/A * <P><B>Note:</B> You must specify the parameter's SQL type.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param sqlType the SQL type code defined in <code>java.sql.Types</code>
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.4
0N/A */
0N/A public void setNull(String parameterName, int sqlType) throws SQLException {
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to SQL <code>NULL</code>.
0N/A * This version of the method <code>setNull</code> should
0N/A * be used for user-defined types and REF type parameters. Examples
0N/A * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
0N/A * named array types.
0N/A *
0N/A * <P><B>Note:</B> To be portable, applications must give the
0N/A * SQL type code and the fully-qualified SQL type name when specifying
0N/A * a NULL user-defined or REF parameter. In the case of a user-defined type
0N/A * the name is the type name of the parameter itself. For a REF
0N/A * parameter, the name is the type name of the referenced type. If
0N/A * a JDBC driver does not need the type code or type name information,
0N/A * it may ignore it.
0N/A *
0N/A * Although it is intended for user-defined and Ref parameters,
0N/A * this method may be used to set a null parameter of any JDBC type.
0N/A * If the parameter does not have a user-defined or REF type, the given
0N/A * typeName is ignored.
0N/A *
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param sqlType a value from <code>java.sql.Types</code>
0N/A * @param typeName the fully-qualified name of an SQL user-defined type;
0N/A * ignored if the parameter is not a user-defined type or
0N/A * SQL <code>REF</code> value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.4
0N/A */
0N/A public void setNull (String parameterName, int sqlType, String typeName)
0N/A throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>boolean</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @see #getBoolean
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @since 1.4
0N/A */
0N/A public void setBoolean(String parameterName, boolean x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>byte</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>TINYINT</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getByte
0N/A * @since 1.4
0N/A */
0N/A public void setByte(String parameterName, byte x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>short</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>SMALLINT</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getShort
0N/A * @since 1.4
0N/A */
0N/A public void setShort(String parameterName, short x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>int</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>INTEGER</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getInt
0N/A * @since 1.4
0N/A */
0N/A public void setInt(String parameterName, int x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>long</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>BIGINT</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getLong
0N/A * @since 1.4
0N/A */
0N/A public void setLong(String parameterName, long x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>float</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>FLOAT</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getFloat
0N/A * @since 1.4
0N/A */
0N/A public void setFloat(String parameterName, float x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Sets the designated parameter to the given Java <code>double</code> value.
0N/A * The driver converts this
0N/A * to an SQL <code>DOUBLE</code> value when it sends it to the database.
0N/A *
0N/A * @param parameterName the name of the parameter
0N/A * @param x the parameter value
0N/A * @exception SQLException if a database access error occurs or
0N/A * this method is called on a closed <code>CallableStatement</code>
0N/A * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
0N/A * this method
0N/A * @see #getDouble
0N/A * @since 1.4
0N/A */
0N/A public void setDouble(String parameterName, double x) throws SQLException{
0N/A throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
0N/A }
0N/A
0N/A /**
0N/A * This method re populates the resBundle
0N/A * during the deserialization process
0N/A *
0N/A */
2741N/A private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
0N/A // Default state initialization happens here
0N/A ois.defaultReadObject();
0N/A // Initialization of transient Res Bundle happens here .
0N/A try {
0N/A resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
0N/A } catch(IOException ioe) {
0N/A throw new RuntimeException(ioe);
0N/A }
0N/A
0N/A }
2741N/A
2751N/A //------------------------- JDBC 4.1 -----------------------------------
2751N/A public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
2751N/A throw new SQLFeatureNotSupportedException("Not supported yet.");
2751N/A }
2751N/A
2751N/A public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
2751N/A throw new SQLFeatureNotSupportedException("Not supported yet.");
2751N/A }
2751N/A
2741N/A static final long serialVersionUID =1884577171200622428L;
0N/A}