jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
changeset 11129 f9ad1aadf3fa
parent 9537 bfddc73b74b9
child 11683 5e02efd89af6
equal deleted inserted replaced
11128:ffb869e392cf 11129:f9ad1aadf3fa
   355             throw new RuntimeException(ioe);
   355             throw new RuntimeException(ioe);
   356         }
   356         }
   357 
   357 
   358         // set the Reader, this maybe overridden latter
   358         // set the Reader, this maybe overridden latter
   359         provider =
   359         provider =
   360         (SyncProvider)SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
   360         SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
   361 
   361 
   362         if (!(provider instanceof RIOptimisticProvider)) {
   362         if (!(provider instanceof RIOptimisticProvider)) {
   363             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString());
   363             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString());
   364         }
   364         }
   365 
   365 
   443      * and <code>SyncProvider</code> specificiations later in this document.
   443      * and <code>SyncProvider</code> specificiations later in this document.
   444      * <p>
   444      * <p>
   445      * @param env a <code>Hashtable</code> object with a list of desired
   445      * @param env a <code>Hashtable</code> object with a list of desired
   446      *        synchronization providers
   446      *        synchronization providers
   447      * @throws SQLException if the requested provider cannot be found by the
   447      * @throws SQLException if the requested provider cannot be found by the
   448      * synchonization factory
   448      * synchronization factory
   449      * @see SyncProvider
   449      * @see SyncProvider
   450      */
   450      */
   451 
   451     public CachedRowSetImpl(@SuppressWarnings("rawtypes") Hashtable env) throws SQLException {
   452     public CachedRowSetImpl(Hashtable env) throws SQLException {
       
   453 
   452 
   454 
   453 
   455         try {
   454         try {
   456            resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
   455            resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
   457         } catch(IOException ioe) {
   456         } catch(IOException ioe) {
   465         String providerName = (String)env.get(
   464         String providerName = (String)env.get(
   466         javax.sql.rowset.spi.SyncFactory.ROWSET_SYNC_PROVIDER);
   465         javax.sql.rowset.spi.SyncFactory.ROWSET_SYNC_PROVIDER);
   467 
   466 
   468         // set the Reader, this maybe overridden latter
   467         // set the Reader, this maybe overridden latter
   469         provider =
   468         provider =
   470         (SyncProvider)SyncFactory.getInstance(providerName);
   469         SyncFactory.getInstance(providerName);
   471 
   470 
   472         rowSetReader = provider.getRowSetReader();
   471         rowSetReader = provider.getRowSetReader();
   473         rowSetWriter = provider.getRowSetWriter();
   472         rowSetWriter = provider.getRowSetWriter();
   474 
   473 
   475         initParams(); // allocate the parameters collection
   474         initParams(); // allocate the parameters collection
   523 
   522 
   524         //Instantiating the vector for MatchColumns
   523         //Instantiating the vector for MatchColumns
   525 
   524 
   526         iMatchColumns = new Vector<Integer>(10);
   525         iMatchColumns = new Vector<Integer>(10);
   527         for(int i = 0; i < 10 ; i++) {
   526         for(int i = 0; i < 10 ; i++) {
   528            iMatchColumns.add(i,Integer.valueOf(-1));
   527            iMatchColumns.add(i, -1);
   529         }
   528         }
   530 
   529 
   531         strMatchColumns = new Vector<String>(10);
   530         strMatchColumns = new Vector<String>(10);
   532         for(int j = 0; j < 10; j++) {
   531         for(int j = 0; j < 10; j++) {
   533            strMatchColumns.add(j,null);
   532            strMatchColumns.add(j,null);
   538      * Determine whether the SyncProvider's writer implements the
   537      * Determine whether the SyncProvider's writer implements the
   539      * <code>TransactionalWriter<code> interface
   538      * <code>TransactionalWriter<code> interface
   540      */
   539      */
   541     private void checkTransactionalWriter() {
   540     private void checkTransactionalWriter() {
   542         if (rowSetWriter != null) {
   541         if (rowSetWriter != null) {
   543             Class c = rowSetWriter.getClass();
   542             Class<?> c = rowSetWriter.getClass();
   544             if (c != null) {
   543             if (c != null) {
   545                 Class[] theInterfaces = c.getInterfaces();
   544                 Class[] theInterfaces = c.getInterfaces();
   546                 for (int i = 0; i < theInterfaces.length; i++) {
   545                 for (int i = 0; i < theInterfaces.length; i++) {
   547                     if ((theInterfaces[i].getName()).indexOf("TransactionalWriter") > 0) {
   546                     if ((theInterfaces[i].getName()).indexOf("TransactionalWriter") > 0) {
   548                         tXWriter = true;
   547                         tXWriter = true;
   683                         obj = new SerialArray((java.sql.Array)obj, map);
   682                         obj = new SerialArray((java.sql.Array)obj, map);
   684                     else
   683                     else
   685                         obj = new SerialArray((java.sql.Array)obj);
   684                         obj = new SerialArray((java.sql.Array)obj);
   686                 }
   685                 }
   687 
   686 
   688                 ((Row)currentRow).initColumnObject(i, obj);
   687                 currentRow.initColumnObject(i, obj);
   689             }
   688             }
   690             rowsFetched++;
   689             rowsFetched++;
   691             rvh.add(currentRow);
   690             rvh.add(currentRow);
   692         }
   691         }
   693 
   692 
   879                 saveCursorPos = cursorPos;
   878                 saveCursorPos = cursorPos;
   880                 conflict = rowSetWriter.writeData((RowSetInternal)this);
   879                 conflict = rowSetWriter.writeData((RowSetInternal)this);
   881                 cursorPos = saveCursorPos;
   880                 cursorPos = saveCursorPos;
   882             }
   881             }
   883 
   882 
   884             if ((tXWriter) && this.COMMIT_ON_ACCEPT_CHANGES) {
   883             if (tXWriter) {
   885                 // do commit/rollback's here
   884                 // do commit/rollback's here
   886                 if (!conflict) {
   885                 if (!conflict) {
   887                     tWriter = (TransactionalWriter)rowSetWriter;
   886                     tWriter = (TransactionalWriter)rowSetWriter;
   888                     tWriter.rollback();
   887                     tWriter.rollback();
   889                     success = false;
   888                     success = false;
   899                 }
   898                 }
   900             }
   899             }
   901 
   900 
   902             if (success == true) {
   901             if (success == true) {
   903                 setOriginal();
   902                 setOriginal();
   904             } else if (!(success) && !(this.COMMIT_ON_ACCEPT_CHANGES)) {
   903             } else if (!(success) ) {
   905                 throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.accfailed").toString());
   904                 throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.accfailed").toString());
   906             }
   905             }
   907 
   906 
   908         } catch (SyncProviderException spe) {
   907         } catch (SyncProviderException spe) {
   909                throw spe;
   908                throw spe;
   936      * @see javax.sql.RowSetWriter
   935      * @see javax.sql.RowSetWriter
   937      * @see javax.sql.rowset.spi.SyncFactory
   936      * @see javax.sql.rowset.spi.SyncFactory
   938      * @see javax.sql.rowset.spi.SyncProvider
   937      * @see javax.sql.rowset.spi.SyncProvider
   939      */
   938      */
   940     public void acceptChanges(Connection con) throws SyncProviderException{
   939     public void acceptChanges(Connection con) throws SyncProviderException{
   941 
       
   942       setConnection(con);
   940       setConnection(con);
   943       acceptChanges();
   941       acceptChanges();
   944 
       
   945     }
   942     }
   946 
   943 
   947     /**
   944     /**
   948      * Restores this <code>CachedRowSetImpl</code> object to its original state,
   945      * Restores this <code>CachedRowSetImpl</code> object to its original state,
   949      * that is, its state before the last set of changes.
   946      * that is, its state before the last set of changes.
   955      *           state to the definied original value.
   952      *           state to the definied original value.
   956      * @see javax.sql.RowSetListener#rowSetChanged
   953      * @see javax.sql.RowSetListener#rowSetChanged
   957      */
   954      */
   958     public void restoreOriginal() throws SQLException {
   955     public void restoreOriginal() throws SQLException {
   959         Row currentRow;
   956         Row currentRow;
   960         for (Iterator i = rvh.iterator(); i.hasNext();) {
   957         for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
   961             currentRow = (Row)i.next();
   958             currentRow = (Row)i.next();
   962             if (currentRow.getInserted() == true) {
   959             if (currentRow.getInserted() == true) {
   963                 i.remove();
   960                 i.remove();
   964                 --numRows;
   961                 --numRows;
   965             } else {
   962             } else {
  1285     public Collection<?> toCollection() throws SQLException {
  1282     public Collection<?> toCollection() throws SQLException {
  1286 
  1283 
  1287         TreeMap<Integer, Object> tMap = new TreeMap<>();
  1284         TreeMap<Integer, Object> tMap = new TreeMap<>();
  1288 
  1285 
  1289         for (int i = 0; i<numRows; i++) {
  1286         for (int i = 0; i<numRows; i++) {
  1290             tMap.put(Integer.valueOf(i), rvh.get(i));
  1287             tMap.put(i, rvh.get(i));
  1291         }
  1288         }
  1292 
  1289 
  1293         return (tMap.values());
  1290         return (tMap.values());
  1294     }
  1291     }
  1295 
  1292 
  1377      * @throws SQLException if an error occurs while resetting the
  1374      * @throws SQLException if an error occurs while resetting the
  1378      *          <code>SyncProvider</code>.
  1375      *          <code>SyncProvider</code>.
  1379      */
  1376      */
  1380     public void setSyncProvider(String providerStr) throws SQLException {
  1377     public void setSyncProvider(String providerStr) throws SQLException {
  1381         provider =
  1378         provider =
  1382         (SyncProvider)SyncFactory.getInstance(providerStr);
  1379         SyncFactory.getInstance(providerStr);
  1383 
  1380 
  1384         rowSetReader = provider.getRowSetReader();
  1381         rowSetReader = provider.getRowSetReader();
  1385         rowSetWriter = provider.getRowSetWriter();
  1382         rowSetWriter = provider.getRowSetWriter();
  1386     }
  1383     }
  1387 
  1384 
  1878         value = getCurrentRow().getColumnObject(columnIndex);
  1875         value = getCurrentRow().getColumnObject(columnIndex);
  1879 
  1876 
  1880         // check for SQL NULL
  1877         // check for SQL NULL
  1881         if (value == null) {
  1878         if (value == null) {
  1882             setLastValueNull(true);
  1879             setLastValueNull(true);
  1883             return (int)0;
  1880             return 0;
  1884         }
  1881         }
  1885 
  1882 
  1886         try {
  1883         try {
  1887             return ((Integer.valueOf(value.toString().trim())).intValue());
  1884             return ((Integer.valueOf(value.toString().trim())).intValue());
  1888         } catch (NumberFormatException ex) {
  1885         } catch (NumberFormatException ex) {
  2351             }
  2348             }
  2352         } catch (java.io.UnsupportedEncodingException ex) {
  2349         } catch (java.io.UnsupportedEncodingException ex) {
  2353             throw new SQLException(ex.getMessage());
  2350             throw new SQLException(ex.getMessage());
  2354         }
  2351         }
  2355 
  2352 
  2356         return (java.io.InputStream)asciiStream;
  2353         return asciiStream;
  2357     }
  2354     }
  2358 
  2355 
  2359     /**
  2356     /**
  2360      * A column value can be retrieved as a stream of Unicode characters
  2357      * A column value can be retrieved as a stream of Unicode characters
  2361      * and then read in chunks from the stream.  This method is particularly
  2358      * and then read in chunks from the stream.  This method is particularly
  2397             return null;
  2394             return null;
  2398         }
  2395         }
  2399 
  2396 
  2400         unicodeStream = new StringBufferInputStream(value.toString());
  2397         unicodeStream = new StringBufferInputStream(value.toString());
  2401 
  2398 
  2402         return (java.io.InputStream)unicodeStream;
  2399         return unicodeStream;
  2403     }
  2400     }
  2404 
  2401 
  2405     /**
  2402     /**
  2406      * Retrieves the value of the designated column in the current row of this
  2403      * Retrieves the value of the designated column in the current row of this
  2407      * <code>CachedRowSetImpl</code> object as a <code>java.io.InputStream</code>
  2404      * <code>CachedRowSetImpl</code> object as a <code>java.io.InputStream</code>
  2452             return null;
  2449             return null;
  2453         }
  2450         }
  2454 
  2451 
  2455         binaryStream = new ByteArrayInputStream((byte[])value);
  2452         binaryStream = new ByteArrayInputStream((byte[])value);
  2456 
  2453 
  2457         return (java.io.InputStream)binaryStream;
  2454         return binaryStream;
  2458 
  2455 
  2459     }
  2456     }
  2460 
  2457 
  2461 
  2458 
  2462     // Methods for accessing results by column name
  2459     // Methods for accessing results by column name
  2956         }
  2953         }
  2957         if (value instanceof Struct) {
  2954         if (value instanceof Struct) {
  2958             Struct s = (Struct)value;
  2955             Struct s = (Struct)value;
  2959             map = getTypeMap();
  2956             map = getTypeMap();
  2960             // look up the class in the map
  2957             // look up the class in the map
  2961             Class c = (Class)map.get(s.getSQLTypeName());
  2958             Class<?> c = map.get(s.getSQLTypeName());
  2962             if (c != null) {
  2959             if (c != null) {
  2963                 // create new instance of the class
  2960                 // create new instance of the class
  2964                 SQLData obj = null;
  2961                 SQLData obj = null;
  2965                 try {
  2962                 try {
  2966                     obj = (SQLData)c.newInstance();
  2963                     obj = (SQLData)c.newInstance();
  3089             charStream = new StringReader(value.toString());
  3086             charStream = new StringReader(value.toString());
  3090         } else {
  3087         } else {
  3091             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
  3088             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
  3092         }
  3089         }
  3093 
  3090 
  3094         return (java.io.Reader)charStream;
  3091         return charStream;
  3095     }
  3092     }
  3096 
  3093 
  3097     /**
  3094     /**
  3098      * Retrieves the value stored in the designated column
  3095      * Retrieves the value stored in the designated column
  3099      * of the current row as a <code>java.io.Reader</code> object.
  3096      * of the current row as a <code>java.io.Reader</code> object.
  4004 
  4001 
  4005         try {
  4002         try {
  4006             switch (trgType) {
  4003             switch (trgType) {
  4007                 case java.sql.Types.BIT:
  4004                 case java.sql.Types.BIT:
  4008                     Integer i = Integer.valueOf(srcObj.toString().trim());
  4005                     Integer i = Integer.valueOf(srcObj.toString().trim());
  4009                     return i.equals(Integer.valueOf((int)0)) ?
  4006                     return i.equals(0) ?
  4010                     Boolean.valueOf(false) :
  4007                     Boolean.valueOf(false) :
  4011                         Boolean.valueOf(true);
  4008                         Boolean.valueOf(true);
  4012                 case java.sql.Types.TINYINT:
  4009                 case java.sql.Types.TINYINT:
  4013                     return Byte.valueOf(srcObj.toString().trim());
  4010                     return Byte.valueOf(srcObj.toString().trim());
  4014                 case java.sql.Types.SMALLINT:
  4011                 case java.sql.Types.SMALLINT:
  4171 
  4168 
  4172         try {
  4169         try {
  4173             switch (trgType) {
  4170             switch (trgType) {
  4174                 case java.sql.Types.BIT:
  4171                 case java.sql.Types.BIT:
  4175                     Integer i = Integer.valueOf(srcObj.toString().trim());
  4172                     Integer i = Integer.valueOf(srcObj.toString().trim());
  4176                     return i.equals(Integer.valueOf((int)0)) ?
  4173                     return i.equals(0) ?
  4177                     Boolean.valueOf(false) :
  4174                     Boolean.valueOf(false) :
  4178                         Boolean.valueOf(true);
  4175                         Boolean.valueOf(true);
  4179                 case java.sql.Types.BOOLEAN:
  4176                 case java.sql.Types.BOOLEAN:
  4180                     return Boolean.valueOf(srcObj.toString().trim());
  4177                     return Boolean.valueOf(srcObj.toString().trim());
  4181                 default:
  4178                 default:
  4356     public void updateInt(int columnIndex, int x) throws SQLException {
  4353     public void updateInt(int columnIndex, int x) throws SQLException {
  4357         // sanity check.
  4354         // sanity check.
  4358         checkIndex(columnIndex);
  4355         checkIndex(columnIndex);
  4359         // make sure the cursor is on a valid row
  4356         // make sure the cursor is on a valid row
  4360         checkCursor();
  4357         checkCursor();
  4361         Object obj = convertNumeric(Integer.valueOf(x),
  4358         Object obj = convertNumeric(x,
  4362         java.sql.Types.INTEGER,
  4359         java.sql.Types.INTEGER,
  4363         RowSetMD.getColumnType(columnIndex));
  4360         RowSetMD.getColumnType(columnIndex));
  4364 
  4361 
  4365         getCurrentRow().setColumnObject(columnIndex, obj);
  4362         getCurrentRow().setColumnObject(columnIndex, obj);
  4366     }
  4363     }
  5707         }
  5704         }
  5708         if (value instanceof Struct) {
  5705         if (value instanceof Struct) {
  5709             Struct s = (Struct)value;
  5706             Struct s = (Struct)value;
  5710 
  5707 
  5711             // look up the class in the map
  5708             // look up the class in the map
  5712             Class c = (Class)map.get(s.getSQLTypeName());
  5709             Class<?> c = map.get(s.getSQLTypeName());
  5713             if (c != null) {
  5710             if (c != null) {
  5714                 // create new instance of the class
  5711                 // create new instance of the class
  5715                 SQLData obj = null;
  5712                 SQLData obj = null;
  5716                 try {
  5713                 try {
  5717                     obj = (SQLData)c.newInstance();
  5714                     obj = (SQLData)c.newInstance();
  6291         //crs.setReader(null);
  6288         //crs.setReader(null);
  6292         //crs.setWriter(null);
  6289         //crs.setWriter(null);
  6293         int colCount = RowSetMD.getColumnCount();
  6290         int colCount = RowSetMD.getColumnCount();
  6294         Row orig;
  6291         Row orig;
  6295 
  6292 
  6296         for (Iterator i = rvh.iterator(); i.hasNext();) {
  6293         for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
  6297             orig = new Row(colCount, ((Row)i.next()).getOrigRow());
  6294             orig = new Row(colCount, ((Row)i.next()).getOrigRow());
  6298             crs.rvh.add(orig);
  6295             crs.rvh.add(orig);
  6299         }
  6296         }
  6300         return (ResultSet)crs;
  6297         return (ResultSet)crs;
  6301     }
  6298     }
  6377      * Calls to the method <code>setOriginal</code> connot be reversed.
  6374      * Calls to the method <code>setOriginal</code> connot be reversed.
  6378      *
  6375      *
  6379      * @throws SQLException if an error occurs
  6376      * @throws SQLException if an error occurs
  6380      */
  6377      */
  6381     public void setOriginal() throws SQLException {
  6378     public void setOriginal() throws SQLException {
  6382         for (Iterator i = rvh.iterator(); i.hasNext();) {
  6379         for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
  6383             Row row = (Row)i.next();
  6380             Row row = (Row)i.next();
  6384             makeRowOriginal(row);
  6381             makeRowOriginal(row);
  6385             // remove deleted rows from the collection.
  6382             // remove deleted rows from the collection.
  6386             if (row.getDeleted() == true) {
  6383             if (row.getDeleted() == true) {
  6387                 i.remove();
  6384                 i.remove();
  6928                throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols").toString());
  6925                throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols").toString());
  6929             }
  6926             }
  6930          }
  6927          }
  6931 
  6928 
  6932          for( int i = 0;i < columnIdxes.length ;i++) {
  6929          for( int i = 0;i < columnIdxes.length ;i++) {
  6933             iMatchColumns.set(i,Integer.valueOf(-1));
  6930             iMatchColumns.set(i, -1);
  6934          }
  6931          }
  6935     }
  6932     }
  6936 
  6933 
  6937    /**
  6934    /**
  6938      * Unsets the designated parameter to the given String array.
  6935      * Unsets the designated parameter to the given String array.
  6996 
  6993 
  6997         Integer []int_temp = new Integer[iMatchColumns.size()];
  6994         Integer []int_temp = new Integer[iMatchColumns.size()];
  6998         int [] i_temp = new int[iMatchColumns.size()];
  6995         int [] i_temp = new int[iMatchColumns.size()];
  6999         int i_val;
  6996         int i_val;
  7000 
  6997 
  7001         i_val = ((Integer)iMatchColumns.get(0)).intValue();
  6998         i_val = iMatchColumns.get(0);
  7002 
  6999 
  7003         if( i_val == -1 ) {
  7000         if( i_val == -1 ) {
  7004            throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString());
  7001            throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString());
  7005         }
  7002         }
  7006 
  7003 
  7037            if( columnIdxes[j] < 0 ) {
  7034            if( columnIdxes[j] < 0 ) {
  7038               throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
  7035               throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
  7039            }
  7036            }
  7040         }
  7037         }
  7041         for(int i = 0 ;i < columnIdxes.length; i++) {
  7038         for(int i = 0 ;i < columnIdxes.length; i++) {
  7042            iMatchColumns.add(i,Integer.valueOf(columnIdxes[i]));
  7039            iMatchColumns.add(i,columnIdxes[i]);
  7043         }
  7040         }
  7044     }
  7041     }
  7045 
  7042 
  7046     /**
  7043     /**
  7047      * Sets the designated parameter to the given String array.
  7044      * Sets the designated parameter to the given String array.
  7092         // validate, if col is ok to be set
  7089         // validate, if col is ok to be set
  7093         if(columnIdx < 0) {
  7090         if(columnIdx < 0) {
  7094             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
  7091             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
  7095         } else {
  7092         } else {
  7096             // set iMatchColumn
  7093             // set iMatchColumn
  7097             iMatchColumns.set(0, Integer.valueOf(columnIdx));
  7094             iMatchColumns.set(0, columnIdx);
  7098             //strMatchColumn = null;
  7095             //strMatchColumn = null;
  7099         }
  7096         }
  7100     }
  7097     }
  7101 
  7098 
  7102     /**
  7099     /**
  7145             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
  7142             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
  7146         } else if(strMatchColumns.get(0) != null) {
  7143         } else if(strMatchColumns.get(0) != null) {
  7147             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch1").toString());
  7144             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch1").toString());
  7148         } else {
  7145         } else {
  7149                 // that is, we are unsetting it.
  7146                 // that is, we are unsetting it.
  7150                iMatchColumns.set(0, Integer.valueOf(-1));
  7147                iMatchColumns.set(0, -1);
  7151         }
  7148         }
  7152     }
  7149     }
  7153 
  7150 
  7154     /**
  7151     /**
  7155      * Unsets the designated parameter to the given <code>String</code>
  7152      * Unsets the designated parameter to the given <code>String</code>
  7169         // check if we are unsetting the same column
  7166         // check if we are unsetting the same column
  7170         columnName = columnName.trim();
  7167         columnName = columnName.trim();
  7171 
  7168 
  7172         if(!((strMatchColumns.get(0)).equals(columnName))) {
  7169         if(!((strMatchColumns.get(0)).equals(columnName))) {
  7173             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
  7170             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
  7174         } else if( ((Integer)(iMatchColumns.get(0))).intValue() > 0) {
  7171         } else if(iMatchColumns.get(0) > 0) {
  7175             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch2").toString());
  7172             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch2").toString());
  7176         } else {
  7173         } else {
  7177             strMatchColumns.set(0, null);   // that is, we are unsetting it.
  7174             strMatchColumns.set(0, null);   // that is, we are unsetting it.
  7178         }
  7175         }
  7179     }
  7176     }
  7367                     obj = new SerialClob((Clob)obj);
  7364                     obj = new SerialClob((Clob)obj);
  7368                 } else if (obj instanceof java.sql.Array) {
  7365                 } else if (obj instanceof java.sql.Array) {
  7369                     obj = new SerialArray((java.sql.Array)obj, map);
  7366                     obj = new SerialArray((java.sql.Array)obj, map);
  7370                 }
  7367                 }
  7371 
  7368 
  7372                 ((Row)currentRow).initColumnObject(i, obj);
  7369                 currentRow.initColumnObject(i, obj);
  7373             }
  7370             }
  7374             rowsFetched++;
  7371             rowsFetched++;
  7375             maxRowsreached++;
  7372             maxRowsreached++;
  7376             rvh.add(currentRow);
  7373             rvh.add(currentRow);
  7377         }
  7374         }