J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | package com.sun.rowset; |
| 27 | |
| 28 | import java.sql.*; |
| 29 | import javax.sql.*; |
| 30 | import javax.naming.*; |
| 31 | import java.io.*; |
| 32 | import java.math.*; |
| 33 | import java.util.*; |
| 34 | |
| 35 | import javax.sql.rowset.*; |
| 36 | |
| 37 | /** |
| 38 | * The standard implementation of the <code>JoinRowSet</code> |
| 39 | * interface providing an SQL <code>JOIN</code> between <code>RowSet</code> |
| 40 | * objects. |
| 41 | * <P> |
| 42 | * The implementation provides an ANSI-style <code>JOIN</code> providing an |
| 43 | * inner join between two tables. Any unmatched rows in either table of the |
| 44 | * join are discarded. |
| 45 | * <p> |
| 46 | * Typically, a <code>JoinRowSet</code> implementation is leveraged by |
| 47 | * <code>RowSet</code> instances that are in a disconnected environment and |
| 48 | * thus do not have the luxury of an open connection to the data source to |
| 49 | * establish logical relationships between themselves. In other words, it is |
| 50 | * largely <code>CachedRowSet</code> objects and implementations derived from |
| 51 | * the <code>CachedRowSet</code> interface that will use the <code>JoinRowSetImpl</code> |
| 52 | * implementation. |
| 53 | * |
| 54 | * @author Amit Handa, Jonathan Bruce |
| 55 | */ |
| 56 | public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { |
| 57 | /** |
| 58 | * A <code>Vector</code> object that contains the <code>RowSet</code> objects |
| 59 | * that have been added to this <code>JoinRowSet</code> object. |
| 60 | */ |
| 61 | private Vector vecRowSetsInJOIN; |
| 62 | |
| 63 | /** |
| 64 | * The <code>CachedRowSet</code> object that encapsulates this |
| 65 | * <code>JoinRowSet</code> object. |
| 66 | * When <code>RowSet</code> objects are added to this <code>JoinRowSet</code> |
| 67 | * object, they are also added to <i>crsInternal</i> to form the same kind of |
| 68 | * SQL <code>JOIN</code>. As a result, methods for making updates to this |
| 69 | * <code>JoinRowSet</code> object can use <i>crsInternal</i> methods in their |
| 70 | * implementations. |
| 71 | */ |
| 72 | private CachedRowSetImpl crsInternal; |
| 73 | |
| 74 | /** |
| 75 | * A <code>Vector</code> object containing the types of join that have been set |
| 76 | * for this <code>JoinRowSet</code> object. |
| 77 | * The last join type set forms the basis of succeeding joins. |
| 78 | */ |
| 79 | private Vector vecJoinType; |
| 80 | |
| 81 | /** |
| 82 | * A <code>Vector</code> object containing the names of all the tables entering |
| 83 | * the join. |
| 84 | */ |
| 85 | private Vector vecTableNames; |
| 86 | |
| 87 | /** |
| 88 | * An <code>int</code> that indicates the column index of the match column. |
| 89 | */ |
| 90 | private int iMatchKey; |
| 91 | |
| 92 | /** |
| 93 | * A <code>String</code> object that stores the name of the match column. |
| 94 | */ |
| 95 | private String strMatchKey ; |
| 96 | |
| 97 | /** |
| 98 | * An array of <code>boolean</code> values indicating the types of joins supported |
| 99 | * by this <code>JoinRowSet</code> implementation. |
| 100 | */ |
| 101 | boolean[] supportedJOINs; |
| 102 | |
| 103 | /** |
| 104 | * The <code>WebRowSet</code> object that encapsulates this <code>JoinRowSet</code> |
| 105 | * object. This <code>WebRowSet</code> object allows this <code>JoinRowSet</code> |
| 106 | * object to leverage the properties and methods of a <code>WebRowSet</code> |
| 107 | * object. |
| 108 | */ |
| 109 | private WebRowSet wrs; |
| 110 | |
| 111 | |
| 112 | /** |
| 113 | * Constructor for <code>JoinRowSetImpl</code> class. Configures various internal data |
| 114 | * structures to provide mechanisms required for <code>JoinRowSet</code> interface |
| 115 | * implementation. |
| 116 | * |
| 117 | * @throws SQLException if an error occurs in instantiating an instance of |
| 118 | * <code>JoinRowSetImpl</code> |
| 119 | */ |
| 120 | public JoinRowSetImpl() throws SQLException { |
| 121 | |
| 122 | vecRowSetsInJOIN = new Vector(); |
| 123 | crsInternal = new CachedRowSetImpl(); |
| 124 | vecJoinType = new Vector(); |
| 125 | vecTableNames = new Vector(); |
| 126 | iMatchKey = -1; |
| 127 | strMatchKey = null; |
| 128 | supportedJOINs = |
| 129 | new boolean[] {false, true, false, false, false}; |
| 130 | |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Adds the given <code>RowSet</code> object to this |
| 135 | * <code>JoinRowSet</code> object. If this |
| 136 | * rowset is the first to be added to the <code>JoinRowSet</code> |
| 137 | * object, it forms the basis for the <code>JOIN</code> |
| 138 | * relationships to be formed. |
| 139 | * <p> |
| 140 | * This method should be used when the given <code>RowSet</code> object |
| 141 | * already has a match column set. |
| 142 | * |
| 143 | * @param rowset the <code>RowSet</code> object that implements the |
| 144 | * <code>Joinable</code> interface and is to be added |
| 145 | * to this <code>JoinRowSet</code> object |
| 146 | * @throws SQLException if an empty <code>RowSet</code> is added to the to the |
| 147 | * <code>JoinRowSet</code>; if a match column is not set; or if an |
| 148 | * additional <code>RowSet</code> violates the active <code>JOIN</code> |
| 149 | * @see CachedRowSet#setMatchColumn |
| 150 | */ |
| 151 | public void addRowSet(Joinable rowset) throws SQLException { |
| 152 | boolean boolColId, boolColName; |
| 153 | |
| 154 | boolColId = false; |
| 155 | boolColName = false; |
| 156 | CachedRowSetImpl cRowset; |
| 157 | |
| 158 | if(!(rowset instanceof RowSet)) { |
| 159 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.notinstance").toString()); |
| 160 | } |
| 161 | |
| 162 | if(rowset instanceof JdbcRowSetImpl ) { |
| 163 | cRowset = new CachedRowSetImpl(); |
| 164 | cRowset.populate((RowSet)rowset); |
| 165 | if(cRowset.size() == 0){ |
| 166 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.emptyrowset").toString()); |
| 167 | } |
| 168 | |
| 169 | |
| 170 | try { |
| 171 | int matchColumnCount = 0; |
| 172 | for(int i=0; i< rowset.getMatchColumnIndexes().length; i++) { |
| 173 | if(rowset.getMatchColumnIndexes()[i] != -1) |
| 174 | ++ matchColumnCount; |
| 175 | else |
| 176 | break; |
| 177 | } |
| 178 | int[] pCol = new int[matchColumnCount]; |
| 179 | for(int i=0; i<matchColumnCount; i++) |
| 180 | pCol[i] = rowset.getMatchColumnIndexes()[i]; |
| 181 | cRowset.setMatchColumn(pCol); |
| 182 | } catch(SQLException sqle) { |
| 183 | |
| 184 | } |
| 185 | |
| 186 | } else { |
| 187 | cRowset = (CachedRowSetImpl)rowset; |
| 188 | if(cRowset.size() == 0){ |
| 189 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.emptyrowset").toString()); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | // Either column id or column name will be set |
| 194 | // If both not set throw exception. |
| 195 | |
| 196 | try { |
| 197 | iMatchKey = (cRowset.getMatchColumnIndexes())[0]; |
| 198 | } catch(SQLException sqle) { |
| 199 | //if not set catch the exception but do nothing now. |
| 200 | boolColId = true; |
| 201 | } |
| 202 | |
| 203 | try { |
| 204 | strMatchKey = (cRowset.getMatchColumnNames())[0]; |
| 205 | } catch(SQLException sqle) { |
| 206 | //if not set catch the exception but do nothing now. |
| 207 | boolColName = true; |
| 208 | } |
| 209 | |
| 210 | if(boolColId && boolColName) { |
| 211 | // neither setter methods have been used to set |
| 212 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.matchnotset").toString()); |
| 213 | } else { |
| 214 | //if(boolColId || boolColName) |
| 215 | // either of the setter methods have been set. |
| 216 | if(boolColId){ |
| 217 | // |
| 218 | ArrayList indices = new ArrayList(); |
| 219 | for(int i=0;i<cRowset.getMatchColumnNames().length;i++) { |
| 220 | if( (strMatchKey = (cRowset.getMatchColumnNames())[i]) != null) { |
| 221 | iMatchKey = cRowset.findColumn(strMatchKey); |
| 222 | indices.add(iMatchKey); |
| 223 | } |
| 224 | else |
| 225 | break; |
| 226 | } |
| 227 | int[] indexes = new int[indices.size()]; |
| 228 | for(int i=0; i<indices.size();i++) |
| 229 | indexes[i] = ((Integer)indices.get(i)).intValue(); |
| 230 | cRowset.setMatchColumn(indexes); |
| 231 | // Set the match column here because join will be |
| 232 | // based on columnId, |
| 233 | // (nested for loop in initJOIN() checks for equality |
| 234 | // based on columnIndex) |
| 235 | } else { |
| 236 | //do nothing, iMatchKey is set. |
| 237 | } |
| 238 | // Now both iMatchKey and strMatchKey have been set pointing |
| 239 | // to the same column |
| 240 | } |
| 241 | |
| 242 | // Till first rowset setJoinType may not be set because |
| 243 | // default type is JoinRowSet.INNER_JOIN which should |
| 244 | // be set and for subsequent additions of rowset, if not set |
| 245 | // keep on adding join type as JoinRowSet.INNER_JOIN |
| 246 | // to vecJoinType. |
| 247 | |
| 248 | initJOIN(cRowset); |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Adds the given <code>RowSet</code> object to the <code>JOIN</code> relation |
| 253 | * and sets the designated column as the match column. |
| 254 | * If the given <code>RowSet</code> |
| 255 | * object is the first to be added to this <code>JoinRowSet</code> |
| 256 | * object, it forms the basis of the <code>JOIN</code> relationship to be formed |
| 257 | * when other <code>RowSet</code> objects are added . |
| 258 | * <P> |
| 259 | * This method should be used when the given <code>RowSet</code> object |
| 260 | * does not already have a match column set. |
| 261 | * |
| 262 | * @param rowset a <code>RowSet</code> object to be added to |
| 263 | * the <code>JOIN</code> relation; must implement the <code>Joinable</code> |
| 264 | * interface |
| 265 | * @param columnIdx an <code>int</code> giving the index of the column to be set as |
| 266 | * the match column |
| 267 | * @throws SQLException if (1) an empty <code>RowSet</code> object is added to this |
| 268 | * <code>JoinRowSet</code> object, (2) a match column has not been set, |
| 269 | * or (3) the <code>RowSet</code> object being added violates the active |
| 270 | * <code>JOIN</code> |
| 271 | * @see CachedRowSet#unsetMatchColumn |
| 272 | */ |
| 273 | public void addRowSet(RowSet rowset, int columnIdx) throws SQLException { |
| 274 | //passing the rowset as well as the columnIdx to form the joinrowset. |
| 275 | |
| 276 | ((CachedRowSetImpl)rowset).setMatchColumn(columnIdx); |
| 277 | |
| 278 | addRowSet((Joinable)rowset); |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Adds the given <code>RowSet</code> object to the <code>JOIN</code> relationship |
| 283 | * and sets the designated column as the match column. If the given |
| 284 | * <code>RowSet</code> |
| 285 | * object is the first to be added to this <code>JoinRowSet</code> |
| 286 | * object, it forms the basis of the <code>JOIN</code> relationship to be formed |
| 287 | * when other <code>RowSet</code> objects are added . |
| 288 | * <P> |
| 289 | * This method should be used when the given <code>RowSet</code> object |
| 290 | * does not already have a match column set. |
| 291 | * |
| 292 | * @param rowset a <code>RowSet</code> object to be added to |
| 293 | * the <code>JOIN</code> relation |
| 294 | * @param columnName a <code>String</code> object giving the name of the column |
| 295 | * to be set as the match column; must implement the <code>Joinable</code> |
| 296 | * interface |
| 297 | * @throws SQLException if (1) an empty <code>RowSet</code> object is added to this |
| 298 | * <code>JoinRowSet</code> object, (2) a match column has not been set, |
| 299 | * or (3) the <code>RowSet</code> object being added violates the active |
| 300 | * <code>JOIN</code> |
| 301 | */ |
| 302 | public void addRowSet(RowSet rowset, String columnName) throws SQLException { |
| 303 | //passing the rowset as well as the columnIdx to form the joinrowset. |
| 304 | ((CachedRowSetImpl)rowset).setMatchColumn(columnName); |
| 305 | addRowSet((Joinable)rowset); |
| 306 | } |
| 307 | |
| 308 | /** |
| 309 | * Adds the given <code>RowSet</code> objects to the <code>JOIN</code> relationship |
| 310 | * and sets the designated columns as the match columns. If the first |
| 311 | * <code>RowSet</code> object in the array of <code>RowSet</code> objects |
| 312 | * is the first to be added to this <code>JoinRowSet</code> |
| 313 | * object, it forms the basis of the <code>JOIN</code> relationship to be formed |
| 314 | * when other <code>RowSet</code> objects are added. |
| 315 | * <P> |
| 316 | * The first <code>int</code> |
| 317 | * in <i>columnIdx</i> is used to set the match column for the first |
| 318 | * <code>RowSet</code> object in <i>rowset</i>, the second <code>int</code> |
| 319 | * in <i>columnIdx</i> is used to set the match column for the second |
| 320 | * <code>RowSet</code> object in <i>rowset</i>, and so on. |
| 321 | * <P> |
| 322 | * This method should be used when the given <code>RowSet</code> objects |
| 323 | * do not already have match columns set. |
| 324 | * |
| 325 | * @param rowset an array of <code>RowSet</code> objects to be added to |
| 326 | * the <code>JOIN</code> relation; each <code>RowSet</code> object must |
| 327 | * implement the <code>Joinable</code> interface |
| 328 | * @param columnIdx an array of <code>int</code> values designating the columns |
| 329 | * to be set as the |
| 330 | * match columns for the <code>RowSet</code> objects in <i>rowset</i> |
| 331 | * @throws SQLException if the number of <code>RowSet</code> objects in |
| 332 | * <i>rowset</i> is not equal to the number of <code>int</code> values |
| 333 | * in <i>columnIdx</i> |
| 334 | */ |
| 335 | public void addRowSet(RowSet[] rowset, |
| 336 | int[] columnIdx) throws SQLException { |
| 337 | //validate if length of rowset array is same as length of int array. |
| 338 | if(rowset.length != columnIdx.length) { |
| 339 | throw new SQLException |
| 340 | (resBundle.handleGetObject("joinrowsetimpl.numnotequal").toString()); |
| 341 | } else { |
| 342 | for(int i=0; i< rowset.length; i++) { |
| 343 | ((CachedRowSetImpl)rowset[i]).setMatchColumn(columnIdx[i]); |
| 344 | addRowSet((Joinable)rowset[i]); |
| 345 | } //end for |
| 346 | } //end if |
| 347 | |
| 348 | } |
| 349 | |
| 350 | |
| 351 | /** |
| 352 | * Adds the given <code>RowSet</code> objects to the <code>JOIN</code> relationship |
| 353 | * and sets the designated columns as the match columns. If the first |
| 354 | * <code>RowSet</code> object in the array of <code>RowSet</code> objects |
| 355 | * is the first to be added to this <code>JoinRowSet</code> |
| 356 | * object, it forms the basis of the <code>JOIN</code> relationship to be formed |
| 357 | * when other <code>RowSet</code> objects are added. |
| 358 | * <P> |
| 359 | * The first <code>String</code> object |
| 360 | * in <i>columnName</i> is used to set the match column for the first |
| 361 | * <code>RowSet</code> object in <i>rowset</i>, the second <code>String</code> |
| 362 | * object in <i>columnName</i> is used to set the match column for the second |
| 363 | * <code>RowSet</code> object in <i>rowset</i>, and so on. |
| 364 | * <P> |
| 365 | * This method should be used when the given <code>RowSet</code> objects |
| 366 | * do not already have match columns set. |
| 367 | * |
| 368 | * @param rowset an array of <code>RowSet</code> objects to be added to |
| 369 | * the <code>JOIN</code> relation; each <code>RowSet</code> object must |
| 370 | * implement the <code>Joinable</code> interface |
| 371 | * @param columnName an array of <code>String</code> objects designating the columns |
| 372 | * to be set as the |
| 373 | * match columns for the <code>RowSet</code> objects in <i>rowset</i> |
| 374 | * @throws SQLException if the number of <code>RowSet</code> objects in |
| 375 | * <i>rowset</i> is not equal to the number of <code>String</code> objects |
| 376 | * in <i>columnName</i>, an empty <code>JdbcRowSet</code> is added to the |
| 377 | * <code>JoinRowSet</code>, if a match column is not set, |
| 378 | * or one or the <code>RowSet</code> objects in <i>rowset</i> violates the |
| 379 | * active <code>JOIN</code> |
| 380 | */ |
| 381 | public void addRowSet(RowSet[] rowset, |
| 382 | String[] columnName) throws SQLException { |
| 383 | //validate if length of rowset array is same as length of int array. |
| 384 | |
| 385 | if(rowset.length != columnName.length) { |
| 386 | throw new SQLException |
| 387 | (resBundle.handleGetObject("joinrowsetimpl.numnotequal").toString()); |
| 388 | } else { |
| 389 | for(int i=0; i< rowset.length; i++) { |
| 390 | ((CachedRowSetImpl)rowset[i]).setMatchColumn(columnName[i]); |
| 391 | addRowSet((Joinable)rowset[i]); |
| 392 | } //end for |
| 393 | } //end if |
| 394 | |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * Returns a Collection of the <code>RowSet</code> object instances |
| 399 | * currently residing with the instance of the <code>JoinRowSet</code> |
| 400 | * object instance. This should return the 'n' number of RowSet contained |
| 401 | * within the JOIN and maintain any updates that have occoured while in |
| 402 | * this union. |
| 403 | * |
| 404 | * @return A <code>Collection</code> of the added <code>RowSet</code> |
| 405 | * object instances |
| 406 | * @throws SQLException if an error occours generating a collection |
| 407 | * of the originating RowSets contained within the JOIN. |
| 408 | */ |
| 409 | public Collection getRowSets() throws SQLException { |
| 410 | return vecRowSetsInJOIN; |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * Returns a string array of the RowSet names currently residing |
| 415 | * with the <code>JoinRowSet</code> object instance. |
| 416 | * |
| 417 | * @return a string array of the RowSet names |
| 418 | * @throws SQLException if an error occours retrieving the RowSet names |
| 419 | * @see CachedRowSet#setTableName |
| 420 | */ |
| 421 | public String[] getRowSetNames() throws SQLException { |
| 422 | Object [] arr = vecTableNames.toArray(); |
| 423 | String []strArr = new String[arr.length]; |
| 424 | |
| 425 | for( int i = 0;i < arr.length; i++) { |
| 426 | strArr[i] = arr[i].toString(); |
| 427 | } |
| 428 | |
| 429 | return strArr; |
| 430 | } |
| 431 | |
| 432 | /** |
| 433 | * Creates a separate <code>CachedRowSet</code> object that contains the data |
| 434 | * in this <code>JoinRowSet</code> object. |
| 435 | * <P> |
| 436 | * If any updates or modifications have been applied to this <code>JoinRowSet</code> |
| 437 | * object, the <code>CachedRowSet</code> object returned by this method will |
| 438 | * not be able to persist |
| 439 | * the changes back to the originating rows and tables in the |
| 440 | * data source because the data may be from different tables. The |
| 441 | * <code>CachedRowSet</code> instance returned should not |
| 442 | * contain modification data, such as whether a row has been updated or what the |
| 443 | * original values are. Also, the <code>CachedRowSet</code> object should clear |
| 444 | * its properties pertaining to |
| 445 | * its originating SQL statement. An application should reset the |
| 446 | * SQL statement using the <code>RowSet.setCommand</code> method. |
| 447 | * <p> |
| 448 | * To persist changes back to the data source, the <code>JoinRowSet</code> object |
| 449 | * calls the method <code>acceptChanges</code>. Implementations |
| 450 | * can leverage the internal data and update tracking in their |
| 451 | * implementations to interact with the <code>SyncProvider</code> to persist any |
| 452 | * changes. |
| 453 | * |
| 454 | * @return a <code>CachedRowSet</code> object containing the contents of this |
| 455 | * <code>JoinRowSet</code> object |
| 456 | * @throws SQLException if an error occurs assembling the <code>CachedRowSet</code> |
| 457 | * object |
| 458 | * @see javax.sql.RowSet |
| 459 | * @see javax.sql.rowset.CachedRowSet |
| 460 | * @see javax.sql.rowset.spi.SyncProvider |
| 461 | */ |
| 462 | public CachedRowSet toCachedRowSet() throws SQLException { |
| 463 | return crsInternal; |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * Returns <code>true</code> if this <code>JoinRowSet</code> object supports |
| 468 | * an SQL <code>CROSS_JOIN</code> and <code>false</code> if it does not. |
| 469 | * |
| 470 | * @return <code>true</code> if the CROSS_JOIN is supported; <code>false</code> |
| 471 | * otherwise |
| 472 | */ |
| 473 | public boolean supportsCrossJoin() { |
| 474 | return supportedJOINs[JoinRowSet.CROSS_JOIN]; |
| 475 | } |
| 476 | |
| 477 | /** |
| 478 | * Returns <code>true</code> if this <code>JoinRowSet</code> object supports |
| 479 | * an SQL <code>INNER_JOIN</code> and <code>false</code> if it does not. |
| 480 | * |
| 481 | * @return true is the INNER_JOIN is supported; false otherwise |
| 482 | */ |
| 483 | public boolean supportsInnerJoin() { |
| 484 | return supportedJOINs[JoinRowSet.INNER_JOIN]; |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * Returns <code>true</code> if this <code>JoinRowSet</code> object supports |
| 489 | * an SQL <code>LEFT_OUTER_JOIN</code> and <code>false</code> if it does not. |
| 490 | * |
| 491 | * @return true is the LEFT_OUTER_JOIN is supported; false otherwise |
| 492 | */ |
| 493 | public boolean supportsLeftOuterJoin() { |
| 494 | return supportedJOINs[JoinRowSet.LEFT_OUTER_JOIN]; |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * Returns <code>true</code> if this <code>JoinRowSet</code> object supports |
| 499 | * an SQL <code>RIGHT_OUTER_JOIN</code> and <code>false</code> if it does not. |
| 500 | * |
| 501 | * @return true is the RIGHT_OUTER_JOIN is supported; false otherwise |
| 502 | */ |
| 503 | public boolean supportsRightOuterJoin() { |
| 504 | return supportedJOINs[JoinRowSet.RIGHT_OUTER_JOIN]; |
| 505 | } |
| 506 | |
| 507 | /** |
| 508 | * Returns <code>true</code> if this <code>JoinRowSet</code> object supports |
| 509 | * an SQL <code>FULL_JOIN</code> and <code>false</code> if it does not. |
| 510 | * |
| 511 | * @return true is the FULL_JOIN is supported; false otherwise |
| 512 | */ |
| 513 | public boolean supportsFullJoin() { |
| 514 | return supportedJOINs[JoinRowSet.FULL_JOIN]; |
| 515 | |
| 516 | } |
| 517 | |
| 518 | /** |
| 519 | * Sets the type of SQL <code>JOIN</code> that this <code>JoinRowSet</code> |
| 520 | * object will use. This method |
| 521 | * allows an application to adjust the type of <code>JOIN</code> imposed |
| 522 | * on tables contained within this <code>JoinRowSet</code> object and to do it |
| 523 | * on the fly. The last <code>JOIN</code> type set determines the type of |
| 524 | * <code>JOIN</code> to be performed. |
| 525 | * <P> |
| 526 | * Implementations should throw an <code>SQLException</code> if they do |
| 527 | * not support the given <code>JOIN</code> type. |
| 528 | * |
| 529 | * @param type one of the standard <code>JoinRowSet</code> constants |
| 530 | * indicating the type of <code>JOIN</code>. Must be one of the |
| 531 | * following: |
| 532 | * <code>JoinRowSet.CROSS_JOIN</code> |
| 533 | * <code>JoinRowSet.INNER_JOIN</code> |
| 534 | * <code>JoinRowSet.LEFT_OUTER_JOIN</code> |
| 535 | * <code>JoinRowSet.RIGHT_OUTER_JOIN</code>, or |
| 536 | * <code>JoinRowSet.FULL_JOIN</code> |
| 537 | * @throws SQLException if an unsupported <code>JOIN</code> type is set |
| 538 | */ |
| 539 | public void setJoinType(int type) throws SQLException { |
| 540 | // The join which governs the join of two rowsets is the last |
| 541 | // join set, using setJoinType |
| 542 | |
| 543 | if (type >= JoinRowSet.CROSS_JOIN && type <= JoinRowSet.FULL_JOIN) { |
| 544 | if (type != JoinRowSet.INNER_JOIN) { |
| 545 | // This 'if' will be removed after all joins are implemented. |
| 546 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.notsupported").toString()); |
| 547 | } else { |
| 548 | Integer Intgr = new Integer(JoinRowSet.INNER_JOIN); |
| 549 | vecJoinType.add(Intgr); |
| 550 | } |
| 551 | } else { |
| 552 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.notdefined").toString()); |
| 553 | } //end if |
| 554 | } |
| 555 | |
| 556 | |
| 557 | /** |
| 558 | * This checks for a match column for |
| 559 | * whether it exists or not. |
| 560 | * |
| 561 | * @param <code>CachedRowSet</code> object whose match column needs to be checked. |
| 562 | * @throws SQLException if MatchColumn is not set. |
| 563 | */ |
| 564 | private boolean checkforMatchColumn(Joinable rs) throws SQLException { |
| 565 | int[] i = rs.getMatchColumnIndexes(); |
| 566 | if (i.length <= 0) { |
| 567 | return false; |
| 568 | } |
| 569 | return true; |
| 570 | } |
| 571 | |
| 572 | /** |
| 573 | * Internal initialization of <code>JoinRowSet</code>. |
| 574 | */ |
| 575 | private void initJOIN(CachedRowSet rowset) throws SQLException { |
| 576 | try { |
| 577 | |
| 578 | CachedRowSetImpl cRowset = (CachedRowSetImpl)rowset; |
| 579 | // Create a new CachedRowSet object local to this function. |
| 580 | CachedRowSetImpl crsTemp = new CachedRowSetImpl(); |
| 581 | RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl(); |
| 582 | |
| 583 | /* The following 'if block' seems to be always going true. |
| 584 | commenting this out for present |
| 585 | |
| 586 | if (!supportedJOINs[1]) { |
| 587 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.notsupported").toString()); |
| 588 | } |
| 589 | |
| 590 | */ |
| 591 | |
| 592 | if (vecRowSetsInJOIN.isEmpty() ) { |
| 593 | |
| 594 | // implies first cRowset to be added to the Join |
| 595 | // simply add this as a CachedRowSet. |
| 596 | // Also add it to the class variable of type vector |
| 597 | // do not need to check "type" of Join but it should be set. |
| 598 | crsInternal = (CachedRowSetImpl)rowset.createCopy(); |
| 599 | crsInternal.setMetaData((RowSetMetaDataImpl)cRowset.getMetaData()); |
| 600 | // metadata will also set the MatchColumn. |
| 601 | |
| 602 | vecRowSetsInJOIN.add(cRowset); |
| 603 | |
| 604 | } else { |
| 605 | // At this point we are ready to add another rowset to 'this' object |
| 606 | // Check the size of vecJoinType and vecRowSetsInJoin |
| 607 | |
| 608 | // If nothing is being set, internally call setJoinType() |
| 609 | // to set to JoinRowSet.INNER_JOIN. |
| 610 | |
| 611 | // For two rowsets one (valid) entry should be there in vecJoinType |
| 612 | // For three rowsets two (valid) entries should be there in vecJoinType |
| 613 | |
| 614 | // Maintain vecRowSetsInJoin = vecJoinType + 1 |
| 615 | |
| 616 | |
| 617 | if( (vecRowSetsInJOIN.size() - vecJoinType.size() ) == 2 ) { |
| 618 | // we are going to add next rowset and setJoinType has not been set |
| 619 | // recently, so set it to setJoinType() to JoinRowSet.INNER_JOIN. |
| 620 | // the default join type |
| 621 | |
| 622 | setJoinType(JoinRowSet.INNER_JOIN); |
| 623 | } else if( (vecRowSetsInJOIN.size() - vecJoinType.size() ) == 1 ) { |
| 624 | // do nothing setjoinType() has been set by programmer |
| 625 | } |
| 626 | |
| 627 | // Add the table names to the class variable of type vector. |
| 628 | vecTableNames.add(crsInternal.getTableName()); |
| 629 | vecTableNames.add(cRowset.getTableName()); |
| 630 | // Now we have two rowsets crsInternal and cRowset which need |
| 631 | // to be INNER JOIN'ED to form a new rowset |
| 632 | // Compare table1.MatchColumn1.value1 == { table2.MatchColumn2.value1 |
| 633 | // ... upto table2.MatchColumn2.valueN } |
| 634 | // ... |
| 635 | // Compare table1.MatchColumn1.valueM == { table2.MatchColumn2.value1 |
| 636 | // ... upto table2.MatchColumn2.valueN } |
| 637 | // |
| 638 | // Assuming first rowset has M rows and second N rows. |
| 639 | |
| 640 | int rowCount2 = cRowset.size(); |
| 641 | int rowCount1 = crsInternal.size(); |
| 642 | |
| 643 | // total columns in the new CachedRowSet will be sum of both -1 |
| 644 | // (common column) |
| 645 | int matchColumnCount = 0; |
| 646 | for(int i=0; i< crsInternal.getMatchColumnIndexes().length; i++) { |
| 647 | if(crsInternal.getMatchColumnIndexes()[i] != -1) |
| 648 | ++ matchColumnCount; |
| 649 | else |
| 650 | break; |
| 651 | } |
| 652 | |
| 653 | rsmd.setColumnCount |
| 654 | (crsInternal.getMetaData().getColumnCount() + |
| 655 | cRowset.getMetaData().getColumnCount() - matchColumnCount); |
| 656 | |
| 657 | crsTemp.setMetaData(rsmd); |
| 658 | crsInternal.beforeFirst(); |
| 659 | cRowset.beforeFirst(); |
| 660 | for (int i = 1 ; i <= rowCount1 ; i++) { |
| 661 | if(crsInternal.isAfterLast() ) { |
| 662 | break; |
| 663 | } |
| 664 | if(crsInternal.next()) { |
| 665 | cRowset.beforeFirst(); |
| 666 | for(int j = 1 ; j <= rowCount2 ; j++) { |
| 667 | if( cRowset.isAfterLast()) { |
| 668 | break; |
| 669 | } |
| 670 | if(cRowset.next()) { |
| 671 | boolean match = true; |
| 672 | for(int k=0; k<matchColumnCount; k++) { |
| 673 | if (!crsInternal.getObject( crsInternal.getMatchColumnIndexes()[k]).equals |
| 674 | (cRowset.getObject(cRowset.getMatchColumnIndexes()[k]))) { |
| 675 | match = false; |
| 676 | break; |
| 677 | } |
| 678 | } |
| 679 | if (match) { |
| 680 | |
| 681 | int p; |
| 682 | int colc = 0; // reset this variable everytime you loop |
| 683 | // re create a JoinRowSet in crsTemp object |
| 684 | crsTemp.moveToInsertRow(); |
| 685 | |
| 686 | // create a new rowset crsTemp with data from first rowset |
| 687 | for( p=1; |
| 688 | p<=crsInternal.getMetaData().getColumnCount();p++) { |
| 689 | |
| 690 | match = false; |
| 691 | for(int k=0; k<matchColumnCount; k++) { |
| 692 | if (p == crsInternal.getMatchColumnIndexes()[k] ) { |
| 693 | match = true; |
| 694 | break; |
| 695 | } |
| 696 | } |
| 697 | if ( !match ) { |
| 698 | |
| 699 | crsTemp.updateObject(++colc, crsInternal.getObject(p)); |
| 700 | // column type also needs to be passed. |
| 701 | |
| 702 | rsmd.setColumnName |
| 703 | (colc, crsInternal.getMetaData().getColumnName(p)); |
| 704 | rsmd.setTableName(colc, crsInternal.getTableName()); |
| 705 | |
| 706 | rsmd.setColumnType(p, crsInternal.getMetaData().getColumnType(p)); |
| 707 | rsmd.setAutoIncrement(p, crsInternal.getMetaData().isAutoIncrement(p)); |
| 708 | rsmd.setCaseSensitive(p, crsInternal.getMetaData().isCaseSensitive(p)); |
| 709 | rsmd.setCatalogName(p, crsInternal.getMetaData().getCatalogName(p)); |
| 710 | rsmd.setColumnDisplaySize(p, crsInternal.getMetaData().getColumnDisplaySize(p)); |
| 711 | rsmd.setColumnLabel(p, crsInternal.getMetaData().getColumnLabel(p)); |
| 712 | rsmd.setColumnType(p, crsInternal.getMetaData().getColumnType(p)); |
| 713 | rsmd.setColumnTypeName(p, crsInternal.getMetaData().getColumnTypeName(p)); |
| 714 | rsmd.setCurrency(p,crsInternal.getMetaData().isCurrency(p) ); |
| 715 | rsmd.setNullable(p, crsInternal.getMetaData().isNullable(p)); |
| 716 | rsmd.setPrecision(p, crsInternal.getMetaData().getPrecision(p)); |
| 717 | rsmd.setScale(p, crsInternal.getMetaData().getScale(p)); |
| 718 | rsmd.setSchemaName(p, crsInternal.getMetaData().getSchemaName(p)); |
| 719 | rsmd.setSearchable(p, crsInternal.getMetaData().isSearchable(p)); |
| 720 | rsmd.setSigned(p, crsInternal.getMetaData().isSigned(p)); |
| 721 | |
| 722 | } else { |
| 723 | // will happen only once, for that merged column pass |
| 724 | // the types as OBJECT, if types not equal |
| 725 | |
| 726 | crsTemp.updateObject(++colc, crsInternal.getObject(p)); |
| 727 | |
| 728 | rsmd.setColumnName(colc, crsInternal.getMetaData().getColumnName(p)); |
| 729 | rsmd.setTableName |
| 730 | (colc, crsInternal.getTableName()+ |
| 731 | "#"+ |
| 732 | cRowset.getTableName()); |
| 733 | |
| 734 | |
| 735 | rsmd.setColumnType(p, crsInternal.getMetaData().getColumnType(p)); |
| 736 | rsmd.setAutoIncrement(p, crsInternal.getMetaData().isAutoIncrement(p)); |
| 737 | rsmd.setCaseSensitive(p, crsInternal.getMetaData().isCaseSensitive(p)); |
| 738 | rsmd.setCatalogName(p, crsInternal.getMetaData().getCatalogName(p)); |
| 739 | rsmd.setColumnDisplaySize(p, crsInternal.getMetaData().getColumnDisplaySize(p)); |
| 740 | rsmd.setColumnLabel(p, crsInternal.getMetaData().getColumnLabel(p)); |
| 741 | rsmd.setColumnType(p, crsInternal.getMetaData().getColumnType(p)); |
| 742 | rsmd.setColumnTypeName(p, crsInternal.getMetaData().getColumnTypeName(p)); |
| 743 | rsmd.setCurrency(p,crsInternal.getMetaData().isCurrency(p) ); |
| 744 | rsmd.setNullable(p, crsInternal.getMetaData().isNullable(p)); |
| 745 | rsmd.setPrecision(p, crsInternal.getMetaData().getPrecision(p)); |
| 746 | rsmd.setScale(p, crsInternal.getMetaData().getScale(p)); |
| 747 | rsmd.setSchemaName(p, crsInternal.getMetaData().getSchemaName(p)); |
| 748 | rsmd.setSearchable(p, crsInternal.getMetaData().isSearchable(p)); |
| 749 | rsmd.setSigned(p, crsInternal.getMetaData().isSigned(p)); |
| 750 | |
| 751 | //don't do ++colc in the above statement |
| 752 | } //end if |
| 753 | } //end for |
| 754 | |
| 755 | |
| 756 | // append the rowset crsTemp, with data from second rowset |
| 757 | for(int q=1; |
| 758 | q<= cRowset.getMetaData().getColumnCount();q++) { |
| 759 | |
| 760 | match = false; |
| 761 | for(int k=0; k<matchColumnCount; k++) { |
| 762 | if (q == cRowset.getMatchColumnIndexes()[k] ) { |
| 763 | match = true; |
| 764 | break; |
| 765 | } |
| 766 | } |
| 767 | if ( !match ) { |
| 768 | |
| 769 | crsTemp.updateObject(++colc, cRowset.getObject(q)); |
| 770 | |
| 771 | rsmd.setColumnName |
| 772 | (colc, cRowset.getMetaData().getColumnName(q)); |
| 773 | rsmd.setTableName(colc, cRowset.getTableName()); |
| 774 | |
| 775 | /** |
| 776 | * This will happen for a special case scenario. The value of 'p' |
| 777 | * will always be one more than the number of columns in the first |
| 778 | * rowset in the join. So, for a value of 'q' which is the number of |
| 779 | * columns in the second rowset that participates in the join. |
| 780 | * So decrement value of 'p' by 1 else `p+q-1` will be out of range. |
| 781 | **/ |
| 782 | |
| 783 | //if((p+q-1) > ((crsInternal.getMetaData().getColumnCount()) + |
| 784 | // (cRowset.getMetaData().getColumnCount()) - 1)) { |
| 785 | // --p; |
| 786 | //} |
| 787 | rsmd.setColumnType(p+q-1, cRowset.getMetaData().getColumnType(q)); |
| 788 | rsmd.setAutoIncrement(p+q-1, cRowset.getMetaData().isAutoIncrement(q)); |
| 789 | rsmd.setCaseSensitive(p+q-1, cRowset.getMetaData().isCaseSensitive(q)); |
| 790 | rsmd.setCatalogName(p+q-1, cRowset.getMetaData().getCatalogName(q)); |
| 791 | rsmd.setColumnDisplaySize(p+q-1, cRowset.getMetaData().getColumnDisplaySize(q)); |
| 792 | rsmd.setColumnLabel(p+q-1, cRowset.getMetaData().getColumnLabel(q)); |
| 793 | rsmd.setColumnType(p+q-1, cRowset.getMetaData().getColumnType(q)); |
| 794 | rsmd.setColumnTypeName(p+q-1, cRowset.getMetaData().getColumnTypeName(q)); |
| 795 | rsmd.setCurrency(p+q-1,cRowset.getMetaData().isCurrency(q) ); |
| 796 | rsmd.setNullable(p+q-1, cRowset.getMetaData().isNullable(q)); |
| 797 | rsmd.setPrecision(p+q-1, cRowset.getMetaData().getPrecision(q)); |
| 798 | rsmd.setScale(p+q-1, cRowset.getMetaData().getScale(q)); |
| 799 | rsmd.setSchemaName(p+q-1, cRowset.getMetaData().getSchemaName(q)); |
| 800 | rsmd.setSearchable(p+q-1, cRowset.getMetaData().isSearchable(q)); |
| 801 | rsmd.setSigned(p+q-1, cRowset.getMetaData().isSigned(q)); |
| 802 | } |
| 803 | else { |
| 804 | --p; |
| 805 | } |
| 806 | } |
| 807 | crsTemp.insertRow(); |
| 808 | crsTemp.moveToCurrentRow(); |
| 809 | |
| 810 | } else { |
| 811 | // since not equa12 |
| 812 | // so do nothing |
| 813 | } //end if |
| 814 | // bool1 = cRowset.next(); |
| 815 | } |
| 816 | |
| 817 | } // end inner for |
| 818 | //bool2 = crsInternal.next(); |
| 819 | } |
| 820 | |
| 821 | } //end outer for |
| 822 | crsTemp.setMetaData(rsmd); |
| 823 | crsTemp.setOriginal(); |
| 824 | |
| 825 | // Now the join is done. |
| 826 | // Make crsInternal = crsTemp, to be ready for next merge, if at all. |
| 827 | |
| 828 | int[] pCol = new int[matchColumnCount]; |
| 829 | for(int i=0; i<matchColumnCount; i++) |
| 830 | pCol[i] = crsInternal.getMatchColumnIndexes()[i]; |
| 831 | |
| 832 | crsInternal = (CachedRowSetImpl)crsTemp.createCopy(); |
| 833 | |
| 834 | // Because we add the first rowset as crsInternal to the |
| 835 | // merged rowset, so pCol will point to the Match column. |
| 836 | // until reset, am not sure we should set this or not(?) |
| 837 | // if this is not set next inner join won't happen |
| 838 | // if we explicitly do not set a set MatchColumn of |
| 839 | // the new crsInternal. |
| 840 | |
| 841 | crsInternal.setMatchColumn(pCol); |
| 842 | // Add the merged rowset to the class variable of type vector. |
| 843 | crsInternal.setMetaData(rsmd); |
| 844 | vecRowSetsInJOIN.add(cRowset); |
| 845 | } //end if |
| 846 | } catch(SQLException sqle) { |
| 847 | // %%% Exception should not dump here: |
| 848 | sqle.printStackTrace(); |
| 849 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.initerror").toString() + sqle); |
| 850 | } catch (Exception e) { |
| 851 | e.printStackTrace(); |
| 852 | throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.genericerr").toString() + e); |
| 853 | } |
| 854 | } |
| 855 | |
| 856 | /** |
| 857 | * Return a SQL-like description of the <code>WHERE</code> clause being used |
| 858 | * in a <code>JoinRowSet</code> object instance. An implementation can describe |
| 859 | * the <code>WHERE</code> clause of the SQL <code>JOIN</code> by supplying a <code>SQL</code> |
| 860 | * strings description of <code>JOIN</code> or provide a textual description to assist |
| 861 | * applications using a <code>JoinRowSet</code>. |
| 862 | * |
| 863 | * @return whereClause a textual or SQL descripition of the logical |
| 864 | * <code>WHERE</code> cluase used in the <code>JoinRowSet</code> instance |
| 865 | * @throws SQLException if an error occurs in generating a representation |
| 866 | * of the <code>WHERE</code> clause. |
| 867 | */ |
| 868 | public String getWhereClause() throws SQLException { |
| 869 | |
| 870 | String strWhereClause = "Select "; |
| 871 | String whereClause; |
| 872 | String tabName= null; |
| 873 | String strTabName = null; |
| 874 | int sz,cols; |
| 875 | int j; |
| 876 | CachedRowSetImpl crs; |
| 877 | |
| 878 | // get all the column(s) names from each rowset. |
| 879 | // append them with their tablenames i.e. tableName.columnName |
| 880 | // Select tableName1.columnName1,..., tableNameX.columnNameY |
| 881 | // from tableName1,...tableNameX where |
| 882 | // tableName1.(rowset1.getMatchColumnName()) == |
| 883 | // tableName2.(rowset2.getMatchColumnName()) + "and" + |
| 884 | // tableNameX.(rowsetX.getMatchColumnName()) == |
| 885 | // tableNameZ.(rowsetZ.getMatchColumnName())); |
| 886 | |
| 887 | tabName = new String(); |
| 888 | strTabName = new String(); |
| 889 | sz = vecRowSetsInJOIN.size(); |
| 890 | for(int i=0;i<sz; i++) { |
| 891 | crs = (CachedRowSetImpl)vecRowSetsInJOIN.get(i); |
| 892 | cols = crs.getMetaData().getColumnCount(); |
| 893 | tabName = tabName.concat(crs.getTableName()); |
| 894 | strTabName = strTabName.concat(tabName+", "); |
| 895 | j = 1; |
| 896 | while(j<cols) { |
| 897 | |
| 898 | strWhereClause = strWhereClause.concat |
| 899 | (tabName+"."+crs.getMetaData().getColumnName(j++)); |
| 900 | strWhereClause = strWhereClause.concat(", "); |
| 901 | } //end while |
| 902 | } //end for |
| 903 | |
| 904 | |
| 905 | // now remove the last "," |
| 906 | strWhereClause = strWhereClause.substring |
| 907 | (0, strWhereClause.lastIndexOf(",")); |
| 908 | |
| 909 | // Add from clause |
| 910 | strWhereClause = strWhereClause.concat(" from "); |
| 911 | |
| 912 | // Add the table names. |
| 913 | strWhereClause = strWhereClause.concat(strTabName); |
| 914 | |
| 915 | //Remove the last "," |
| 916 | strWhereClause = strWhereClause.substring |
| 917 | (0, strWhereClause.lastIndexOf(",")); |
| 918 | |
| 919 | // Add the where clause |
| 920 | strWhereClause = strWhereClause.concat(" where "); |
| 921 | |
| 922 | // Get the match columns |
| 923 | // rowset1.getMatchColumnName() == rowset2.getMatchColumnName() |
| 924 | for(int i=0;i<sz; i++) { |
| 925 | strWhereClause = strWhereClause.concat( |
| 926 | ((CachedRowSetImpl)vecRowSetsInJOIN.get(i)).getMatchColumnNames()[0]); |
| 927 | if(i%2!=0) { |
| 928 | strWhereClause = strWhereClause.concat("="); |
| 929 | } else { |
| 930 | strWhereClause = strWhereClause.concat(" and"); |
| 931 | } |
| 932 | strWhereClause = strWhereClause.concat(" "); |
| 933 | } |
| 934 | |
| 935 | return strWhereClause; |
| 936 | } |
| 937 | |
| 938 | |
| 939 | /** |
| 940 | * Moves the cursor down one row from its current position and |
| 941 | * returns <code>true</code> if the new cursor position is a |
| 942 | * valid row. |
| 943 | * The cursor for a new <code>ResultSet</code> object is initially |
| 944 | * positioned before the first row. The first call to the method |
| 945 | * <code>next</code> moves the cursor to the first row, making it |
| 946 | * the current row; the second call makes the second row the |
| 947 | * current row, and so on. |
| 948 | * |
| 949 | * <P>If an input stream from the previous row is open, it is |
| 950 | * implicitly closed. The <code>ResultSet</code> object's warning |
| 951 | * chain is cleared when a new row is read. |
| 952 | * |
| 953 | * @return <code>true</code> if the new current row is valid; |
| 954 | * <code>false</code> if there are no more rows |
| 955 | * @throws SQLException if an error occurs or |
| 956 | * the cursor is not positioned in the rowset, before |
| 957 | * the first row, or after the last row |
| 958 | */ |
| 959 | public boolean next() throws SQLException { |
| 960 | return crsInternal.next(); |
| 961 | } |
| 962 | |
| 963 | |
| 964 | /** |
| 965 | * Releases the current contents of this rowset, discarding outstanding |
| 966 | * updates. The rowset contains no rows after the method |
| 967 | * <code>release</code> is called. This method sends a |
| 968 | * <code>RowSetChangedEvent</code> object to all registered listeners prior |
| 969 | * to returning. |
| 970 | * |
| 971 | * @throws SQLException if an error occurs |
| 972 | */ |
| 973 | public void close() throws SQLException { |
| 974 | crsInternal.close(); |
| 975 | } |
| 976 | |
| 977 | |
| 978 | /** |
| 979 | * Reports whether the last column read was SQL <code>NULL</code>. |
| 980 | * Note that you must first call the method <code>getXXX</code> |
| 981 | * on a column to try to read its value and then call the method |
| 982 | * <code>wasNull</code> to determine whether the value was |
| 983 | * SQL <code>NULL</code>. |
| 984 | * |
| 985 | * @return <code>true</code> if the value in the last column read |
| 986 | * was SQL <code>NULL</code>; <code>false</code> otherwise |
| 987 | * @throws SQLException if an error occurs |
| 988 | */ |
| 989 | public boolean wasNull() throws SQLException { |
| 990 | return crsInternal.wasNull(); |
| 991 | } |
| 992 | |
| 993 | /** |
| 994 | * Retrieves the value of the designated column in the current row |
| 995 | * of this <code>JoinRowSetImpl</code> object as a |
| 996 | * <code>String</code> object. |
| 997 | * |
| 998 | * @param columnIndex the first column is <code>1</code>, the second |
| 999 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1000 | * and equal to or less than the number of columns in the rowset |
| 1001 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1002 | * result is <code>null</code> |
| 1003 | * @throws SQLException if the given column index is out of bounds or |
| 1004 | * the cursor is not on a valid row |
| 1005 | */ |
| 1006 | public String getString(int columnIndex) throws SQLException { |
| 1007 | return crsInternal.getString(columnIndex); |
| 1008 | } |
| 1009 | |
| 1010 | /** |
| 1011 | * Retrieves the value of the designated column in the current row |
| 1012 | * of this <code>JoinRowSetImpl</code> object as a |
| 1013 | * <code>boolean</code> value. |
| 1014 | * |
| 1015 | * @param columnIndex the first column is <code>1</code>, the second |
| 1016 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1017 | * and equal to or less than the number of columns in the rowset |
| 1018 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1019 | * result is <code>false</code> |
| 1020 | * @throws SQLException if the given column index is out of bounds, |
| 1021 | * the cursor is not on a valid row, or this method fails |
| 1022 | */ |
| 1023 | public boolean getBoolean(int columnIndex) throws SQLException { |
| 1024 | return crsInternal.getBoolean(columnIndex); |
| 1025 | } |
| 1026 | |
| 1027 | /** |
| 1028 | * Retrieves the value of the designated column in the current row |
| 1029 | * of this <code>JoinRowSetImpl</code> object as a |
| 1030 | * <code>byte</code> value. |
| 1031 | * |
| 1032 | * @param columnIndex the first column is <code>1</code>, the second |
| 1033 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1034 | * and equal to or less than the number of columns in the rowset |
| 1035 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1036 | * result is <code>0</code> |
| 1037 | * @throws SQLException if the given column index is out of bounds, |
| 1038 | * the cursor is not on a valid row, or this method fails |
| 1039 | */ |
| 1040 | public byte getByte(int columnIndex) throws SQLException { |
| 1041 | return crsInternal.getByte(columnIndex); |
| 1042 | } |
| 1043 | |
| 1044 | /** |
| 1045 | * Retrieves the value of the designated column in the current row |
| 1046 | * of this <code>JoinRowSetImpl</code> object as a |
| 1047 | * <code>short</code> value. |
| 1048 | * |
| 1049 | * @param columnIndex the first column is <code>1</code>, the second |
| 1050 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1051 | * and equal to or less than the number of columns in the rowset |
| 1052 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1053 | * result is <code>0</code> |
| 1054 | * @throws SQLException if the given column index is out of bounds, |
| 1055 | * the cursor is not on a valid row, or this method fails |
| 1056 | */ |
| 1057 | public short getShort(int columnIndex) throws SQLException { |
| 1058 | return crsInternal.getShort(columnIndex); |
| 1059 | } |
| 1060 | |
| 1061 | /** |
| 1062 | * Retrieves the value of the designated column in the current row |
| 1063 | * of this <code>JoinRowSetImpl</code> object as a |
| 1064 | * <code>short</code> value. |
| 1065 | * |
| 1066 | * @param columnIndex the first column is <code>1</code>, the second |
| 1067 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1068 | * and equal to or less than the number of columns in the rowset |
| 1069 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1070 | * result is <code>0</code> |
| 1071 | * @throws SQLException if the given column index is out of bounds, |
| 1072 | * the cursor is not on a valid row, or this method fails |
| 1073 | */ |
| 1074 | public int getInt(int columnIndex) throws SQLException { |
| 1075 | return crsInternal.getInt(columnIndex); |
| 1076 | } |
| 1077 | |
| 1078 | /** |
| 1079 | * Retrieves the value of the designated column in the current row |
| 1080 | * of this <code>JoinRowSetImpl</code> object as a |
| 1081 | * <code>long</code> value. |
| 1082 | * |
| 1083 | * @param columnIndex the first column is <code>1</code>, the second |
| 1084 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1085 | * and equal to or less than the number of columns in the rowset |
| 1086 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1087 | * result is <code>0</code> |
| 1088 | * @throws SQLException if the given column index is out of bounds, |
| 1089 | * the cursor is not on a valid row, or this method fails |
| 1090 | */ |
| 1091 | public long getLong(int columnIndex) throws SQLException { |
| 1092 | return crsInternal.getLong(columnIndex); |
| 1093 | } |
| 1094 | |
| 1095 | /** |
| 1096 | * Retrieves the value of the designated column in the current row |
| 1097 | * of this <code>JoinRowSetImpl</code> object as a |
| 1098 | * <code>float</code> value. |
| 1099 | * |
| 1100 | * @param columnIndex the first column is <code>1</code>, the second |
| 1101 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1102 | * and equal to or less than the number of columns in the rowset |
| 1103 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1104 | * result is <code>0</code> |
| 1105 | * @throws SQLException if the given column index is out of bounds, |
| 1106 | * the cursor is not on a valid row, or this method fails |
| 1107 | */ |
| 1108 | public float getFloat(int columnIndex) throws SQLException { |
| 1109 | return crsInternal.getFloat(columnIndex); |
| 1110 | } |
| 1111 | |
| 1112 | /** |
| 1113 | * Retrieves the value of the designated column in the current row |
| 1114 | * of this <code>JoinRowSetImpl</code> object as a |
| 1115 | * <code>double</code> value. |
| 1116 | * |
| 1117 | * @param columnIndex the first column is <code>1</code>, the second |
| 1118 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1119 | * and equal to or less than the number of columns in the rowset |
| 1120 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1121 | * result is <code>0</code> |
| 1122 | * @throws SQLException if the given column index is out of bounds, |
| 1123 | * the cursor is not on a valid row, or this method fails |
| 1124 | */ |
| 1125 | public double getDouble(int columnIndex) throws SQLException { |
| 1126 | return crsInternal.getDouble(columnIndex); |
| 1127 | } |
| 1128 | |
| 1129 | /** |
| 1130 | * Retrieves the value of the designated column in the current row |
| 1131 | * of this <code>JoinRowSetImpl</code> object as a |
| 1132 | * <code>java.math.BigDecimal</code> object. |
| 1133 | * <P> |
| 1134 | * This method is deprecated; use the version of <code>getBigDecimal</code> |
| 1135 | * that does not take a scale parameter and returns a value with full |
| 1136 | * precision. |
| 1137 | * |
| 1138 | * @param columnIndex the first column is <code>1</code>, the second |
| 1139 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1140 | * and equal to or less than the number of columns in the rowset |
| 1141 | * @param scale the number of digits to the right of the decimal point in the |
| 1142 | * value returned |
| 1143 | * @return the column value with the specified number of digits to the right |
| 1144 | * of the decimal point; if the value is SQL <code>NULL</code>, the |
| 1145 | * result is <code>null</code> |
| 1146 | * @throws SQLException if the given column index is out of bounds, |
| 1147 | * the cursor is not on a valid row, or this method fails |
| 1148 | * @deprecated |
| 1149 | */ |
| 1150 | public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { |
| 1151 | return crsInternal.getBigDecimal(columnIndex); |
| 1152 | } |
| 1153 | |
| 1154 | /** |
| 1155 | * Retrieves the value of the designated column in the current row |
| 1156 | * of this <code>JoinRowSetImpl</code> object as a |
| 1157 | * <code>byte array</code> value. |
| 1158 | * |
| 1159 | * @param columnIndex the first column is <code>1</code>, the second |
| 1160 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1161 | * and equal to or less than the number of columns in the rowset |
| 1162 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1163 | * result is <code>null</code> |
| 1164 | * @throws SQLException if the given column index is out of bounds, |
| 1165 | * the cursor is not on a valid row, or the the value to be |
| 1166 | * retrieved is not binary |
| 1167 | */ |
| 1168 | public byte[] getBytes(int columnIndex) throws SQLException { |
| 1169 | return crsInternal.getBytes(columnIndex); |
| 1170 | } |
| 1171 | |
| 1172 | /** |
| 1173 | * Retrieves the value of the designated column in the current row |
| 1174 | * of this <code>JoinRowSetImpl</code> object as a |
| 1175 | * <code>java.sql.Date</code> object. |
| 1176 | * |
| 1177 | * @param columnIndex the first column is <code>1</code>, the second |
| 1178 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1179 | * and equal to or less than the number of columns in the rowset |
| 1180 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1181 | * result is <code>null</code> |
| 1182 | * @throws SQLException if the given column index is out of bounds, |
| 1183 | * the cursor is not on a valid row, or this method fails |
| 1184 | */ |
| 1185 | public java.sql.Date getDate(int columnIndex) throws SQLException { |
| 1186 | return crsInternal.getDate(columnIndex); |
| 1187 | } |
| 1188 | |
| 1189 | /** |
| 1190 | * Retrieves the value of the designated column in the current row |
| 1191 | * of this <code>JoinRowSetImpl</code> object as a |
| 1192 | * <code>java.sql.Time</code> object. |
| 1193 | * |
| 1194 | * @param columnIndex the first column is <code>1</code>, the second |
| 1195 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1196 | * and equal to or less than the number of columns in the rowset |
| 1197 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1198 | * result is <code>null</code> |
| 1199 | * @throws SQLException if the given column index is out of bounds, |
| 1200 | * the cursor is not on a valid row, or this method fails |
| 1201 | */ |
| 1202 | public java.sql.Time getTime(int columnIndex) throws SQLException { |
| 1203 | return crsInternal.getTime(columnIndex); |
| 1204 | } |
| 1205 | |
| 1206 | /** |
| 1207 | * Retrieves the value of the designated column in the current row |
| 1208 | * of this <code>JoinRowSetImpl</code> object as a |
| 1209 | * <code>java.sql.Timestamp</code> object. |
| 1210 | * |
| 1211 | * @param columnIndex the first column is <code>1</code>, the second |
| 1212 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1213 | * and equal to or less than the number of columns in the rowset |
| 1214 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1215 | * result is <code>null</code> |
| 1216 | * @throws SQLException if the given column index is out of bounds, |
| 1217 | * the cursor is not on a valid row, or this method fails |
| 1218 | */ |
| 1219 | public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException { |
| 1220 | return crsInternal.getTimestamp(columnIndex); |
| 1221 | } |
| 1222 | |
| 1223 | /** |
| 1224 | * Retrieves the value of the designated column in the current row |
| 1225 | * of this <code>JoinRowSetImpl</code> object as a |
| 1226 | * <code>java.sql.Timestamp</code> object. |
| 1227 | * |
| 1228 | * @param columnIndex the first column is <code>1</code>, the second |
| 1229 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1230 | * and equal to or less than the number of columns in the rowset |
| 1231 | * @return the column value; if the value is SQL <code>NULL</code>, the |
| 1232 | * result is <code>null</code> |
| 1233 | * @throws SQLException if the given column index is out of bounds, |
| 1234 | * the cursor is not on a valid row, or this method fails |
| 1235 | */ |
| 1236 | public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException { |
| 1237 | return crsInternal.getAsciiStream(columnIndex); |
| 1238 | } |
| 1239 | |
| 1240 | /** |
| 1241 | * A column value can be retrieved as a stream of Unicode characters |
| 1242 | * and then read in chunks from the stream. This method is particularly |
| 1243 | * suitable for retrieving large LONGVARCHAR values. The JDBC driver will |
| 1244 | * do any necessary conversion from the database format into Unicode. |
| 1245 | * |
| 1246 | * <P><B>Note:</B> All the data in the returned stream must be |
| 1247 | * read prior to getting the value of any other column. The next |
| 1248 | * call to a get method implicitly closes the stream. . Also, a |
| 1249 | * stream may return 0 for available() whether there is data |
| 1250 | * available or not. |
| 1251 | * |
| 1252 | * @param columnIndex the first column is <code>1</code>, the second |
| 1253 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1254 | * and equal to or less than the number of columns in this rowset |
| 1255 | * @return a Java input stream that delivers the database column value |
| 1256 | * as a stream of two byte Unicode characters. If the value is SQL NULL |
| 1257 | * then the result is null. |
| 1258 | * @throws SQLException if an error occurs |
| 1259 | * @deprecated |
| 1260 | */ |
| 1261 | public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { |
| 1262 | return crsInternal.getUnicodeStream(columnIndex); |
| 1263 | } |
| 1264 | |
| 1265 | /** |
| 1266 | * A column value can be retrieved as a stream of uninterpreted bytes |
| 1267 | * and then read in chunks from the stream. This method is particularly |
| 1268 | * suitable for retrieving large LONGVARBINARY values. |
| 1269 | * |
| 1270 | * <P><B>Note:</B> All the data in the returned stream must be |
| 1271 | * read prior to getting the value of any other column. The next |
| 1272 | * call to a get method implicitly closes the stream. Also, a |
| 1273 | * stream may return 0 for available() whether there is data |
| 1274 | * available or not. |
| 1275 | * |
| 1276 | * @param columnIndex the first column is <code>1</code>, the second |
| 1277 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1278 | * and equal to or less than the number of columns in the rowset |
| 1279 | * @return a Java input stream that delivers the database column value |
| 1280 | * as a stream of uninterpreted bytes. If the value is SQL NULL |
| 1281 | * then the result is null. |
| 1282 | * @throws SQLException if an error occurs |
| 1283 | */ |
| 1284 | public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException { |
| 1285 | return crsInternal.getBinaryStream(columnIndex); |
| 1286 | } |
| 1287 | |
| 1288 | // ColumnName methods |
| 1289 | |
| 1290 | /** |
| 1291 | * Retrieves the value stored in the designated column |
| 1292 | * of the current row as a <code>String</code> object. |
| 1293 | * |
| 1294 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1295 | * a column in this <code>JoinRowSetImpl</code> object |
| 1296 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1297 | * the result is <code>null</code> |
| 1298 | * @throws SQLException if the given column name does not match one of |
| 1299 | * this rowset's column names or the cursor is not on one of |
| 1300 | * this rowset's rows or its insert row |
| 1301 | */ |
| 1302 | public String getString(String columnName) throws SQLException { |
| 1303 | return crsInternal.getString(columnName); |
| 1304 | } |
| 1305 | |
| 1306 | /** |
| 1307 | * Retrieves the value stored in the designated column |
| 1308 | * of the current row as a <code>boolean</code> value. |
| 1309 | * |
| 1310 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1311 | * a column in this <code>JoinRowSetImpl</code> object |
| 1312 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1313 | * the result is <code>false</code> |
| 1314 | * @throws SQLException if the given column name does not match one of |
| 1315 | * this rowset's column names or the cursor is not on one of |
| 1316 | * this rowset's rows or its insert row |
| 1317 | */ |
| 1318 | public boolean getBoolean(String columnName) throws SQLException { |
| 1319 | return crsInternal.getBoolean(columnName); |
| 1320 | } |
| 1321 | |
| 1322 | /** |
| 1323 | * Retrieves the value stored in the designated column |
| 1324 | * of the current row as a <code>byte</code> value. |
| 1325 | * |
| 1326 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1327 | * a column in this <code>JoinRowSetImpl</code> object |
| 1328 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1329 | * the result is <code>0</code> |
| 1330 | * @throws SQLException if the given column name does not match one of |
| 1331 | * this rowset's column names or the cursor is not on one of |
| 1332 | * this rowset's rows or its insert row |
| 1333 | */ |
| 1334 | public byte getByte(String columnName) throws SQLException { |
| 1335 | return crsInternal.getByte(columnName); |
| 1336 | } |
| 1337 | |
| 1338 | /** |
| 1339 | * Retrieves the value stored in the designated column |
| 1340 | * of the current row as a <code>short</code> value. |
| 1341 | * |
| 1342 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1343 | * a column in this <code>JoinRowSetImpl</code> object |
| 1344 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1345 | * the result is <code>0</code> |
| 1346 | * @throws SQLException if the given column name does not match one of |
| 1347 | * this rowset's column names or the cursor is not on one of |
| 1348 | * this rowset's rows or its insert row |
| 1349 | */ |
| 1350 | public short getShort(String columnName) throws SQLException { |
| 1351 | return crsInternal.getShort(columnName); |
| 1352 | } |
| 1353 | |
| 1354 | /** |
| 1355 | * Retrieves the value stored in the designated column |
| 1356 | * of the current row as an <code>int</code> value. |
| 1357 | * |
| 1358 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1359 | * a column in this <code>JoinRowSetImpl</code> object |
| 1360 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1361 | * the result is <code>0</code> |
| 1362 | * @throws SQLException if the given column name does not match one of |
| 1363 | * this rowset's column names or the cursor is not on one of |
| 1364 | * this rowset's rows or its insert row |
| 1365 | */ |
| 1366 | public int getInt(String columnName) throws SQLException { |
| 1367 | return crsInternal.getInt(columnName); |
| 1368 | } |
| 1369 | |
| 1370 | /** |
| 1371 | * Retrieves the value stored in the designated column |
| 1372 | * of the current row as a <code>long</code> value. |
| 1373 | * |
| 1374 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1375 | * a column in this <code>JoinRowSetImpl</code> object |
| 1376 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1377 | * the result is <code>0</code> |
| 1378 | * @throws SQLException if the given column name does not match one of |
| 1379 | * this rowset's column names or the cursor is not on one of |
| 1380 | * this rowset's rows or its insert row |
| 1381 | */ |
| 1382 | public long getLong(String columnName) throws SQLException { |
| 1383 | return crsInternal.getLong(columnName); |
| 1384 | } |
| 1385 | |
| 1386 | /** |
| 1387 | * Retrieves the value stored in the designated column |
| 1388 | * of the current row as a <code>float</code> value. |
| 1389 | * |
| 1390 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1391 | * a column in this <code>JoinRowSetImpl</code> object |
| 1392 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1393 | * the result is <code>0</code> |
| 1394 | * @throws SQLException if the given column name does not match one of |
| 1395 | * this rowset's column names or the cursor is not on one of |
| 1396 | * this rowset's rows or its insert row |
| 1397 | */ |
| 1398 | public float getFloat(String columnName) throws SQLException { |
| 1399 | return crsInternal.getFloat(columnName); |
| 1400 | } |
| 1401 | |
| 1402 | /** |
| 1403 | * Retrieves the value stored in the designated column |
| 1404 | * of the current row as a <code>double</code> value. |
| 1405 | * |
| 1406 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1407 | * a column in this <code>JoinRowSetImpl</code> object |
| 1408 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1409 | * the result is <code>0</code> |
| 1410 | * @throws SQLException if the given column name does not match one of |
| 1411 | * this rowset's column names or the cursor is not on one of |
| 1412 | * this rowset's rows or its insert row |
| 1413 | */ |
| 1414 | public double getDouble(String columnName) throws SQLException { |
| 1415 | return crsInternal.getDouble(columnName); |
| 1416 | } |
| 1417 | |
| 1418 | /** |
| 1419 | * Retrieves the value stored in the designated column |
| 1420 | * of the current row as a <code>java.math.BigDecimal</code> object. |
| 1421 | * |
| 1422 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1423 | * a column in this <code>JoinRowSetImpl</code> object |
| 1424 | * @param scale the number of digits to the right of the decimal point |
| 1425 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1426 | * the result is <code>null</code> |
| 1427 | * @throws SQLException if the given column name does not match one of |
| 1428 | * this rowset's column names or the cursor is not on one of |
| 1429 | * this rowset's rows or its insert row |
| 1430 | * @deprecated use the method <code>getBigDecimal(String columnName)</code> |
| 1431 | * instead |
| 1432 | */ |
| 1433 | public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { |
| 1434 | return crsInternal.getBigDecimal(columnName); |
| 1435 | } |
| 1436 | |
| 1437 | /** |
| 1438 | * Retrieves the value stored in the designated column |
| 1439 | * of the current row as a byte array. |
| 1440 | * The bytes represent the raw values returned by the driver. |
| 1441 | * |
| 1442 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1443 | * a column in this <code>JoinRowSetImpl</code> object |
| 1444 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1445 | * the result is <code>null</code> |
| 1446 | * @throws SQLException if the given column name does not match one of |
| 1447 | * this rowset's column names or the cursor is not on one of |
| 1448 | * this rowset's rows or its insert row |
| 1449 | */ |
| 1450 | public byte[] getBytes(String columnName) throws SQLException { |
| 1451 | return crsInternal.getBytes(columnName); |
| 1452 | } |
| 1453 | |
| 1454 | /** |
| 1455 | * Retrieves the value stored in the designated column |
| 1456 | * of the current row as a <code>java.sql.Date</code> object. |
| 1457 | * |
| 1458 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1459 | * a column in this <code>JoinRowSetImpl</code> object |
| 1460 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1461 | * the result is <code>null</code> |
| 1462 | * @throws SQLException if the given column name does not match one of |
| 1463 | * this rowset's column names or the cursor is not on one of |
| 1464 | * this rowset's rows or its insert row |
| 1465 | */ |
| 1466 | public java.sql.Date getDate(String columnName) throws SQLException { |
| 1467 | return crsInternal.getDate(columnName); |
| 1468 | } |
| 1469 | |
| 1470 | /** |
| 1471 | * Retrieves the value stored in the designated column |
| 1472 | * of the current row as a <code>java.sql.Time</code> object. |
| 1473 | * |
| 1474 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1475 | * a column in this <code>JoinRowSetImpl</code> object |
| 1476 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1477 | * the result is <code>null</code> |
| 1478 | * @throws SQLException if the given column name does not match one of |
| 1479 | * this rowset's column names or the cursor is not on one of |
| 1480 | * this rowset's rows or its insert row |
| 1481 | */ |
| 1482 | public java.sql.Time getTime(String columnName) throws SQLException { |
| 1483 | return crsInternal.getTime(columnName); |
| 1484 | } |
| 1485 | |
| 1486 | /** |
| 1487 | * Retrieves the value stored in the designated column |
| 1488 | * of the current row as a <code>java.sql.Timestamp</code> object. |
| 1489 | * |
| 1490 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1491 | * a column in this <code>JoinRowSetImpl</code> object |
| 1492 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 1493 | * the result is <code>null</code> |
| 1494 | * @throws SQLException if the given column name does not match one of |
| 1495 | * this rowset's column names or the cursor is not on one of |
| 1496 | * this rowset's rows or its insert row |
| 1497 | */ |
| 1498 | public java.sql.Timestamp getTimestamp(String columnName) throws SQLException { |
| 1499 | return crsInternal.getTimestamp(columnName); |
| 1500 | } |
| 1501 | |
| 1502 | /** |
| 1503 | * This method is not supported, and it will throw an |
| 1504 | * <code>UnsupportedOperationException</code> if it is called. |
| 1505 | * <P> |
| 1506 | * A column value can be retrieved as a stream of ASCII characters |
| 1507 | * and then read in chunks from the stream. This method is particularly |
| 1508 | * suitable for retrieving large LONGVARCHAR values. The JDBC driver will |
| 1509 | * do any necessary conversion from the database format into ASCII format. |
| 1510 | * |
| 1511 | * <P><B>Note:</B> All the data in the returned stream must |
| 1512 | * be read prior to getting the value of any other column. The |
| 1513 | * next call to a <code>getXXX</code> method implicitly closes the stream. |
| 1514 | * |
| 1515 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1516 | * a column in this <code>JoinRowSetImpl</code> object |
| 1517 | * @return a Java input stream that delivers the database column value |
| 1518 | * as a stream of one-byte ASCII characters. If the value is SQL |
| 1519 | * <code>NULL</code>, the result is <code>null</code>. |
| 1520 | * @throws UnsupportedOperationException if this method is called |
| 1521 | */ |
| 1522 | public java.io.InputStream getAsciiStream(String columnName) throws SQLException { |
| 1523 | return crsInternal.getAsciiStream(columnName); |
| 1524 | } |
| 1525 | |
| 1526 | /** |
| 1527 | * Retrieves the value stored in the designated column |
| 1528 | * of the current row as a <code>java.io.InputStream</code> object. |
| 1529 | * A column value can be retrieved as a stream of Unicode characters |
| 1530 | * and then read in chunks from the stream. This method is particularly |
| 1531 | * suitable for retrieving large <code>LONGVARCHAR</code> values. |
| 1532 | * The JDBC driver will do any necessary conversion from the database |
| 1533 | * format into Unicode. |
| 1534 | * |
| 1535 | * <P><B>Note:</B> All the data in the returned stream must |
| 1536 | * be read prior to getting the value of any other column. The |
| 1537 | * next call to a <code>getXXX</code> method implicitly closes the stream. |
| 1538 | * |
| 1539 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1540 | * a column in this <code>JoinRowSetImpl</code> object |
| 1541 | * @return a Java input stream that delivers the database column value |
| 1542 | * as a stream of two-byte Unicode characters. If the value is |
| 1543 | * SQL <code>NULL</code>, the result is <code>null</code>. |
| 1544 | * @throws SQLException if the given column name does not match one of |
| 1545 | * this rowset's column names or the cursor is not on one of |
| 1546 | * this rowset's rows or its insert row |
| 1547 | * @deprecated use the method <code>getCharacterStream</code> instead |
| 1548 | */ |
| 1549 | public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { |
| 1550 | return crsInternal.getUnicodeStream(columnName); |
| 1551 | } |
| 1552 | |
| 1553 | /** |
| 1554 | * Retrieves the value stored in the designated column |
| 1555 | * of the current row as a <code>java.io.InputStream</code> object. |
| 1556 | * A column value can be retrieved as a stream of uninterpreted bytes |
| 1557 | * and then read in chunks from the stream. This method is particularly |
| 1558 | * suitable for retrieving large <code>LONGVARBINARY</code> values. |
| 1559 | * |
| 1560 | * <P><B>Note:</B> All the data in the returned stream must |
| 1561 | * be read prior to getting the value of any other column. The |
| 1562 | * next call to a get method implicitly closes the stream. |
| 1563 | * |
| 1564 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1565 | * a column in this <code>JoinRowSetImpl</code> object |
| 1566 | * @return a Java input stream that delivers the database column value |
| 1567 | * as a stream of uninterpreted bytes. If the value is SQL |
| 1568 | * <code>NULL</code>, the result is <code>null</code>. |
| 1569 | * @throws SQLException if the given column name does not match one of |
| 1570 | * this rowset's column names or the cursor is not on one of |
| 1571 | * this rowset's rows or its insert row |
| 1572 | */ |
| 1573 | public java.io.InputStream getBinaryStream(String columnName) throws SQLException { |
| 1574 | return crsInternal.getBinaryStream(columnName); |
| 1575 | } |
| 1576 | |
| 1577 | /* The first warning reported by calls on this <code>JoinRowSetImpl</code> |
| 1578 | * object is returned. Subsequent <code>JoinRowSetImpl</code> warnings will |
| 1579 | * be chained to this <code>SQLWarning</code>. |
| 1580 | * |
| 1581 | * <P>The warning chain is automatically cleared each time a new |
| 1582 | * row is read. |
| 1583 | * |
| 1584 | * <P><B>Note:</B> This warning chain only covers warnings caused |
| 1585 | * by <code>ResultSet</code> methods. Any warning caused by statement |
| 1586 | * methods (such as reading OUT parameters) will be chained on the |
| 1587 | * <code>Statement</code> object. |
| 1588 | * |
| 1589 | * @return the first SQLWarning or null |
| 1590 | * @throws UnsupportedOperationException if this method is called |
| 1591 | */ |
| 1592 | public SQLWarning getWarnings() { |
| 1593 | return crsInternal.getWarnings(); |
| 1594 | } |
| 1595 | |
| 1596 | /** |
| 1597 | * Throws an <code>UnsupportedOperationException</code> if called. |
| 1598 | * <P> |
| 1599 | * After a call to this method, the <code>getWarnings</code> method |
| 1600 | * returns <code>null</code> until a new warning is reported for this |
| 1601 | * <code>JoinRowSetImpl</code> object. |
| 1602 | * |
| 1603 | * @throws UnsupportedOperationException if this method is called |
| 1604 | */ |
| 1605 | public void clearWarnings() { |
| 1606 | crsInternal.clearWarnings(); |
| 1607 | } |
| 1608 | |
| 1609 | /** |
| 1610 | * Retrieves the name of the SQL cursor used by this |
| 1611 | * <code>JoinRowSetImpl</code> object. |
| 1612 | * |
| 1613 | * <P>In SQL, a result table is retrieved through a cursor that is |
| 1614 | * named. The current row of a result can be updated or deleted |
| 1615 | * using a positioned update/delete statement that references the |
| 1616 | * cursor name. To insure that the cursor has the proper isolation |
| 1617 | * level to support an update operation, the cursor's <code>SELECT</code> |
| 1618 | * statement should be of the form 'select for update'. If the 'for update' |
| 1619 | * clause is omitted, positioned updates may fail. |
| 1620 | * |
| 1621 | * <P>JDBC supports this SQL feature by providing the name of the |
| 1622 | * SQL cursor used by a <code>ResultSet</code> object. The current row |
| 1623 | * of a result set is also the current row of this SQL cursor. |
| 1624 | * |
| 1625 | * <P><B>Note:</B> If positioned updates are not supported, an |
| 1626 | * <code>SQLException</code> is thrown. |
| 1627 | * |
| 1628 | * @return the SQL cursor name for this <code>JoinRowSetImpl</code> object's |
| 1629 | * cursor |
| 1630 | * @throws SQLException if an error occurs |
| 1631 | */ |
| 1632 | public String getCursorName() throws SQLException { |
| 1633 | return crsInternal.getCursorName(); |
| 1634 | } |
| 1635 | |
| 1636 | /** |
| 1637 | * Retrieves the <code>ResultSetMetaData</code> object that contains |
| 1638 | * information about this <code>CachedRowsSet</code> object. The |
| 1639 | * information includes the number of columns, the data type for each |
| 1640 | * column, and other properties for each column. |
| 1641 | * |
| 1642 | * @return the <code>ResultSetMetaData</code> object that describes this |
| 1643 | * <code>JoinRowSetImpl</code> object's columns |
| 1644 | * @throws SQLException if an error occurs |
| 1645 | */ |
| 1646 | public ResultSetMetaData getMetaData() throws SQLException { |
| 1647 | return crsInternal.getMetaData(); |
| 1648 | } |
| 1649 | |
| 1650 | /** |
| 1651 | * Retrieves the value of the designated column in the current row |
| 1652 | * of this <code>JoinRowSetImpl</code> object as an |
| 1653 | * <code>Object</code> value. |
| 1654 | * <P> |
| 1655 | * The type of the <code>Object</code> will be the default |
| 1656 | * Java object type corresponding to the column's SQL type, |
| 1657 | * following the mapping for built-in types specified in the JDBC |
| 1658 | * specification. |
| 1659 | * <P> |
| 1660 | * This method may also be used to read datatabase-specific |
| 1661 | * abstract data types. |
| 1662 | * <P> |
| 1663 | * This implementation of the method <code>getObject</code> extends its |
| 1664 | * behavior so that it gets the attributes of an SQL structured type as |
| 1665 | * as an array of <code>Object</code> values. This method also custom |
| 1666 | * maps SQL user-defined types to classes in the Java programming language. |
| 1667 | * When the specified column contains |
| 1668 | * a structured or distinct value, the behavior of this method is as |
| 1669 | * if it were a call to the method <code>getObject(columnIndex, |
| 1670 | * this.getStatement().getConnection().getTypeMap())</code>. |
| 1671 | * |
| 1672 | * @param columnIndex the first column is <code>1</code>, the second |
| 1673 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1674 | * and equal to or less than the number of columns in the rowset |
| 1675 | * @return a <code>java.lang.Object</code> holding the column value; |
| 1676 | * if the value is SQL <code>NULL</code>, the result is <code>null</code> |
| 1677 | * @throws SQLException if the given column index is out of bounds, |
| 1678 | * the cursor is not on a valid row, or there is a problem getting |
| 1679 | * the <code>Class</code> object for a custom mapping |
| 1680 | * @since 1.2 |
| 1681 | */ |
| 1682 | public Object getObject(int columnIndex) throws SQLException { |
| 1683 | return crsInternal.getObject(columnIndex); |
| 1684 | } |
| 1685 | |
| 1686 | /** |
| 1687 | * Retrieves the value of the designated column in the current row |
| 1688 | * of this <code>JoinRowSetImpl</code> object as an |
| 1689 | * <code>Object</code> value. |
| 1690 | * <P> |
| 1691 | * The type of the <code>Object</code> will be the default |
| 1692 | * Java object type corresponding to the column's SQL type, |
| 1693 | * following the mapping for built-in types specified in the JDBC |
| 1694 | * specification. |
| 1695 | * <P> |
| 1696 | * This method may also be used to read datatabase-specific |
| 1697 | * abstract data types. |
| 1698 | * <P> |
| 1699 | * This implementation of the method <code>getObject</code> extends its |
| 1700 | * behavior so that it gets the attributes of an SQL structured type as |
| 1701 | * as an array of <code>Object</code> values. This method also custom |
| 1702 | * maps SQL user-defined types to classes |
| 1703 | * in the Java programming language. When the specified column contains |
| 1704 | * a structured or distinct value, the behavior of this method is as |
| 1705 | * if it were a call to the method <code>getObject(columnIndex, |
| 1706 | * this.getStatement().getConnection().getTypeMap())</code>. |
| 1707 | * |
| 1708 | * @param columnIndex the first column is <code>1</code>, the second |
| 1709 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1710 | * and equal to or less than the number of columns in the rowset |
| 1711 | * @param map a <code>java.util.Map</code> object showing the mapping |
| 1712 | * from SQL type names to classes in the Java programming |
| 1713 | * language |
| 1714 | * @return a <code>java.lang.Object</code> holding the column value; |
| 1715 | * if the value is SQL <code>NULL</code>, the result is |
| 1716 | * <code>null</code> |
| 1717 | * @throws SQLException if (1) the given column name does not match |
| 1718 | * one of this rowset's column names, (2) the cursor is not |
| 1719 | * on a valid row, or (3) there is a problem getting |
| 1720 | * the <code>Class</code> object for a custom mapping |
| 1721 | */ |
| 1722 | public Object getObject(int columnIndex, |
| 1723 | java.util.Map<String,Class<?>> map) |
| 1724 | throws SQLException { |
| 1725 | return crsInternal.getObject(columnIndex, map); |
| 1726 | } |
| 1727 | |
| 1728 | /** |
| 1729 | * Retrieves the value of the designated column in the current row |
| 1730 | * of this <code>JoinRowSetImpl</code> object as an |
| 1731 | * <code>Object</code> value. |
| 1732 | * <P> |
| 1733 | * The type of the <code>Object</code> will be the default |
| 1734 | * Java object type corresponding to the column's SQL type, |
| 1735 | * following the mapping for built-in types specified in the JDBC |
| 1736 | * specification. |
| 1737 | * <P> |
| 1738 | * This method may also be used to read datatabase-specific |
| 1739 | * abstract data types. |
| 1740 | * <P> |
| 1741 | * This implementation of the method <code>getObject</code> extends its |
| 1742 | * behavior so that it gets the attributes of an SQL structured type as |
| 1743 | * as an array of <code>Object</code> values. This method also custom |
| 1744 | * maps SQL user-defined types to classes |
| 1745 | * in the Java programming language. When the specified column contains |
| 1746 | * a structured or distinct value, the behavior of this method is as |
| 1747 | * if it were a call to the method <code>getObject(columnIndex, |
| 1748 | * this.getStatement().getConnection().getTypeMap())</code>. |
| 1749 | * |
| 1750 | * @param columnName a <code>String</code> object that must match the |
| 1751 | * SQL name of a column in this rowset, ignoring case |
| 1752 | * @return a <code>java.lang.Object</code> holding the column value; |
| 1753 | * if the value is SQL <code>NULL</code>, the result is |
| 1754 | * <code>null</code> |
| 1755 | * @throws SQLException if (1) the given column name does not match |
| 1756 | * one of this rowset's column names, (2) the cursor is not |
| 1757 | * on a valid row, or (3) there is a problem getting |
| 1758 | * the <code>Class</code> object for a custom mapping |
| 1759 | */ |
| 1760 | public Object getObject(String columnName) throws SQLException { |
| 1761 | return crsInternal.getObject(columnName); |
| 1762 | } |
| 1763 | |
| 1764 | /** |
| 1765 | * Retrieves the value of the designated column in this |
| 1766 | * <code>JoinRowSetImpl</code> object as an <code>Object</code> in |
| 1767 | * the Java programming lanugage, using the given |
| 1768 | * <code>java.util.Map</code> object to custom map the value if |
| 1769 | * appropriate. |
| 1770 | * |
| 1771 | * @param columnName a <code>String</code> object that must match the |
| 1772 | * SQL name of a column in this rowset, ignoring case |
| 1773 | * @param map a <code>java.util.Map</code> object showing the mapping |
| 1774 | * from SQL type names to classes in the Java programming |
| 1775 | * language |
| 1776 | * @return an <code>Object</code> representing the SQL value |
| 1777 | * @throws SQLException if the given column index is out of bounds or |
| 1778 | * the cursor is not on one of this rowset's rows or its |
| 1779 | * insert row |
| 1780 | */ |
| 1781 | public Object getObject(String columnName, |
| 1782 | java.util.Map<String,Class<?>> map) |
| 1783 | throws SQLException { |
| 1784 | return crsInternal.getObject(columnName, map); |
| 1785 | } |
| 1786 | |
| 1787 | /** |
| 1788 | * Retrieves the value stored in the designated column |
| 1789 | * of the current row as a <code>java.io.Reader</code> object. |
| 1790 | * |
| 1791 | * <P><B>Note:</B> All the data in the returned stream must |
| 1792 | * be read prior to getting the value of any other column. The |
| 1793 | * next call to a <code>getXXX</code> method implicitly closes the stream. |
| 1794 | * |
| 1795 | * @param columnIndex the first column is <code>1</code>, the second |
| 1796 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1797 | * and equal to or less than the number of columns in the rowset |
| 1798 | * @return a Java character stream that delivers the database column value |
| 1799 | * as a <code>java.io.Reader</code> object. If the value is |
| 1800 | * SQL <code>NULL</code>, the result is <code>null</code>. |
| 1801 | * @throws SQLException if the given column index is out of bounds, |
| 1802 | * the cursor is not on a valid row, or there is a type mismatch |
| 1803 | */ |
| 1804 | public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { |
| 1805 | return crsInternal.getCharacterStream(columnIndex); |
| 1806 | } |
| 1807 | |
| 1808 | /** |
| 1809 | * Retrieves the value stored in the designated column |
| 1810 | * of the current row as a <code>java.io.Reader</code> object. |
| 1811 | * |
| 1812 | * <P><B>Note:</B> All the data in the returned stream must |
| 1813 | * be read prior to getting the value of any other column. The |
| 1814 | * next call to a <code>getXXX</code> method implicitly closes the stream. |
| 1815 | * |
| 1816 | * @param columnName a <code>String</code> object giving the SQL name of |
| 1817 | * a column in this <code>JoinRowSetImpl</code> object |
| 1818 | * @return a Java input stream that delivers the database column value |
| 1819 | * as a stream of two-byte Unicode characters. If the value is |
| 1820 | * SQL <code>NULL</code>, the result is <code>null</code>. |
| 1821 | * @throws SQLException if the given column index is out of bounds, |
| 1822 | * the cursor is not on a valid row, or there is a type mismatch |
| 1823 | */ |
| 1824 | public java.io.Reader getCharacterStream(String columnName) throws SQLException { |
| 1825 | return crsInternal.getCharacterStream(columnName); |
| 1826 | } |
| 1827 | |
| 1828 | /** |
| 1829 | * Retrieves the value of the designated column in the current row |
| 1830 | * of this <code>JoinRowSetImpl</code> object as a |
| 1831 | * <code>java.math.BigDecimal</code> object. |
| 1832 | * |
| 1833 | * @param columnIndex the first column is <code>1</code>, the second |
| 1834 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 1835 | * and equal to or less than the number of columns in the rowset |
| 1836 | * @return a <code>java.math.BigDecimal</code> value with full precision; |
| 1837 | * if the value is SQL <code>NULL</code>, the result is <code>null</code> |
| 1838 | * @throws SQLException if the given column index is out of bounds, |
| 1839 | * the cursor is not on a valid row, or this method fails |
| 1840 | */ |
| 1841 | public BigDecimal getBigDecimal(int columnIndex) throws SQLException { |
| 1842 | return crsInternal.getBigDecimal(columnIndex); |
| 1843 | } |
| 1844 | |
| 1845 | /** |
| 1846 | * Retrieves the value of the designated column in the current row |
| 1847 | * of this <code>JoinRowSetImpl</code> object as a |
| 1848 | * <code>java.math.BigDecimal</code> object. |
| 1849 | * |
| 1850 | * @param columnName a <code>String</code> object that must match the |
| 1851 | * SQL name of a column in this rowset, ignoring case |
| 1852 | * @return a <code>java.math.BigDecimal</code> value with full precision; |
| 1853 | * if the value is SQL <code>NULL</code>, the result is <code>null</code> |
| 1854 | * @throws SQLException if the given column index is out of bounds, |
| 1855 | * the cursor is not on a valid row, or this method fails |
| 1856 | */ |
| 1857 | public BigDecimal getBigDecimal(String columnName) throws SQLException { |
| 1858 | return crsInternal.getBigDecimal(columnName); |
| 1859 | } |
| 1860 | |
| 1861 | /** |
| 1862 | * Returns the number of rows in this <code>JoinRowSetImpl</code> object. |
| 1863 | * |
| 1864 | * @return number of rows in the rowset |
| 1865 | */ |
| 1866 | public int size() { |
| 1867 | return crsInternal.size(); |
| 1868 | } |
| 1869 | |
| 1870 | /** |
| 1871 | * Indicates whether the cursor is before the first row in this |
| 1872 | * <code>JoinRowSetImpl</code> object. |
| 1873 | * |
| 1874 | * @return <code>true</code> if the cursor is before the first row; |
| 1875 | * <code>false</code> otherwise or if the rowset contains no rows |
| 1876 | * @throws SQLException if an error occurs |
| 1877 | */ |
| 1878 | public boolean isBeforeFirst() throws SQLException { |
| 1879 | return crsInternal.isBeforeFirst(); |
| 1880 | } |
| 1881 | |
| 1882 | /** |
| 1883 | * Indicates whether the cursor is after the last row in this |
| 1884 | * <code>JoinRowSetImpl</code> object. |
| 1885 | * |
| 1886 | * @return <code>true</code> if the cursor is after the last row; |
| 1887 | * <code>false</code> otherwise or if the rowset contains no rows |
| 1888 | * @throws SQLException if an error occurs |
| 1889 | */ |
| 1890 | public boolean isAfterLast() throws SQLException { |
| 1891 | return crsInternal.isAfterLast(); |
| 1892 | } |
| 1893 | |
| 1894 | /** |
| 1895 | * Indicates whether the cursor is on the first row in this |
| 1896 | * <code>JoinRowSetImpl</code> object. |
| 1897 | * |
| 1898 | * @return <code>true</code> if the cursor is on the first row; |
| 1899 | * <code>false</code> otherwise or if the rowset contains no rows |
| 1900 | * @throws SQLException if an error occurs |
| 1901 | */ |
| 1902 | public boolean isFirst() throws SQLException { |
| 1903 | return crsInternal.isFirst(); |
| 1904 | } |
| 1905 | |
| 1906 | /** |
| 1907 | * Indicates whether the cursor is on the last row in this |
| 1908 | * <code>JoinRowSetImpl</code> object. |
| 1909 | * <P> |
| 1910 | * Note: Calling the method <code>isLast</code> may be expensive |
| 1911 | * because the JDBC driver might need to fetch ahead one row in order |
| 1912 | * to determine whether the current row is the last row in this rowset. |
| 1913 | * |
| 1914 | * @return <code>true</code> if the cursor is on the last row; |
| 1915 | * <code>false</code> otherwise or if this rowset contains no rows |
| 1916 | * @throws SQLException if an error occurs |
| 1917 | */ |
| 1918 | public boolean isLast() throws SQLException { |
| 1919 | return crsInternal.isLast(); |
| 1920 | } |
| 1921 | |
| 1922 | /** |
| 1923 | * Moves this <code>JoinRowSetImpl</code> object's cursor to the front of |
| 1924 | * the rowset, just before the first row. This method has no effect if |
| 1925 | * this rowset contains no rows. |
| 1926 | * |
| 1927 | * @throws SQLException if an error occurs or the type of this rowset |
| 1928 | * is <code>ResultSet.TYPE_FORWARD_ONLY</code> |
| 1929 | */ |
| 1930 | public void beforeFirst() throws SQLException { |
| 1931 | crsInternal.beforeFirst(); |
| 1932 | } |
| 1933 | |
| 1934 | /** |
| 1935 | * Moves this <code>JoinRowSetImpl</code> object's cursor to the end of |
| 1936 | * the rowset, just after the last row. This method has no effect if |
| 1937 | * this rowset contains no rows. |
| 1938 | * |
| 1939 | * @throws SQLException if an error occurs |
| 1940 | */ |
| 1941 | public void afterLast() throws SQLException { |
| 1942 | crsInternal.afterLast(); |
| 1943 | } |
| 1944 | |
| 1945 | /** |
| 1946 | * Moves this <code>JoinRowSetImpl</code> object's cursor to the first row |
| 1947 | * and returns <code>true</code> if the operation was successful. This |
| 1948 | * method also notifies registered listeners that the cursor has moved. |
| 1949 | * |
| 1950 | * @return <code>true</code> if the cursor is on a valid row; |
| 1951 | * <code>false</code> otherwise or if there are no rows in this |
| 1952 | * <code>JoinRowSetImpl</code> object |
| 1953 | * @throws SQLException if the type of this rowset |
| 1954 | * is <code>ResultSet.TYPE_FORWARD_ONLY</code> |
| 1955 | */ |
| 1956 | public boolean first() throws SQLException { |
| 1957 | return crsInternal.first(); |
| 1958 | } |
| 1959 | |
| 1960 | |
| 1961 | /** |
| 1962 | * Moves this <code>JoinRowSetImpl</code> object's cursor to the last row |
| 1963 | * and returns <code>true</code> if the operation was successful. This |
| 1964 | * method also notifies registered listeners that the cursor has moved. |
| 1965 | * |
| 1966 | * @return <code>true</code> if the cursor is on a valid row; |
| 1967 | * <code>false</code> otherwise or if there are no rows in this |
| 1968 | * <code>JoinRowSetImpl</code> object |
| 1969 | * @throws SQLException if the type of this rowset |
| 1970 | * is <code>ResultSet.TYPE_FORWARD_ONLY</code> |
| 1971 | */ |
| 1972 | public boolean last() throws SQLException { |
| 1973 | return crsInternal.last(); |
| 1974 | } |
| 1975 | |
| 1976 | /** |
| 1977 | * Returns the number of the current row in this <code>JoinRowSetImpl</code> |
| 1978 | * object. The first row is number 1, the second number 2, and so on. |
| 1979 | * |
| 1980 | * @return the number of the current row; <code>0</code> if there is no |
| 1981 | * current row |
| 1982 | * @throws SQLException if an error occurs |
| 1983 | */ |
| 1984 | public int getRow() throws SQLException { |
| 1985 | return crsInternal.getRow(); |
| 1986 | } |
| 1987 | |
| 1988 | /** |
| 1989 | * Moves this <code>JoinRowSetImpl</code> object's cursor to the row number |
| 1990 | * specified. |
| 1991 | * |
| 1992 | * <p>If the number is positive, the cursor moves to an absolute row with |
| 1993 | * respect to the beginning of the rowset. The first row is row 1, the second |
| 1994 | * is row 2, and so on. For example, the following command, in which |
| 1995 | * <code>crs</code> is a <code>JoinRowSetImpl</code> object, moves the cursor |
| 1996 | * to the fourth row, starting from the beginning of the rowset. |
| 1997 | * <PRE><code> |
| 1998 | * |
| 1999 | * crs.absolute(4); |
| 2000 | * |
| 2001 | * </code> </PRE> |
| 2002 | * <P> |
| 2003 | * If the number is negative, the cursor moves to an absolute row position |
| 2004 | * with respect to the end of the rowset. For example, calling |
| 2005 | * <code>absolute(-1)</code> positions the cursor on the last row, |
| 2006 | * <code>absolute(-2)</code> moves it on the next-to-last row, and so on. |
| 2007 | * If the <code>JoinRowSetImpl</code> object <code>crs</code> has five rows, |
| 2008 | * the following command moves the cursor to the fourth-to-last row, which |
| 2009 | * in the case of a rowset with five rows, is also the second row, counting |
| 2010 | * from the beginning. |
| 2011 | * <PRE><code> |
| 2012 | * |
| 2013 | * crs.absolute(-4); |
| 2014 | * |
| 2015 | * </code> </PRE> |
| 2016 | * |
| 2017 | * If the number specified is larger than the number of rows, the cursor |
| 2018 | * will move to the position after the last row. If the number specified |
| 2019 | * would move the cursor one or more rows before the first row, the cursor |
| 2020 | * moves to the position before the first row. |
| 2021 | * <P> |
| 2022 | * Note: Calling <code>absolute(1)</code> is the same as calling the |
| 2023 | * method <code>first()</code>. Calling <code>absolute(-1)</code> is the |
| 2024 | * same as calling <code>last()</code>. |
| 2025 | * |
| 2026 | * @param row a positive number to indicate the row, starting row numbering from |
| 2027 | * the first row, which is <code>1</code>; a negative number to indicate |
| 2028 | * the row, starting row numbering from the last row, which is |
| 2029 | * <code>-1</code>; must not be <code>0</code> |
| 2030 | * @return <code>true</code> if the cursor is on the rowset; <code>false</code> |
| 2031 | * otherwise |
| 2032 | * @throws SQLException if the given cursor position is <code>0</code> or the |
| 2033 | * type of this rowset is <code>ResultSet.TYPE_FORWARD_ONLY</code> |
| 2034 | */ |
| 2035 | public boolean absolute(int row) throws SQLException { |
| 2036 | return crsInternal.absolute(row); |
| 2037 | } |
| 2038 | |
| 2039 | /** |
| 2040 | * Moves the cursor the specified number of rows from the current |
| 2041 | * position, with a positive number moving it forward and a |
| 2042 | * negative number moving it backward. |
| 2043 | * <P> |
| 2044 | * If the number is positive, the cursor moves the specified number of |
| 2045 | * rows toward the end of the rowset, starting at the current row. |
| 2046 | * For example, the following command, in which |
| 2047 | * <code>crs</code> is a <code>JoinRowSetImpl</code> object with 100 rows, |
| 2048 | * moves the cursor forward four rows from the current row. If the |
| 2049 | * current row is 50, the cursor would move to row 54. |
| 2050 | * <PRE><code> |
| 2051 | * |
| 2052 | * crs.relative(4); |
| 2053 | * |
| 2054 | * </code> </PRE> |
| 2055 | * <P> |
| 2056 | * If the number is negative, the cursor moves back toward the beginning |
| 2057 | * the specified number of rows, starting at the current row. |
| 2058 | * For example, calling the method |
| 2059 | * <code>absolute(-1)</code> positions the cursor on the last row, |
| 2060 | * <code>absolute(-2)</code> moves it on the next-to-last row, and so on. |
| 2061 | * If the <code>JoinRowSetImpl</code> object <code>crs</code> has five rows, |
| 2062 | * the following command moves the cursor to the fourth-to-last row, which |
| 2063 | * in the case of a rowset with five rows, is also the second row |
| 2064 | * from the beginning. |
| 2065 | * <PRE><code> |
| 2066 | * |
| 2067 | * crs.absolute(-4); |
| 2068 | * |
| 2069 | * </code> </PRE> |
| 2070 | * |
| 2071 | * If the number specified is larger than the number of rows, the cursor |
| 2072 | * will move to the position after the last row. If the number specified |
| 2073 | * would move the cursor one or more rows before the first row, the cursor |
| 2074 | * moves to the position before the first row. In both cases, this method |
| 2075 | * throws an <code>SQLException</code>. |
| 2076 | * <P> |
| 2077 | * Note: Calling <code>absolute(1)</code> is the same as calling the |
| 2078 | * method <code>first()</code>. Calling <code>absolute(-1)</code> is the |
| 2079 | * same as calling <code>last()</code>. Calling <code>relative(0)</code> |
| 2080 | * is valid, but it does not change the cursor position. |
| 2081 | * |
| 2082 | * @param rows an <code>int</code> indicating the number of rows to move |
| 2083 | * the cursor, starting at the current row; a positive number |
| 2084 | * moves the cursor forward; a negative number moves the cursor |
| 2085 | * backward; must not move the cursor past the valid |
| 2086 | * rows |
| 2087 | * @return <code>true</code> if the cursor is on a row in this |
| 2088 | * <code>JoinRowSetImpl</code> object; <code>false</code> |
| 2089 | * otherwise |
| 2090 | * @throws SQLException if there are no rows in this rowset, the cursor is |
| 2091 | * positioned either before the first row or after the last row, or |
| 2092 | * the rowset is type <code>ResultSet.TYPE_FORWARD_ONLY</code> |
| 2093 | */ |
| 2094 | public boolean relative(int rows) throws SQLException { |
| 2095 | return crsInternal.relative(rows); |
| 2096 | } |
| 2097 | |
| 2098 | /** |
| 2099 | * Moves this <code>JoinRowSetImpl</code> object's cursor to the |
| 2100 | * previous row and returns <code>true</code> if the cursor is on |
| 2101 | * a valid row or <code>false</code> if it is not. |
| 2102 | * This method also notifies all listeners registered with this |
| 2103 | * <code>JoinRowSetImpl</code> object that its cursor has moved. |
| 2104 | * <P> |
| 2105 | * Note: calling the method <code>previous()</code> is not the same |
| 2106 | * as calling the method <code>relative(-1)</code>. This is true |
| 2107 | * because it is possible to call <code>previous()</code> from the insert |
| 2108 | * row, from after the last row, or from the current row, whereas |
| 2109 | * <code>relative</code> may only be called from the current row. |
| 2110 | * <P> |
| 2111 | * The method <code>previous</code> may used in a <code>while</code> |
| 2112 | * loop to iterate through a rowset starting after the last row |
| 2113 | * and moving toward the beginning. The loop ends when <code>previous</code> |
| 2114 | * returns <code>false</code>, meaning that there are no more rows. |
| 2115 | * For example, the following code fragment retrieves all the data in |
| 2116 | * the <code>JoinRowSetImpl</code> object <code>crs</code>, which has |
| 2117 | * three columns. Note that the cursor must initially be positioned |
| 2118 | * after the last row so that the first call to the method |
| 2119 | * <code>previous</code> places the cursor on the last line. |
| 2120 | * <PRE> <code> |
| 2121 | * |
| 2122 | * crs.afterLast(); |
| 2123 | * while (previous()) { |
| 2124 | * String name = crs.getString(1); |
| 2125 | * int age = crs.getInt(2); |
| 2126 | * short ssn = crs.getShort(3); |
| 2127 | * System.out.println(name + " " + age + " " + ssn); |
| 2128 | * } |
| 2129 | * |
| 2130 | * </code> </PRE> |
| 2131 | * This method throws an <code>SQLException</code> if the cursor is not |
| 2132 | * on a row in the rowset, before the first row, or after the last row. |
| 2133 | * |
| 2134 | * @return <code>true</code> if the cursor is on a valid row; |
| 2135 | * <code>false</code> if it is before the first row or after the |
| 2136 | * last row |
| 2137 | * @throws SQLException if the cursor is not on a valid position or the |
| 2138 | * type of this rowset is <code>ResultSet.TYPE_FORWARD_ONLY</code> |
| 2139 | */ |
| 2140 | public boolean previous() throws SQLException { |
| 2141 | return crsInternal.previous(); |
| 2142 | } |
| 2143 | |
| 2144 | /** |
| 2145 | * Returns the index of the column whose name is <i>columnName</i>. |
| 2146 | * |
| 2147 | * @param columnName a <code>String</code> object giving the name of the |
| 2148 | * column for which the index will be returned; the name must |
| 2149 | * match the SQL name of a column in this <code>JoinRowSet</code> |
| 2150 | * object, ignoring case |
| 2151 | * @throws SQLException if the given column name does not match one of the |
| 2152 | * column names for this <code>JoinRowSet</code> object |
| 2153 | */ |
| 2154 | public int findColumn(String columnName) throws SQLException { |
| 2155 | return crsInternal.findColumn(columnName); |
| 2156 | } |
| 2157 | |
| 2158 | /** |
| 2159 | * Indicates whether the current row of this <code>JoinRowSetImpl</code> |
| 2160 | * object has been updated. The value returned |
| 2161 | * depends on whether this rowset can detect updates: <code>false</code> |
| 2162 | * will always be returned if it does not detect updates. |
| 2163 | * |
| 2164 | * @return <code>true</code> if the row has been visibly updated |
| 2165 | * by the owner or another and updates are detected; |
| 2166 | * <code>false</code> otherwise |
| 2167 | * @throws SQLException if the cursor is on the insert row or not |
| 2168 | * on a valid row |
| 2169 | * |
| 2170 | * @see DatabaseMetaData#updatesAreDetected |
| 2171 | */ |
| 2172 | public boolean rowUpdated() throws SQLException { |
| 2173 | return crsInternal.rowUpdated(); |
| 2174 | } |
| 2175 | |
| 2176 | /** |
| 2177 | * Indicates whether the designated column of the current row of |
| 2178 | * this <code>JoinRowSetImpl</code> object has been updated. The |
| 2179 | * value returned depends on whether this rowset can detcted updates: |
| 2180 | * <code>false</code> will always be returned if it does not detect updates. |
| 2181 | * |
| 2182 | * @return <code>true</code> if the column updated |
| 2183 | * <code>false</code> otherwse |
| 2184 | * @throws SQLException if the cursor is on the insert row or not |
| 2185 | * on a valid row |
| 2186 | * @see DatabaseMetaData#updatesAreDetected |
| 2187 | */ |
| 2188 | public boolean columnUpdated(int indexColumn) throws SQLException { |
| 2189 | return crsInternal.columnUpdated(indexColumn); |
| 2190 | } |
| 2191 | |
| 2192 | /** |
| 2193 | * Indicates whether the current row has been inserted. The value returned |
| 2194 | * depends on whether or not the rowset can detect visible inserts. |
| 2195 | * |
| 2196 | * @return <code>true</code> if a row has been inserted and inserts are detected; |
| 2197 | * <code>false</code> otherwise |
| 2198 | * @throws SQLException if the cursor is on the insert row or not |
| 2199 | * not on a valid row |
| 2200 | * |
| 2201 | * @see DatabaseMetaData#insertsAreDetected |
| 2202 | */ |
| 2203 | public boolean rowInserted() throws SQLException { |
| 2204 | return crsInternal.rowInserted(); |
| 2205 | } |
| 2206 | |
| 2207 | /** |
| 2208 | * Indicates whether the current row has been deleted. A deleted row |
| 2209 | * may leave a visible "hole" in a rowset. This method can be used to |
| 2210 | * detect such holes if the rowset can detect deletions. This method |
| 2211 | * will always return <code>false</code> if this rowset cannot detect |
| 2212 | * deletions. |
| 2213 | * |
| 2214 | * @return <code>true</code> if (1)the current row is blank, indicating that |
| 2215 | * the row has been deleted, and (2)deletions are detected; |
| 2216 | * <code>false</code> otherwise |
| 2217 | * @throws SQLException if the cursor is on a valid row in this rowset |
| 2218 | * @see DatabaseMetaData#deletesAreDetected |
| 2219 | */ |
| 2220 | public boolean rowDeleted() throws SQLException { |
| 2221 | return crsInternal.rowDeleted(); |
| 2222 | } |
| 2223 | |
| 2224 | /** |
| 2225 | * Sets the designated nullable column in the current row or the |
| 2226 | * insert row of this <code>JoinRowSetImpl</code> object with |
| 2227 | * <code>null</code> value. |
| 2228 | * <P> |
| 2229 | * This method updates a column value in the current row or the insert |
| 2230 | * row of this rowset; however, another method must be called to complete |
| 2231 | * the update process. If the cursor is on a row in the rowset, the |
| 2232 | * method {@link #updateRow} must be called to mark the row as updated |
| 2233 | * and to notify listeners that the row has changed. |
| 2234 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2235 | * must be called to insert the new row into this rowset and to notify |
| 2236 | * listeners that a row has changed. |
| 2237 | * <P> |
| 2238 | * In order to propagate updates in this rowset to the underlying |
| 2239 | * data source, an application must call the method acceptChanges |
| 2240 | * after it calls either <code>updateRow</code> or <code>insertRow</code>. |
| 2241 | * |
| 2242 | * @param columnIndex the first column is <code>1</code>, the second |
| 2243 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2244 | * and equal to or less than the number of columns in this rowset |
| 2245 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2246 | * (2) the cursor is not on one of this rowset's rows or its |
| 2247 | * insert row, or (3) this rowset is |
| 2248 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2249 | */ |
| 2250 | public void updateNull(int columnIndex) throws SQLException { |
| 2251 | crsInternal.updateNull(columnIndex); |
| 2252 | } |
| 2253 | |
| 2254 | /** |
| 2255 | * Sets the designated column in either the current row or the insert |
| 2256 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2257 | * <code>boolean</code> value. |
| 2258 | * <P> |
| 2259 | * This method updates a column value in the current row or the insert |
| 2260 | * row of this rowset, but it does not update the database. |
| 2261 | * If the cursor is on a row in the rowset, the |
| 2262 | * method {@link #updateRow} must be called to update the database. |
| 2263 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2264 | * must be called, which will insert the new row into both this rowset |
| 2265 | * and the database. Both of these methods must be called before the |
| 2266 | * cursor moves to another row. |
| 2267 | * |
| 2268 | * @param columnIndex the first column is <code>1</code>, the second |
| 2269 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2270 | * and equal to or less than the number of columns in this rowset |
| 2271 | * @param x the new column value |
| 2272 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2273 | * (2) the cursor is not on one of this rowset's rows or its |
| 2274 | * insert row, or (3) this rowset is |
| 2275 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2276 | */ |
| 2277 | public void updateBoolean(int columnIndex, boolean x) throws SQLException { |
| 2278 | crsInternal.updateBoolean(columnIndex, x); |
| 2279 | } |
| 2280 | |
| 2281 | /** |
| 2282 | * Sets the designated column in either the current row or the insert |
| 2283 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2284 | * <code>byte</code> value. |
| 2285 | * <P> |
| 2286 | * This method updates a column value in the current row or the insert |
| 2287 | * row of this rowset, but it does not update the database. |
| 2288 | * If the cursor is on a row in the rowset, the |
| 2289 | * method {@link #updateRow} must be called to update the database. |
| 2290 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2291 | * must be called, which will insert the new row into both this rowset |
| 2292 | * and the database. Both of these methods must be called before the |
| 2293 | * cursor moves to another row. |
| 2294 | * |
| 2295 | * @param columnIndex the first column is <code>1</code>, the second |
| 2296 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2297 | * and equal to or less than the number of columns in this rowset |
| 2298 | * @param x the new column value |
| 2299 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2300 | * (2) the cursor is not on one of this rowset's rows or its |
| 2301 | * insert row, or (3) this rowset is |
| 2302 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2303 | */ |
| 2304 | public void updateByte(int columnIndex, byte x) throws SQLException { |
| 2305 | crsInternal.updateByte(columnIndex, x); |
| 2306 | } |
| 2307 | |
| 2308 | /** |
| 2309 | * Sets the designated column in either the current row or the insert |
| 2310 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2311 | * <code>short</code> value. |
| 2312 | * <P> |
| 2313 | * This method updates a column value in the current row or the insert |
| 2314 | * row of this rowset, but it does not update the database. |
| 2315 | * If the cursor is on a row in the rowset, the |
| 2316 | * method {@link #updateRow} must be called to update the database. |
| 2317 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2318 | * must be called, which will insert the new row into both this rowset |
| 2319 | * and the database. Both of these methods must be called before the |
| 2320 | * cursor moves to another row. |
| 2321 | * |
| 2322 | * @param columnIndex the first column is <code>1</code>, the second |
| 2323 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2324 | * and equal to or less than the number of columns in this rowset |
| 2325 | * @param x the new column value |
| 2326 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2327 | * (2) the cursor is not on one of this rowset's rows or its |
| 2328 | * insert row, or (3) this rowset is |
| 2329 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2330 | */ |
| 2331 | public void updateShort(int columnIndex, short x) throws SQLException { |
| 2332 | crsInternal.updateShort(columnIndex, x); |
| 2333 | } |
| 2334 | |
| 2335 | /** |
| 2336 | * Sets the designated column in either the current row or the insert |
| 2337 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2338 | * <code>int</code> value. |
| 2339 | * <P> |
| 2340 | * This method updates a column value in the current row or the insert |
| 2341 | * row of this rowset, but it does not update the database. |
| 2342 | * If the cursor is on a row in the rowset, the |
| 2343 | * method {@link #updateRow} must be called to update the database. |
| 2344 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2345 | * must be called, which will insert the new row into both this rowset |
| 2346 | * and the database. Both of these methods must be called before the |
| 2347 | * cursor moves to another row. |
| 2348 | * |
| 2349 | * @param columnIndex the first column is <code>1</code>, the second |
| 2350 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2351 | * and equal to or less than the number of columns in this rowset |
| 2352 | * @param x the new column value |
| 2353 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2354 | * (2) the cursor is not on one of this rowset's rows or its |
| 2355 | * insert row, or (3) this rowset is |
| 2356 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2357 | */ |
| 2358 | public void updateInt(int columnIndex, int x) throws SQLException { |
| 2359 | crsInternal.updateInt(columnIndex, x); |
| 2360 | } |
| 2361 | |
| 2362 | /** |
| 2363 | * Sets the designated column in either the current row or the insert |
| 2364 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2365 | * <code>long</code> value. |
| 2366 | * <P> |
| 2367 | * This method updates a column value in the current row or the insert |
| 2368 | * row of this rowset, but it does not update the database. |
| 2369 | * If the cursor is on a row in the rowset, the |
| 2370 | * method {@link #updateRow} must be called to update the database. |
| 2371 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2372 | * must be called, which will insert the new row into both this rowset |
| 2373 | * and the database. Both of these methods must be called before the |
| 2374 | * cursor moves to another row. |
| 2375 | * |
| 2376 | * @param columnIndex the first column is <code>1</code>, the second |
| 2377 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2378 | * and equal to or less than the number of columns in this rowset |
| 2379 | * @param x the new column value |
| 2380 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2381 | * (2) the cursor is not on one of this rowset's rows or its |
| 2382 | * insert row, or (3) this rowset is |
| 2383 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2384 | */ |
| 2385 | public void updateLong(int columnIndex, long x) throws SQLException { |
| 2386 | crsInternal.updateLong(columnIndex, x); |
| 2387 | } |
| 2388 | |
| 2389 | /** |
| 2390 | * Sets the designated column in either the current row or the insert |
| 2391 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2392 | * <code>float</code> value. |
| 2393 | * <P> |
| 2394 | * This method updates a column value in the current row or the insert |
| 2395 | * row of this rowset, but it does not update the database. |
| 2396 | * If the cursor is on a row in the rowset, the |
| 2397 | * method {@link #updateRow} must be called to update the database. |
| 2398 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2399 | * must be called, which will insert the new row into both this rowset |
| 2400 | * and the database. Both of these methods must be called before the |
| 2401 | * cursor moves to another row. |
| 2402 | * |
| 2403 | * @param columnIndex the first column is <code>1</code>, the second |
| 2404 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2405 | * and equal to or less than the number of columns in this rowset |
| 2406 | * @param x the new column value |
| 2407 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2408 | * (2) the cursor is not on one of this rowset's rows or its |
| 2409 | * insert row, or (3) this rowset is |
| 2410 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2411 | */ |
| 2412 | public void updateFloat(int columnIndex, float x) throws SQLException { |
| 2413 | crsInternal.updateFloat(columnIndex, x); |
| 2414 | } |
| 2415 | |
| 2416 | /** |
| 2417 | * Sets the designated column in either the current row or the insert |
| 2418 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2419 | * <code>double</code> value. |
| 2420 | * |
| 2421 | * This method updates a column value in either the current row or |
| 2422 | * the insert row of this rowset, but it does not update the |
| 2423 | * database. If the cursor is on a row in the rowset, the |
| 2424 | * method {@link #updateRow} must be called to update the database. |
| 2425 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2426 | * must be called, which will insert the new row into both this rowset |
| 2427 | * and the database. Both of these methods must be called before the |
| 2428 | * cursor moves to another row. |
| 2429 | * |
| 2430 | * @param columnIndex the first column is <code>1</code>, the second |
| 2431 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2432 | * and equal to or less than the number of columns in this rowset |
| 2433 | * @param x the new column value |
| 2434 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2435 | * (2) the cursor is not on one of this rowset's rows or its |
| 2436 | * insert row, or (3) this rowset is |
| 2437 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2438 | */ |
| 2439 | public void updateDouble(int columnIndex, double x) throws SQLException { |
| 2440 | crsInternal.updateDouble(columnIndex, x); |
| 2441 | } |
| 2442 | |
| 2443 | /** |
| 2444 | * Sets the designated column in either the current row or the insert |
| 2445 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2446 | * <code>java.math.BigDecimal</code> object. |
| 2447 | * <P> |
| 2448 | * This method updates a column value in the current row or the insert |
| 2449 | * row of this rowset, but it does not update the database. |
| 2450 | * If the cursor is on a row in the rowset, the |
| 2451 | * method {@link #updateRow} must be called to update the database. |
| 2452 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2453 | * must be called, which will insert the new row into both this rowset |
| 2454 | * and the database. Both of these methods must be called before the |
| 2455 | * cursor moves to another row. |
| 2456 | * |
| 2457 | * @param columnIndex the first column is <code>1</code>, the second |
| 2458 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2459 | * and equal to or less than the number of columns in this rowset |
| 2460 | * @param x the new column value |
| 2461 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2462 | * (2) the cursor is not on one of this rowset's rows or its |
| 2463 | * insert row, or (3) this rowset is |
| 2464 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2465 | */ |
| 2466 | public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { |
| 2467 | crsInternal.updateBigDecimal(columnIndex, x); |
| 2468 | } |
| 2469 | |
| 2470 | /** |
| 2471 | * Sets the designated column in either the current row or the insert |
| 2472 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2473 | * <code>String</code> object. |
| 2474 | * <P> |
| 2475 | * This method updates a column value in either the current row or |
| 2476 | * the insert row of this rowset, but it does not update the |
| 2477 | * database. If the cursor is on a row in the rowset, the |
| 2478 | * method {@link #updateRow} must be called to mark the row as updated. |
| 2479 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2480 | * must be called to insert the new row into this rowset and mark it |
| 2481 | * as inserted. Both of these methods must be called before the |
| 2482 | * cursor moves to another row. |
| 2483 | * <P> |
| 2484 | * The method <code>acceptChanges</code> must be called if the |
| 2485 | * updated values are to be written back to the underlying database. |
| 2486 | * |
| 2487 | * @param columnIndex the first column is <code>1</code>, the second |
| 2488 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2489 | * and equal to or less than the number of columns in this rowset |
| 2490 | * @param x the new column value |
| 2491 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2492 | * (2) the cursor is not on one of this rowset's rows or its |
| 2493 | * insert row, or (3) this rowset is |
| 2494 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2495 | */ |
| 2496 | public void updateString(int columnIndex, String x) throws SQLException { |
| 2497 | crsInternal.updateString(columnIndex, x); |
| 2498 | } |
| 2499 | |
| 2500 | /** |
| 2501 | * Sets the designated column in either the current row or the insert |
| 2502 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2503 | * <code>byte</code> array. |
| 2504 | * |
| 2505 | * This method updates a column value in either the current row or |
| 2506 | * the insert row of this rowset, but it does not update the |
| 2507 | * database. If the cursor is on a row in the rowset, the |
| 2508 | * method {@link #updateRow} must be called to update the database. |
| 2509 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2510 | * must be called, which will insert the new row into both this rowset |
| 2511 | * and the database. Both of these methods must be called before the |
| 2512 | * cursor moves to another row. |
| 2513 | * |
| 2514 | * @param columnIndex the first column is <code>1</code>, the second |
| 2515 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2516 | * and equal to or less than the number of columns in this rowset |
| 2517 | * @param x the new column value |
| 2518 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2519 | * (2) the cursor is not on one of this rowset's rows or its |
| 2520 | * insert row, or (3) this rowset is |
| 2521 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2522 | */ |
| 2523 | public void updateBytes(int columnIndex, byte x[]) throws SQLException { |
| 2524 | crsInternal.updateBytes(columnIndex, x); |
| 2525 | } |
| 2526 | |
| 2527 | /** |
| 2528 | * Sets the designated column in either the current row or the insert |
| 2529 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2530 | * <code>Date</code> object. |
| 2531 | * |
| 2532 | * This method updates a column value in either the current row or |
| 2533 | * the insert row of this rowset, but it does not update the |
| 2534 | * database. If the cursor is on a row in the rowset, the |
| 2535 | * method {@link #updateRow} must be called to update the database. |
| 2536 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2537 | * must be called, which will insert the new row into both this rowset |
| 2538 | * and the database. Both of these methods must be called before the |
| 2539 | * cursor moves to another row. |
| 2540 | * |
| 2541 | * @param columnIndex the first column is <code>1</code>, the second |
| 2542 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2543 | * and equal to or less than the number of columns in this rowset |
| 2544 | * @param x the new column value |
| 2545 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2546 | * (2) the cursor is not on one of this rowset's rows or its |
| 2547 | * insert row, (3) the type of the designated column is not |
| 2548 | * an SQL <code>DATE</code> or <code>TIMESTAMP</code>, or |
| 2549 | * (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2550 | */ |
| 2551 | public void updateDate(int columnIndex, java.sql.Date x) throws SQLException { |
| 2552 | crsInternal.updateDate(columnIndex, x); |
| 2553 | } |
| 2554 | |
| 2555 | /** |
| 2556 | * Sets the designated column in either the current row or the insert |
| 2557 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2558 | * <code>Time</code> object. |
| 2559 | * |
| 2560 | * This method updates a column value in either the current row or |
| 2561 | * the insert row of this rowset, but it does not update the |
| 2562 | * database. If the cursor is on a row in the rowset, the |
| 2563 | * method {@link #updateRow} must be called to update the database. |
| 2564 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2565 | * must be called, which will insert the new row into both this rowset |
| 2566 | * and the database. Both of these methods must be called before the |
| 2567 | * cursor moves to another row. |
| 2568 | * |
| 2569 | * @param columnIndex the first column is <code>1</code>, the second |
| 2570 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2571 | * and equal to or less than the number of columns in this rowset |
| 2572 | * @param x the new column value |
| 2573 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2574 | * (2) the cursor is not on one of this rowset's rows or its |
| 2575 | * insert row, (3) the type of the designated column is not |
| 2576 | * an SQL <code>TIME</code> or <code>TIMESTAMP</code>, or |
| 2577 | * (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2578 | */ |
| 2579 | public void updateTime(int columnIndex, java.sql.Time x) throws SQLException { |
| 2580 | crsInternal.updateTime(columnIndex, x); |
| 2581 | } |
| 2582 | |
| 2583 | /** |
| 2584 | * Sets the designated column in either the current row or the insert |
| 2585 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2586 | * <code>Timestamp</code> object. |
| 2587 | * |
| 2588 | * This method updates a column value in either the current row or |
| 2589 | * the insert row of this rowset, but it does not update the |
| 2590 | * database. If the cursor is on a row in the rowset, the |
| 2591 | * method {@link #updateRow} must be called to update the database. |
| 2592 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2593 | * must be called, which will insert the new row into both this rowset |
| 2594 | * and the database. Both of these methods must be called before the |
| 2595 | * cursor moves to another row. |
| 2596 | * |
| 2597 | * @param columnIndex the first column is <code>1</code>, the second |
| 2598 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2599 | * and equal to or less than the number of columns in this rowset |
| 2600 | * @param x the new column value |
| 2601 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2602 | * (2) the cursor is not on one of this rowset's rows or its |
| 2603 | * insert row, (3) the type of the designated column is not |
| 2604 | * an SQL <code>DATE</code>, <code>TIME</code>, or |
| 2605 | * <code>TIMESTAMP</code>, or (4) this rowset is |
| 2606 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2607 | */ |
| 2608 | public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws SQLException { |
| 2609 | crsInternal.updateTimestamp(columnIndex, x); |
| 2610 | } |
| 2611 | |
| 2612 | /* |
| 2613 | * Sets the designated column in either the current row or the insert |
| 2614 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2615 | * ASCII stream value. |
| 2616 | * <P> |
| 2617 | * This method updates a column value in either the current row or |
| 2618 | * the insert row of this rowset, but it does not update the |
| 2619 | * database. If the cursor is on a row in the rowset, the |
| 2620 | * method {@link #updateRow} must be called to update the database. |
| 2621 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2622 | * must be called, which will insert the new row into both this rowset |
| 2623 | * and the database. Both of these methods must be called before the |
| 2624 | * cursor moves to another row. |
| 2625 | * |
| 2626 | * @param columnIndex the first column is <code>1</code>, the second |
| 2627 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2628 | * and equal to or less than the number of columns in this rowset |
| 2629 | * @param x the new column value |
| 2630 | * @param length the number of one-byte ASCII characters in the stream |
| 2631 | * @throws UnsupportedOperationException if this method is invoked |
| 2632 | */ |
| 2633 | public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { |
| 2634 | crsInternal.updateAsciiStream(columnIndex, x, length); |
| 2635 | } |
| 2636 | |
| 2637 | /** |
| 2638 | * Sets the designated column in either the current row or the insert |
| 2639 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2640 | * <code>java.io.InputStream</code> object. |
| 2641 | * <P> |
| 2642 | * This method updates a column value in either the current row or |
| 2643 | * the insert row of this rowset, but it does not update the |
| 2644 | * database. If the cursor is on a row in the rowset, the |
| 2645 | * method {@link #updateRow} must be called to update the database. |
| 2646 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2647 | * must be called, which will insert the new row into both this rowset |
| 2648 | * and the database. Both of these methods must be called before the |
| 2649 | * cursor moves to another row. |
| 2650 | * |
| 2651 | * @param columnIndex the first column is <code>1</code>, the second |
| 2652 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2653 | * and equal to or less than the number of columns in this rowset |
| 2654 | * @param x the new column value; must be a <code>java.io.InputStream</code> |
| 2655 | * containing <code>BINARY</code>, <code>VARBINARY</code>, or |
| 2656 | * <code>LONGVARBINARY</code> data |
| 2657 | * @param length the length of the stream in bytes |
| 2658 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2659 | * (2) the cursor is not on one of this rowset's rows or its |
| 2660 | * insert row, (3) the data in the stream is not binary, or |
| 2661 | * (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2662 | */ |
| 2663 | public void updateBinaryStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { |
| 2664 | crsInternal.updateBinaryStream(columnIndex, x, length); |
| 2665 | } |
| 2666 | |
| 2667 | /** |
| 2668 | * Sets the designated column in either the current row or the insert |
| 2669 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2670 | * <code>java.io.Reader</code> object. |
| 2671 | * <P> |
| 2672 | * This method updates a column value in either the current row or |
| 2673 | * the insert row of this rowset, but it does not update the |
| 2674 | * database. If the cursor is on a row in the rowset, the |
| 2675 | * method {@link #updateRow} must be called to update the database. |
| 2676 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2677 | * must be called, which will insert the new row into both this rowset |
| 2678 | * and the database. Both of these methods must be called before the |
| 2679 | * cursor moves to another row. |
| 2680 | * |
| 2681 | * @param columnIndex the first column is <code>1</code>, the second |
| 2682 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2683 | * and equal to or less than the number of columns in this rowset |
| 2684 | * @param x the new column value; must be a <code>java.io.Reader</code> |
| 2685 | * containing <code>BINARY</code>, <code>VARBINARY</code>, |
| 2686 | * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>, |
| 2687 | * or <code>LONGVARCHAR</code> data |
| 2688 | * @param length the length of the stream in characters |
| 2689 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2690 | * (2) the cursor is not on one of this rowset's rows or its |
| 2691 | * insert row, (3) the data in the stream is not a binary or |
| 2692 | * character type, or (4) this rowset is |
| 2693 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2694 | */ |
| 2695 | public void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws SQLException { |
| 2696 | crsInternal.updateCharacterStream(columnIndex, x, length); |
| 2697 | } |
| 2698 | |
| 2699 | /** |
| 2700 | * Sets the designated column in either the current row or the insert |
| 2701 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2702 | * <code>Object</code> value. The <code>scale</code> parameter indicates |
| 2703 | * the number of digits to the right of the decimal point and is ignored |
| 2704 | * if the new column value is not a type that will be mapped to an SQL |
| 2705 | * <code>DECIMAL</code> or <code>NUMERIC</code> value. |
| 2706 | * <P> |
| 2707 | * This method updates a column value in either the current row or |
| 2708 | * the insert row of this rowset, but it does not update the |
| 2709 | * database. If the cursor is on a row in the rowset, the |
| 2710 | * method {@link #updateRow} must be called to update the database. |
| 2711 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2712 | * must be called, which will insert the new row into both this rowset |
| 2713 | * and the database. Both of these methods must be called before the |
| 2714 | * cursor moves to another row. |
| 2715 | * |
| 2716 | * @param columnIndex the first column is <code>1</code>, the second |
| 2717 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2718 | * and equal to or less than the number of columns in this rowset |
| 2719 | * @param x the new column value |
| 2720 | * @param scale the number of digits to the right of the decimal point (for |
| 2721 | * <code>DECIMAL</code> and <code>NUMERIC</code> types only) |
| 2722 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2723 | * (2) the cursor is not on one of this rowset's rows or its |
| 2724 | * insert row, or (3) this rowset is |
| 2725 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2726 | */ |
| 2727 | public void updateObject(int columnIndex, Object x, int scale) throws SQLException { |
| 2728 | crsInternal.updateObject(columnIndex, x, scale); |
| 2729 | } |
| 2730 | |
| 2731 | /** |
| 2732 | * Sets the designated column in either the current row or the insert |
| 2733 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2734 | * <code>Object</code> value. |
| 2735 | * <P> |
| 2736 | * This method updates a column value in either the current row or |
| 2737 | * the insert row of this rowset, but it does not update the |
| 2738 | * database. If the cursor is on a row in the rowset, the |
| 2739 | * method {@link #updateRow} must be called to update the database. |
| 2740 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2741 | * must be called, which will insert the new row into both this rowset |
| 2742 | * and the database. Both of these methods must be called before the |
| 2743 | * cursor moves to another row. |
| 2744 | * |
| 2745 | * @param columnIndex the first column is <code>1</code>, the second |
| 2746 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 2747 | * and equal to or less than the number of columns in this rowset |
| 2748 | * @param x the new column value |
| 2749 | * @throws SQLException if (1) the given column index is out of bounds, |
| 2750 | * (2) the cursor is not on one of this rowset's rows or its |
| 2751 | * insert row, or (3) this rowset is |
| 2752 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2753 | */ |
| 2754 | public void updateObject(int columnIndex, Object x) throws SQLException { |
| 2755 | crsInternal.updateObject(columnIndex, x); |
| 2756 | } |
| 2757 | |
| 2758 | // columnName updates |
| 2759 | |
| 2760 | /** |
| 2761 | * Sets the designated nullable column in the current row or the |
| 2762 | * insert row of this <code>JoinRowSetImpl</code> object with |
| 2763 | * <code>null</code> value. |
| 2764 | * <P> |
| 2765 | * This method updates a column value in the current row or the insert |
| 2766 | * row of this rowset, but it does not update the database. |
| 2767 | * If the cursor is on a row in the rowset, the |
| 2768 | * method {@link #updateRow} must be called to update the database. |
| 2769 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2770 | * must be called, which will insert the new row into both this rowset |
| 2771 | * and the database. |
| 2772 | * |
| 2773 | * @param columnName a <code>String</code> object that must match the |
| 2774 | * SQL name of a column in this rowset, ignoring case |
| 2775 | * @throws SQLException if (1) the given column name does not match the |
| 2776 | * name of a column in this rowset, (2) the cursor is not on |
| 2777 | * one of this rowset's rows or its insert row, or (3) this |
| 2778 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2779 | */ |
| 2780 | public void updateNull(String columnName) throws SQLException { |
| 2781 | crsInternal.updateNull(columnName); |
| 2782 | } |
| 2783 | |
| 2784 | /** |
| 2785 | * Sets the designated column in either the current row or the insert |
| 2786 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2787 | * <code>boolean</code> value. |
| 2788 | * <P> |
| 2789 | * This method updates a column value in the current row or the insert |
| 2790 | * row of this rowset, but it does not update the database. |
| 2791 | * If the cursor is on a row in the rowset, the |
| 2792 | * method {@link #updateRow} must be called to update the database. |
| 2793 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2794 | * must be called, which will insert the new row into both this rowset |
| 2795 | * and the database. Both of these methods must be called before the |
| 2796 | * cursor moves to another row. |
| 2797 | * |
| 2798 | * @param columnName a <code>String</code> object that must match the |
| 2799 | * SQL name of a column in this rowset, ignoring case |
| 2800 | * @param x the new column value |
| 2801 | * @throws SQLException if (1) the given column name does not match the |
| 2802 | * name of a column in this rowset, (2) the cursor is not on |
| 2803 | * one of this rowset's rows or its insert row, or (3) this |
| 2804 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2805 | */ |
| 2806 | public void updateBoolean(String columnName, boolean x) throws SQLException { |
| 2807 | crsInternal.updateBoolean(columnName, x); |
| 2808 | } |
| 2809 | |
| 2810 | /** |
| 2811 | * Sets the designated column in either the current row or the insert |
| 2812 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2813 | * <code>byte</code> value. |
| 2814 | * <P> |
| 2815 | * This method updates a column value in the current row or the insert |
| 2816 | * row of this rowset, but it does not update the database. |
| 2817 | * If the cursor is on a row in the rowset, the |
| 2818 | * method {@link #updateRow} must be called to update the database. |
| 2819 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2820 | * must be called, which will insert the new row into both this rowset |
| 2821 | * and the database. Both of these methods must be called before the |
| 2822 | * cursor moves to another row. |
| 2823 | * |
| 2824 | * @param columnName a <code>String</code> object that must match the |
| 2825 | * SQL name of a column in this rowset, ignoring case |
| 2826 | * @param x the new column value |
| 2827 | * @throws SQLException if (1) the given column name does not match the |
| 2828 | * name of a column in this rowset, (2) the cursor is not on |
| 2829 | * one of this rowset's rows or its insert row, or (3) this |
| 2830 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2831 | */ |
| 2832 | public void updateByte(String columnName, byte x) throws SQLException { |
| 2833 | crsInternal.updateByte(columnName, x); |
| 2834 | } |
| 2835 | |
| 2836 | /** |
| 2837 | * Sets the designated column in either the current row or the insert |
| 2838 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2839 | * <code>short</code> value. |
| 2840 | * <P> |
| 2841 | * This method updates a column value in the current row or the insert |
| 2842 | * row of this rowset, but it does not update the database. |
| 2843 | * If the cursor is on a row in the rowset, the |
| 2844 | * method {@link #updateRow} must be called to update the database. |
| 2845 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2846 | * must be called, which will insert the new row into both this rowset |
| 2847 | * and the database. Both of these methods must be called before the |
| 2848 | * cursor moves to another row. |
| 2849 | * |
| 2850 | * @param columnName a <code>String</code> object that must match the |
| 2851 | * SQL name of a column in this rowset, ignoring case |
| 2852 | * @param x the new column value |
| 2853 | * @throws SQLException if (1) the given column name does not match the |
| 2854 | * name of a column in this rowset, (2) the cursor is not on |
| 2855 | * one of this rowset's rows or its insert row, or (3) this |
| 2856 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2857 | */ |
| 2858 | public void updateShort(String columnName, short x) throws SQLException { |
| 2859 | crsInternal.updateShort(columnName, x); |
| 2860 | } |
| 2861 | |
| 2862 | /** |
| 2863 | * Sets the designated column in either the current row or the insert |
| 2864 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2865 | * <code>int</code> value. |
| 2866 | * <P> |
| 2867 | * This method updates a column value in the current row or the insert |
| 2868 | * row of this rowset, but it does not update the database. |
| 2869 | * If the cursor is on a row in the rowset, the |
| 2870 | * method {@link #updateRow} must be called to update the database. |
| 2871 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2872 | * must be called, which will insert the new row into both this rowset |
| 2873 | * and the database. Both of these methods must be called before the |
| 2874 | * cursor moves to another row. |
| 2875 | * |
| 2876 | * @param columnName a <code>String</code> object that must match the |
| 2877 | * SQL name of a column in this rowset, ignoring case |
| 2878 | * @param x the new column value |
| 2879 | * @throws SQLException if (1) the given column name does not match the |
| 2880 | * name of a column in this rowset, (2) the cursor is not on |
| 2881 | * one of this rowset's rows or its insert row, or (3) this |
| 2882 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2883 | */ |
| 2884 | public void updateInt(String columnName, int x) throws SQLException { |
| 2885 | crsInternal.updateInt(columnName, x); |
| 2886 | } |
| 2887 | |
| 2888 | /** |
| 2889 | * Sets the designated column in either the current row or the insert |
| 2890 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2891 | * <code>long</code> value. |
| 2892 | * <P> |
| 2893 | * This method updates a column value in the current row or the insert |
| 2894 | * row of this rowset, but it does not update the database. |
| 2895 | * If the cursor is on a row in the rowset, the |
| 2896 | * method {@link #updateRow} must be called to update the database. |
| 2897 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2898 | * must be called, which will insert the new row into both this rowset |
| 2899 | * and the database. Both of these methods must be called before the |
| 2900 | * cursor moves to another row. |
| 2901 | * |
| 2902 | * @param columnName a <code>String</code> object that must match the |
| 2903 | * SQL name of a column in this rowset, ignoring case |
| 2904 | * @param x the new column value |
| 2905 | * @throws SQLException if (1) the given column name does not match the |
| 2906 | * name of a column in this rowset, (2) the cursor is not on |
| 2907 | * one of this rowset's rows or its insert row, or (3) this |
| 2908 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2909 | */ |
| 2910 | public void updateLong(String columnName, long x) throws SQLException { |
| 2911 | crsInternal.updateLong(columnName, x); |
| 2912 | } |
| 2913 | |
| 2914 | /** |
| 2915 | * Sets the designated column in either the current row or the insert |
| 2916 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2917 | * <code>float</code> value. |
| 2918 | * <P> |
| 2919 | * This method updates a column value in the current row or the insert |
| 2920 | * row of this rowset, but it does not update the database. |
| 2921 | * If the cursor is on a row in the rowset, the |
| 2922 | * method {@link #updateRow} must be called to update the database. |
| 2923 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2924 | * must be called, which will insert the new row into both this rowset |
| 2925 | * and the database. Both of these methods must be called before the |
| 2926 | * cursor moves to another row. |
| 2927 | * |
| 2928 | * @param columnName a <code>String</code> object that must match the |
| 2929 | * SQL name of a column in this rowset, ignoring case |
| 2930 | * @param x the new column value |
| 2931 | * @throws SQLException if (1) the given column name does not match the |
| 2932 | * name of a column in this rowset, (2) the cursor is not on |
| 2933 | * one of this rowset's rows or its insert row, or (3) this |
| 2934 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2935 | */ |
| 2936 | public void updateFloat(String columnName, float x) throws SQLException { |
| 2937 | crsInternal.updateFloat(columnName, x); |
| 2938 | } |
| 2939 | |
| 2940 | /** |
| 2941 | * Sets the designated column in either the current row or the insert |
| 2942 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2943 | * <code>double</code> value. |
| 2944 | * |
| 2945 | * This method updates a column value in either the current row or |
| 2946 | * the insert row of this rowset, but it does not update the |
| 2947 | * database. If the cursor is on a row in the rowset, the |
| 2948 | * method {@link #updateRow} must be called to update the database. |
| 2949 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2950 | * must be called, which will insert the new row into both this rowset |
| 2951 | * and the database. Both of these methods must be called before the |
| 2952 | * cursor moves to another row. |
| 2953 | * |
| 2954 | * @param columnName a <code>String</code> object that must match the |
| 2955 | * SQL name of a column in this rowset, ignoring case |
| 2956 | * @param x the new column value |
| 2957 | * @throws SQLException if (1) the given column name does not match the |
| 2958 | * name of a column in this rowset, (2) the cursor is not on |
| 2959 | * one of this rowset's rows or its insert row, or (3) this |
| 2960 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2961 | */ |
| 2962 | public void updateDouble(String columnName, double x) throws SQLException { |
| 2963 | crsInternal.updateDouble(columnName, x); |
| 2964 | } |
| 2965 | |
| 2966 | /** |
| 2967 | * Sets the designated column in either the current row or the insert |
| 2968 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2969 | * <code>java.math.BigDecimal</code> object. |
| 2970 | * <P> |
| 2971 | * This method updates a column value in the current row or the insert |
| 2972 | * row of this rowset, but it does not update the database. |
| 2973 | * If the cursor is on a row in the rowset, the |
| 2974 | * method {@link #updateRow} must be called to update the database. |
| 2975 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 2976 | * must be called, which will insert the new row into both this rowset |
| 2977 | * and the database. Both of these methods must be called before the |
| 2978 | * cursor moves to another row. |
| 2979 | * |
| 2980 | * @param columnName a <code>String</code> object that must match the |
| 2981 | * SQL name of a column in this rowset, ignoring case |
| 2982 | * @param x the new column value |
| 2983 | * @throws SQLException if (1) the given column name does not match the |
| 2984 | * name of a column in this rowset, (2) the cursor is not on |
| 2985 | * one of this rowset's rows or its insert row, or (3) this |
| 2986 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 2987 | */ |
| 2988 | public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { |
| 2989 | crsInternal.updateBigDecimal(columnName, x); |
| 2990 | } |
| 2991 | |
| 2992 | /** |
| 2993 | * Sets the designated column in either the current row or the insert |
| 2994 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 2995 | * <code>String</code> object. |
| 2996 | * |
| 2997 | * This method updates a column value in either the current row or |
| 2998 | * the insert row of this rowset, but it does not update the |
| 2999 | * database. If the cursor is on a row in the rowset, the |
| 3000 | * method {@link #updateRow} must be called to update the database. |
| 3001 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3002 | * must be called, which will insert the new row into both this rowset |
| 3003 | * and the database. Both of these methods must be called before the |
| 3004 | * cursor moves to another row. |
| 3005 | * |
| 3006 | * @param columnName a <code>String</code> object that must match the |
| 3007 | * SQL name of a column in this rowset, ignoring case |
| 3008 | * @param x the new column value |
| 3009 | * @throws SQLException if (1) the given column name does not match the |
| 3010 | * name of a column in this rowset, (2) the cursor is not on |
| 3011 | * one of this rowset's rows or its insert row, or (3) this |
| 3012 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3013 | */ |
| 3014 | public void updateString(String columnName, String x) throws SQLException { |
| 3015 | crsInternal.updateString(columnName, x); |
| 3016 | } |
| 3017 | |
| 3018 | /** |
| 3019 | * Sets the designated column in either the current row or the insert |
| 3020 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3021 | * <code>byte</code> array. |
| 3022 | * |
| 3023 | * This method updates a column value in either the current row or |
| 3024 | * the insert row of this rowset, but it does not update the |
| 3025 | * database. If the cursor is on a row in the rowset, the |
| 3026 | * method {@link #updateRow} must be called to update the database. |
| 3027 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3028 | * must be called, which will insert the new row into both this rowset |
| 3029 | * and the database. Both of these methods must be called before the |
| 3030 | * cursor moves to another row. |
| 3031 | * |
| 3032 | * @param columnName a <code>String</code> object that must match the |
| 3033 | * SQL name of a column in this rowset, ignoring case |
| 3034 | * @param x the new column value |
| 3035 | * @throws SQLException if (1) the given column name does not match the |
| 3036 | * name of a column in this rowset, (2) the cursor is not on |
| 3037 | * one of this rowset's rows or its insert row, or (3) this |
| 3038 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3039 | */ |
| 3040 | public void updateBytes(String columnName, byte x[]) throws SQLException { |
| 3041 | crsInternal.updateBytes(columnName, x); |
| 3042 | } |
| 3043 | |
| 3044 | /** |
| 3045 | * Sets the designated column in either the current row or the insert |
| 3046 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3047 | * <code>Date</code> object. |
| 3048 | * |
| 3049 | * This method updates a column value in either the current row or |
| 3050 | * the insert row of this rowset, but it does not update the |
| 3051 | * database. If the cursor is on a row in the rowset, the |
| 3052 | * method {@link #updateRow} must be called to update the database. |
| 3053 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3054 | * must be called, which will insert the new row into both this rowset |
| 3055 | * and the database. Both of these methods must be called before the |
| 3056 | * cursor moves to another row. |
| 3057 | * |
| 3058 | * @param columnName a <code>String</code> object that must match the |
| 3059 | * SQL name of a column in this rowset, ignoring case |
| 3060 | * @param x the new column value |
| 3061 | * @throws SQLException if (1) the given column name does not match the |
| 3062 | * name of a column in this rowset, (2) the cursor is not on |
| 3063 | * one of this rowset's rows or its insert row, (3) the type |
| 3064 | * of the designated column is not an SQL <code>DATE</code> or |
| 3065 | * <code>TIMESTAMP</code>, or (4) this rowset is |
| 3066 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3067 | */ |
| 3068 | public void updateDate(String columnName, java.sql.Date x) throws SQLException { |
| 3069 | crsInternal.updateDate(columnName, x); |
| 3070 | } |
| 3071 | |
| 3072 | /** |
| 3073 | * Sets the designated column in either the current row or the insert |
| 3074 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3075 | * <code>Time</code> object. |
| 3076 | * |
| 3077 | * This method updates a column value in either the current row or |
| 3078 | * the insert row of this rowset, but it does not update the |
| 3079 | * database. If the cursor is on a row in the rowset, the |
| 3080 | * method {@link #updateRow} must be called to update the database. |
| 3081 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3082 | * must be called, which will insert the new row into both this rowset |
| 3083 | * and the database. Both of these methods must be called before the |
| 3084 | * cursor moves to another row. |
| 3085 | * |
| 3086 | * @param columnName a <code>String</code> object that must match the |
| 3087 | * SQL name of a column in this rowset, ignoring case |
| 3088 | * @param x the new column value |
| 3089 | * @throws SQLException if (1) the given column name does not match the |
| 3090 | * name of a column in this rowset, (2) the cursor is not on |
| 3091 | * one of this rowset's rows or its insert row, (3) the type |
| 3092 | * of the designated column is not an SQL <code>TIME</code> or |
| 3093 | * <code>TIMESTAMP</code>, or (4) this rowset is |
| 3094 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3095 | */ |
| 3096 | public void updateTime(String columnName, java.sql.Time x) throws SQLException { |
| 3097 | crsInternal.updateTime(columnName, x); |
| 3098 | } |
| 3099 | |
| 3100 | /** |
| 3101 | * Sets the designated column in either the current row or the insert |
| 3102 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3103 | * <code>Timestamp</code> object. |
| 3104 | * |
| 3105 | * This method updates a column value in either the current row or |
| 3106 | * the insert row of this rowset, but it does not update the |
| 3107 | * database. If the cursor is on a row in the rowset, the |
| 3108 | * method {@link #updateRow} must be called to update the database. |
| 3109 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3110 | * must be called, which will insert the new row into both this rowset |
| 3111 | * and the database. Both of these methods must be called before the |
| 3112 | * cursor moves to another row. |
| 3113 | * |
| 3114 | * @param columnName a <code>String</code> object that must match the |
| 3115 | * SQL name of a column in this rowset, ignoring case |
| 3116 | * @param x the new column value |
| 3117 | * @throws SQLException if the given column index is out of bounds or |
| 3118 | * the cursor is not on one of this rowset's rows or its |
| 3119 | * insert row |
| 3120 | * @throws SQLException if (1) the given column name does not match the |
| 3121 | * name of a column in this rowset, (2) the cursor is not on |
| 3122 | * one of this rowset's rows or its insert row, (3) the type |
| 3123 | * of the designated column is not an SQL <code>DATE</code>, |
| 3124 | * <code>TIME</code>, or <code>TIMESTAMP</code>, or (4) this |
| 3125 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3126 | */ |
| 3127 | public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException { |
| 3128 | crsInternal.updateTimestamp(columnName, x); |
| 3129 | } |
| 3130 | |
| 3131 | /** |
| 3132 | * Unsupported; throws an <code>UnsupportedOperationException</code> |
| 3133 | * if called. |
| 3134 | * <P> |
| 3135 | * Sets the designated column in either the current row or the insert |
| 3136 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3137 | * ASCII stream value. |
| 3138 | * <P> |
| 3139 | * This method updates a column value in either the current row or |
| 3140 | * the insert row of this rowset, but it does not update the |
| 3141 | * database. If the cursor is on a row in the rowset, the |
| 3142 | * method {@link #updateRow} must be called to update the database. |
| 3143 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3144 | * must be called, which will insert the new row into both this rowset |
| 3145 | * and the database. Both of these methods must be called before the |
| 3146 | * cursor moves to another row. |
| 3147 | * |
| 3148 | * @param columnName a <code>String</code> object that must match the |
| 3149 | * SQL name of a column in this rowset, ignoring case |
| 3150 | * @param x the new column value |
| 3151 | * @param length the number of one-byte ASCII characters in the stream |
| 3152 | * @throws UnsupportedOperationException if this method is invoked |
| 3153 | */ |
| 3154 | public void updateAsciiStream(String columnName, java.io.InputStream x, int length) throws SQLException { |
| 3155 | crsInternal.updateAsciiStream(columnName, x, length); |
| 3156 | } |
| 3157 | |
| 3158 | /** |
| 3159 | * Sets the designated column in either the current row or the insert |
| 3160 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3161 | * <code>java.io.InputStream</code> object. |
| 3162 | * <P> |
| 3163 | * This method updates a column value in either the current row or |
| 3164 | * the insert row of this rowset, but it does not update the |
| 3165 | * database. If the cursor is on a row in the rowset, the |
| 3166 | * method {@link #updateRow} must be called to update the database. |
| 3167 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3168 | * must be called, which will insert the new row into both this rowset |
| 3169 | * and the database. Both of these methods must be called before the |
| 3170 | * cursor moves to another row. |
| 3171 | * |
| 3172 | * @param columnName a <code>String</code> object that must match the |
| 3173 | * SQL name of a column in this rowset, ignoring case |
| 3174 | * @param x the new column value; must be a <code>java.io.InputStream</code> |
| 3175 | * containing <code>BINARY</code>, <code>VARBINARY</code>, or |
| 3176 | * <code>LONGVARBINARY</code> data |
| 3177 | * @param length the length of the stream in bytes |
| 3178 | * @throws SQLException if (1) the given column name does not match the |
| 3179 | * name of a column in this rowset, (2) the cursor is not on |
| 3180 | * one of this rowset's rows or its insert row, (3) the data |
| 3181 | * in the stream is not binary, or (4) this rowset is |
| 3182 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3183 | */ |
| 3184 | public void updateBinaryStream(String columnName, java.io.InputStream x, int length) throws SQLException { |
| 3185 | crsInternal.updateBinaryStream(columnName, x, length); |
| 3186 | } |
| 3187 | |
| 3188 | /** |
| 3189 | * Sets the designated column in either the current row or the insert |
| 3190 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3191 | * <code>java.io.Reader</code> object. |
| 3192 | * <P> |
| 3193 | * This method updates a column value in either the current row or |
| 3194 | * the insert row of this rowset, but it does not update the |
| 3195 | * database. If the cursor is on a row in the rowset, the |
| 3196 | * method {@link #updateRow} must be called to update the database. |
| 3197 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3198 | * must be called, which will insert the new row into both this rowset |
| 3199 | * and the database. Both of these methods must be called before the |
| 3200 | * cursor moves to another row. |
| 3201 | * |
| 3202 | * @param columnName a <code>String</code> object that must match the |
| 3203 | * SQL name of a column in this rowset, ignoring case |
| 3204 | * @param x the new column value; must be a <code>java.io.Reader</code> |
| 3205 | * containing <code>BINARY</code>, <code>VARBINARY</code>, |
| 3206 | * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>, |
| 3207 | * or <code>LONGVARCHAR</code> data |
| 3208 | * @param length the length of the stream in characters |
| 3209 | * @throws SQLException if (1) the given column name does not match the |
| 3210 | * name of a column in this rowset, (2) the cursor is not on |
| 3211 | * one of this rowset's rows or its insert row, (3) the data |
| 3212 | * in the stream is not a binary or character type, or (4) this |
| 3213 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3214 | */ |
| 3215 | public void updateCharacterStream(String columnName, java.io.Reader x, int length) throws SQLException { |
| 3216 | crsInternal.updateCharacterStream(columnName, x, length); |
| 3217 | } |
| 3218 | |
| 3219 | /** |
| 3220 | * Sets the designated column in either the current row or the insert |
| 3221 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3222 | * <code>Object</code> value. The <code>scale</code> parameter |
| 3223 | * indicates the number of digits to the right of the decimal point |
| 3224 | * and is ignored if the new column value is not a type that will be |
| 3225 | * mapped to an SQL <code>DECIMAL</code> or <code>NUMERIC</code> value. |
| 3226 | * <P> |
| 3227 | * This method updates a column value in either the current row or |
| 3228 | * the insert row of this rowset, but it does not update the |
| 3229 | * database. If the cursor is on a row in the rowset, the |
| 3230 | * method {@link #updateRow} must be called to update the database. |
| 3231 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3232 | * must be called, which will insert the new row into both this rowset |
| 3233 | * and the database. Both of these methods must be called before the |
| 3234 | * cursor moves to another row. |
| 3235 | * |
| 3236 | * @param columnName a <code>String</code> object that must match the |
| 3237 | * SQL name of a column in this rowset, ignoring case |
| 3238 | * @param x the new column value |
| 3239 | * @param scale the number of digits to the right of the decimal point (for |
| 3240 | * <code>DECIMAL</code> and <code>NUMERIC</code> types only) |
| 3241 | * @throws SQLException if the given column index is out of bounds or |
| 3242 | * the cursor is not on one of this rowset's rows or its |
| 3243 | * insert row |
| 3244 | * @throws SQLException if (1) the given column name does not match the |
| 3245 | * name of a column in this rowset, (2) the cursor is not on |
| 3246 | * one of this rowset's rows or its insert row, or (3) this |
| 3247 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3248 | */ |
| 3249 | public void updateObject(String columnName, Object x, int scale) throws SQLException { |
| 3250 | crsInternal.updateObject(columnName, x, scale); |
| 3251 | } |
| 3252 | |
| 3253 | /** |
| 3254 | * Sets the designated column in either the current row or the insert |
| 3255 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3256 | * <code>Object</code> value. |
| 3257 | * <P> |
| 3258 | * This method updates a column value in either the current row or |
| 3259 | * the insert row of this rowset, but it does not update the |
| 3260 | * database. If the cursor is on a row in the rowset, the |
| 3261 | * method {@link #updateRow} must be called to update the database. |
| 3262 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3263 | * must be called, which will insert the new row into both this rowset |
| 3264 | * and the database. Both of these methods must be called before the |
| 3265 | * cursor moves to another row. |
| 3266 | * |
| 3267 | * @param columnName a <code>String</code> object that must match the |
| 3268 | * SQL name of a column in this rowset, ignoring case |
| 3269 | * @param x the new column value |
| 3270 | * @throws SQLException if (1) the given column name does not match the |
| 3271 | * name of a column in this rowset, (2) the cursor is not on |
| 3272 | * one of this rowset's rows or its insert row, or (3) this |
| 3273 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3274 | */ |
| 3275 | public void updateObject(String columnName, Object x) throws SQLException { |
| 3276 | crsInternal.updateObject(columnName, x); |
| 3277 | } |
| 3278 | |
| 3279 | /** |
| 3280 | * Inserts the contents of this <code>JoinRowSetImpl</code> object's insert |
| 3281 | * row into this rowset immediately following the current row. |
| 3282 | * If the current row is the |
| 3283 | * position after the last row or before the first row, the new row will |
| 3284 | * be inserted at the end of the rowset. This method also notifies |
| 3285 | * listeners registered with this rowset that the row has changed. |
| 3286 | * <P> |
| 3287 | * The cursor must be on the insert row when this method is called. |
| 3288 | * |
| 3289 | * @throws SQLException if (1) the cursor is not on the insert row, |
| 3290 | * (2) one or more of the non-nullable columns in the insert |
| 3291 | * row has not been given a value, or (3) this rowset is |
| 3292 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3293 | */ |
| 3294 | public void insertRow() throws SQLException { |
| 3295 | crsInternal.insertRow(); |
| 3296 | } |
| 3297 | |
| 3298 | /** |
| 3299 | * Marks the current row of this <code>JoinRowSetImpl</code> object as |
| 3300 | * updated and notifies listeners registered with this rowset that the |
| 3301 | * row has changed. |
| 3302 | * <P> |
| 3303 | * This method cannot be called when the cursor is on the insert row, and |
| 3304 | * it should be called before the cursor moves to another row. If it is |
| 3305 | * called after the cursor moves to another row, this method has no effect, |
| 3306 | * and the updates made before the cursor moved will be lost. |
| 3307 | * |
| 3308 | * @throws SQLException if the cursor is on the insert row or this |
| 3309 | * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3310 | */ |
| 3311 | public void updateRow() throws SQLException { |
| 3312 | crsInternal.updateRow(); |
| 3313 | } |
| 3314 | |
| 3315 | /** |
| 3316 | * Deletes the current row from this <code>JoinRowSetImpl</code> object and |
| 3317 | * notifies listeners registered with this rowset that a row has changed. |
| 3318 | * This method cannot be called when the cursor is on the insert row. |
| 3319 | * <P> |
| 3320 | * This method marks the current row as deleted, but it does not delete |
| 3321 | * the row from the underlying data source. The method |
| 3322 | * <code>acceptChanges</code> must be called to delete the row in |
| 3323 | * the data source. |
| 3324 | * |
| 3325 | * @throws SQLException if (1) this method is called when the cursor |
| 3326 | * is on the insert row, before the first row, or after the |
| 3327 | * last row or (2) this rowset is |
| 3328 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3329 | */ |
| 3330 | public void deleteRow() throws SQLException { |
| 3331 | crsInternal.deleteRow(); |
| 3332 | } |
| 3333 | |
| 3334 | /** |
| 3335 | * Sets the current row with its original value and marks the row as |
| 3336 | * not updated, thus undoing any changes made to the row since the |
| 3337 | * last call to the methods <code>updateRow</code> or <code>deleteRow</code>. |
| 3338 | * This method should be called only when the cursor is on a row in |
| 3339 | * this rowset. |
| 3340 | * |
| 3341 | * @throws SQLException if the cursor is on the insert row, before the |
| 3342 | * first row, or after the last row |
| 3343 | */ |
| 3344 | public void refreshRow() throws SQLException { |
| 3345 | crsInternal.refreshRow(); |
| 3346 | } |
| 3347 | |
| 3348 | /** |
| 3349 | * Rolls back any updates made to the current row of this |
| 3350 | * <code>JoinRowSetImpl</code> object and notifies listeners that |
| 3351 | * a row has changed. To have an effect, this method |
| 3352 | * must be called after an <code>updateXXX</code> method has been |
| 3353 | * called and before the method <code>updateRow</code> has been called. |
| 3354 | * If no updates have been made or the method <code>updateRow</code> |
| 3355 | * has already been called, this method has no effect. |
| 3356 | * <P> |
| 3357 | * After <code>updateRow</code> is called it is the |
| 3358 | * <code>cancelRowUpdates</code> has no affect on the newly |
| 3359 | * inserted values. The method <code>cancelRowInsert</code> can |
| 3360 | * be used to remove any rows inserted into the RowSet. |
| 3361 | * |
| 3362 | * @throws SQLException if the cursor is on the insert row, before the |
| 3363 | * first row, or after the last row |
| 3364 | */ |
| 3365 | public void cancelRowUpdates() throws SQLException { |
| 3366 | crsInternal.cancelRowUpdates(); |
| 3367 | } |
| 3368 | |
| 3369 | /** |
| 3370 | * Moves the cursor for this <code>JoinRowSetImpl</code> object |
| 3371 | * to the insert row. The current row in the rowset is remembered |
| 3372 | * while the cursor is on the insert row. |
| 3373 | * <P> |
| 3374 | * The insert row is a special row associated with an updatable |
| 3375 | * rowset. It is essentially a buffer where a new row may |
| 3376 | * be constructed by calling the appropriate <code>updateXXX</code> |
| 3377 | * methods to assign a value to each column in the row. A complete |
| 3378 | * row must be constructed; that is, every column that is not nullable |
| 3379 | * must be assigned a value. In order for the new row to become part |
| 3380 | * of this rowset, the method <code>insertRow</code> must be called |
| 3381 | * before the cursor is moved back to the rowset. |
| 3382 | * <P> |
| 3383 | * Only certain methods may be invoked while the cursor is on the insert |
| 3384 | * row; many methods throw an exception if they are called while the |
| 3385 | * cursor is there. In addition to the <code>updateXXX</code> |
| 3386 | * and <code>insertRow</code> methods, only the <code>getXXX</code> methods |
| 3387 | * may be called when the cursor is on the insert row. A <code>getXXX</code> |
| 3388 | * method should be called on a column only after an <code>updateXXX</code> |
| 3389 | * method has been called on that column; otherwise, the value returned is |
| 3390 | * undetermined. |
| 3391 | * |
| 3392 | * @throws SQLException if this <code>JoinRowSetImpl</code> object is |
| 3393 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3394 | */ |
| 3395 | public void moveToInsertRow() throws SQLException { |
| 3396 | crsInternal.moveToInsertRow(); |
| 3397 | } |
| 3398 | |
| 3399 | /** |
| 3400 | * Moves the cursor for this <code>JoinRowSetImpl</code> object to |
| 3401 | * the current row. The current row is the row the cursor was on |
| 3402 | * when the method <code>moveToInsertRow</code> was called. |
| 3403 | * <P> |
| 3404 | * Calling this method has no effect unless it is called while the |
| 3405 | * cursor is on the insert row. |
| 3406 | * |
| 3407 | * @throws SQLException if an error occurs |
| 3408 | */ |
| 3409 | public void moveToCurrentRow() throws SQLException { |
| 3410 | crsInternal.moveToCurrentRow(); |
| 3411 | } |
| 3412 | |
| 3413 | /** |
| 3414 | * Returns <code>null</code>. |
| 3415 | * |
| 3416 | * @return <code>null</code> |
| 3417 | * @throws SQLException if an error occurs |
| 3418 | */ |
| 3419 | public Statement getStatement() throws SQLException { |
| 3420 | return crsInternal.getStatement(); |
| 3421 | } |
| 3422 | |
| 3423 | /** |
| 3424 | * Retrieves the value of the designated column in this |
| 3425 | * <code>JoinRowSetImpl</code> object as a <code>Ref</code> object |
| 3426 | * in the Java programming lanugage. |
| 3427 | * |
| 3428 | * @param columnIndex the first column is <code>1</code>, the second |
| 3429 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3430 | * and equal to or less than the number of columns in this rowset |
| 3431 | * @return a <code>Ref</code> object representing an SQL<code> REF</code> value |
| 3432 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3433 | * (2) the cursor is not on one of this rowset's rows or its |
| 3434 | * insert row, or (3) the designated column does not store an |
| 3435 | * SQL <code>REF</code> value |
| 3436 | */ |
| 3437 | public Ref getRef(int columnIndex) throws SQLException { |
| 3438 | return crsInternal.getRef(columnIndex); |
| 3439 | } |
| 3440 | |
| 3441 | /** |
| 3442 | * Retrieves the value of the designated column in this |
| 3443 | * <code>JoinRowSetImpl</code> object as a <code>Blob</code> object |
| 3444 | * in the Java programming lanugage. |
| 3445 | * |
| 3446 | * @param columnIndex the first column is <code>1</code>, the second |
| 3447 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3448 | * and equal to or less than the number of columns in this rowset |
| 3449 | * @return a <code>Blob</code> object representing an SQL <code>BLOB</code> value |
| 3450 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3451 | * (2) the cursor is not on one of this rowset's rows or its |
| 3452 | * insert row, or (3) the designated column does not store an |
| 3453 | * SQL <code>BLOB</code> value |
| 3454 | */ |
| 3455 | public Blob getBlob(int columnIndex) throws SQLException { |
| 3456 | return crsInternal.getBlob(columnIndex); |
| 3457 | } |
| 3458 | |
| 3459 | /** |
| 3460 | * Retrieves the value of the designated column in this |
| 3461 | * <code>JoinRowSetImpl</code> object as a <code>Clob</code> object |
| 3462 | * in the Java programming lanugage. |
| 3463 | * |
| 3464 | * @param columnIndex the first column is <code>1</code>, the second |
| 3465 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3466 | * and equal to or less than the number of columns in this rowset |
| 3467 | * @return a <code>Clob</code> object representing an SQL <code>CLOB</code> value |
| 3468 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3469 | * (2) the cursor is not on one of this rowset's rows or its |
| 3470 | * insert row, or (3) the designated column does not store an |
| 3471 | * SQL <code>CLOB</code> value |
| 3472 | */ |
| 3473 | public Clob getClob(int columnIndex) throws SQLException { |
| 3474 | return crsInternal.getClob(columnIndex); |
| 3475 | } |
| 3476 | |
| 3477 | /** |
| 3478 | * Retrieves the value of the designated column in this |
| 3479 | * <code>JoinRowSetImpl</code> object as an <code>Array</code> object |
| 3480 | * in the Java programming lanugage. |
| 3481 | * |
| 3482 | * @param columnIndex the first column is <code>1</code>, the second |
| 3483 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3484 | * and equal to or less than the number of columns in this rowset |
| 3485 | * @return an <code>Array</code> object representing an SQL |
| 3486 | * <code>ARRAY</code> value |
| 3487 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3488 | * (2) the cursor is not on one of this rowset's rows or its |
| 3489 | * insert row, or (3) the designated column does not store an |
| 3490 | * SQL <code>ARRAY</code> value |
| 3491 | */ |
| 3492 | public Array getArray(int columnIndex) throws SQLException { |
| 3493 | return crsInternal.getArray(columnIndex); |
| 3494 | } |
| 3495 | |
| 3496 | // ColumnName |
| 3497 | |
| 3498 | /** |
| 3499 | * Retrieves the value of the designated column in this |
| 3500 | * <code>JoinRowSetImpl</code> object as a <code>Ref</code> object |
| 3501 | * in the Java programming lanugage. |
| 3502 | * |
| 3503 | * @param columnName a <code>String</code> object that must match the |
| 3504 | * SQL name of a column in this rowset, ignoring case |
| 3505 | * @return a <code>Ref</code> object representing an SQL<code> REF</code> value |
| 3506 | * @throws SQLException if (1) the given column name is not the name |
| 3507 | * of a column in this rowset, (2) the cursor is not on one of |
| 3508 | * this rowset's rows or its insert row, or (3) the column value |
| 3509 | * is not an SQL <code>REF</code> value |
| 3510 | */ |
| 3511 | public Ref getRef(String columnName) throws SQLException { |
| 3512 | return crsInternal.getRef(columnName); |
| 3513 | } |
| 3514 | |
| 3515 | /** |
| 3516 | * Retrieves the value of the designated column in this |
| 3517 | * <code>JoinRowSetImpl</code> object as a <code>Blob</code> object |
| 3518 | * in the Java programming lanugage. |
| 3519 | * |
| 3520 | * @param columnName a <code>String</code> object that must match the |
| 3521 | * SQL name of a column in this rowset, ignoring case |
| 3522 | * @return a <code>Blob</code> object representing an SQL |
| 3523 | * <code>BLOB</code> value |
| 3524 | * @throws SQLException if (1) the given column name is not the name of |
| 3525 | * a column in this rowset, (2) the cursor is not on one of |
| 3526 | * this rowset's rows or its insert row, or (3) the designated |
| 3527 | * column does not store an SQL <code>BLOB</code> value |
| 3528 | */ |
| 3529 | public Blob getBlob(String columnName) throws SQLException { |
| 3530 | return crsInternal.getBlob(columnName); |
| 3531 | } |
| 3532 | |
| 3533 | /** |
| 3534 | * Retrieves the value of the designated column in this |
| 3535 | * <code>JoinRowSetImpl</code> object as a <code>Clob</code> object |
| 3536 | * in the Java programming lanugage. |
| 3537 | * |
| 3538 | * @param columnName a <code>String</code> object that must match the |
| 3539 | * SQL name of a column in this rowset, ignoring case |
| 3540 | * @return a <code>Clob</code> object representing an SQL |
| 3541 | * <code>CLOB</code> value |
| 3542 | * @throws SQLException if (1) the given column name is not the name of |
| 3543 | * a column in this rowset, (2) the cursor is not on one of |
| 3544 | * this rowset's rows or its insert row, or (3) the designated |
| 3545 | * column does not store an SQL <code>CLOB</code> value |
| 3546 | */ |
| 3547 | public Clob getClob(String columnName) throws SQLException { |
| 3548 | return crsInternal.getClob(columnName); |
| 3549 | } |
| 3550 | |
| 3551 | /** |
| 3552 | * Retrieves the value of the designated column in this |
| 3553 | * <code>JoinRowSetImpl</code> object as an <code>Array</code> object |
| 3554 | * in the Java programming lanugage. |
| 3555 | * |
| 3556 | * @param columnName a <code>String</code> object that must match the |
| 3557 | * SQL name of a column in this rowset, ignoring case |
| 3558 | * @return an <code>Array</code> object representing an SQL |
| 3559 | * <code>ARRAY</code> value |
| 3560 | * @throws SQLException if (1) the given column name is not the name of |
| 3561 | * a column in this rowset, (2) the cursor is not on one of |
| 3562 | * this rowset's rows or its insert row, or (3) the designated |
| 3563 | * column does not store an SQL <code>ARRAY</code> value |
| 3564 | */ |
| 3565 | public Array getArray(String columnName) throws SQLException { |
| 3566 | return crsInternal.getArray(columnName); |
| 3567 | } |
| 3568 | |
| 3569 | /** |
| 3570 | * Retrieves the value of the designated column in the current row |
| 3571 | * of this <code>JoinRowSetImpl</code> object as a <code>java.sql.Date</code> |
| 3572 | * object, using the given <code>Calendar</code> object to construct an |
| 3573 | * appropriate millisecond value for the date. |
| 3574 | * |
| 3575 | * @param columnIndex the first column is <code>1</code>, the second |
| 3576 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3577 | * and equal to or less than the number of columns in the rowset |
| 3578 | * @param cal the <code>java.util.Calendar</code> object to use in |
| 3579 | * constructing the date |
| 3580 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 3581 | * the result is <code>null</code> |
| 3582 | * @throws SQLException if (1) the given column name is not the name of |
| 3583 | * a column in this rowset, (2) the cursor is not on one of |
| 3584 | * this rowset's rows or its insert row, or (3) the designated |
| 3585 | * column does not store an SQL <code>DATE</code> or |
| 3586 | * <code>TIMESTAMP</code> value |
| 3587 | */ |
| 3588 | public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException { |
| 3589 | return crsInternal.getDate(columnIndex, cal); |
| 3590 | } |
| 3591 | |
| 3592 | /** |
| 3593 | * Retrieves the value of the designated column in the current row |
| 3594 | * of this <code>JoinRowSetImpl</code> object as a <code>java.sql.Date</code> |
| 3595 | * object, using the given <code>Calendar</code> object to construct an |
| 3596 | * appropriate millisecond value for the date. |
| 3597 | * |
| 3598 | * @param columnName a <code>String</code> object that must match the |
| 3599 | * SQL name of a column in this rowset, ignoring case |
| 3600 | * @param cal the <code>java.util.Calendar</code> object to use in |
| 3601 | * constructing the date |
| 3602 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 3603 | * the result is <code>null</code> |
| 3604 | * @throws SQLException if (1) the given column name is not the name of |
| 3605 | * a column in this rowset, (2) the cursor is not on one of |
| 3606 | * this rowset's rows or its insert row, or (3) the designated |
| 3607 | * column does not store an SQL <code>DATE</code> or |
| 3608 | * <code>TIMESTAMP</code> value |
| 3609 | */ |
| 3610 | public java.sql.Date getDate(String columnName, Calendar cal) throws SQLException { |
| 3611 | return crsInternal.getDate(columnName, cal); |
| 3612 | } |
| 3613 | |
| 3614 | /** |
| 3615 | * Retrieves the value of the designated column in the current row |
| 3616 | * of this <code>JoinRowSetImpl</code> object as a <code>java.sql.Time</code> |
| 3617 | * object, using the given <code>Calendar</code> object to construct an |
| 3618 | * appropriate millisecond value for the date. |
| 3619 | * |
| 3620 | * @param columnIndex the first column is <code>1</code>, the second |
| 3621 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3622 | * and equal to or less than the number of columns in the rowset |
| 3623 | * @param cal the <code>java.util.Calendar</code> object to use in |
| 3624 | * constructing the date |
| 3625 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 3626 | * the result is <code>null</code> |
| 3627 | * @throws SQLException if (1) the given column name is not the name of |
| 3628 | * a column in this rowset, (2) the cursor is not on one of |
| 3629 | * this rowset's rows or its insert row, or (3) the designated |
| 3630 | * column does not store an SQL <code>TIME</code> or |
| 3631 | * <code>TIMESTAMP</code> value |
| 3632 | */ |
| 3633 | public java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException { |
| 3634 | return crsInternal.getTime(columnIndex, cal); |
| 3635 | } |
| 3636 | |
| 3637 | /** |
| 3638 | * Retrieves the value of the designated column in the current row |
| 3639 | * of this <code>JoinRowSetImpl</code> object as a <code>java.sql.Time</code> |
| 3640 | * object, using the given <code>Calendar</code> object to construct an |
| 3641 | * appropriate millisecond value for the date. |
| 3642 | * |
| 3643 | * @param columnName a <code>String</code> object that must match the |
| 3644 | * SQL name of a column in this rowset, ignoring case |
| 3645 | * @param cal the <code>java.util.Calendar</code> object to use in |
| 3646 | * constructing the date |
| 3647 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 3648 | * the result is <code>null</code> |
| 3649 | * @throws SQLException if (1) the given column name is not the name of |
| 3650 | * a column in this rowset, (2) the cursor is not on one of |
| 3651 | * this rowset's rows or its insert row, or (3) the designated |
| 3652 | * column does not store an SQL <code>TIME</code> or |
| 3653 | * <code>TIMESTAMP</code> value |
| 3654 | */ |
| 3655 | public java.sql.Time getTime(String columnName, Calendar cal) throws SQLException { |
| 3656 | return crsInternal.getTime(columnName, cal); |
| 3657 | } |
| 3658 | |
| 3659 | /** |
| 3660 | * Retrieves the value of the designated column in the current row |
| 3661 | * of this <code>JoinRowSetImpl</code> object as a <code>java.sql.Timestamp</code> |
| 3662 | * object, using the given <code>Calendar</code> object to construct an |
| 3663 | * appropriate millisecond value for the date. |
| 3664 | * |
| 3665 | * @param columnIndex the first column is <code>1</code>, the second |
| 3666 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3667 | * and equal to or less than the number of columns in the rowset |
| 3668 | * @param cal the <code>java.util.Calendar</code> object to use in |
| 3669 | * constructing the date |
| 3670 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 3671 | * the result is <code>null</code> |
| 3672 | * @throws SQLException if (1) the given column name is not the name of |
| 3673 | * a column in this rowset, (2) the cursor is not on one of |
| 3674 | * this rowset's rows or its insert row, or (3) the designated |
| 3675 | * column does not store an SQL <code>TIME</code> or |
| 3676 | * <code>TIMESTAMP</code> value |
| 3677 | */ |
| 3678 | public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { |
| 3679 | return crsInternal.getTimestamp(columnIndex, cal); |
| 3680 | } |
| 3681 | |
| 3682 | /** |
| 3683 | * Retrieves the value of the designated column in the current row |
| 3684 | * of this <code>JoinRowSetImpl</code> object as a |
| 3685 | * <code>java.sql.Timestamp</code> object, using the given |
| 3686 | * <code>Calendar</code> object to construct an appropriate |
| 3687 | * millisecond value for the date. |
| 3688 | * |
| 3689 | * @param columnName a <code>String</code> object that must match the |
| 3690 | * SQL name of a column in this rowset, ignoring case |
| 3691 | * @param cal the <code>java.util.Calendar</code> object to use in |
| 3692 | * constructing the date |
| 3693 | * @return the column value; if the value is SQL <code>NULL</code>, |
| 3694 | * the result is <code>null</code> |
| 3695 | * @throws SQLException if (1) the given column name is not the name of |
| 3696 | * a column in this rowset, (2) the cursor is not on one of |
| 3697 | * this rowset's rows or its insert row, or (3) the designated |
| 3698 | * column does not store an SQL <code>DATE</code>, |
| 3699 | * <code>TIME</code>, or <code>TIMESTAMP</code> value |
| 3700 | */ |
| 3701 | public java.sql.Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException { |
| 3702 | return crsInternal.getTimestamp(columnName, cal); |
| 3703 | } |
| 3704 | |
| 3705 | /** |
| 3706 | * Sets the metadata for this <code>JoinRowSetImpl</code> object |
| 3707 | * with the given <code>RowSetMetaData</code> object. |
| 3708 | * |
| 3709 | * @param md a <code>RowSetMetaData</code> object instance containing |
| 3710 | * metadata about the columsn in the rowset |
| 3711 | * @throws SQLException if invalid meta data is supplied to the |
| 3712 | * rowset |
| 3713 | */ |
| 3714 | public void setMetaData(RowSetMetaData md) throws SQLException { |
| 3715 | crsInternal.setMetaData(md); |
| 3716 | } |
| 3717 | |
| 3718 | public ResultSet getOriginal() throws SQLException { |
| 3719 | return crsInternal.getOriginal(); |
| 3720 | } |
| 3721 | |
| 3722 | /** |
| 3723 | * Returns a result set containing the original value of the rowset. |
| 3724 | * The cursor is positioned before the first row in the result set. |
| 3725 | * Only rows contained in the result set returned by getOriginal() |
| 3726 | * are said to have an original value. |
| 3727 | * |
| 3728 | * @return the original result set of the rowset |
| 3729 | * @throws SQLException if an error occurs produce the |
| 3730 | * <code>ResultSet</code> object |
| 3731 | */ |
| 3732 | public ResultSet getOriginalRow() throws SQLException { |
| 3733 | return crsInternal.getOriginalRow(); |
| 3734 | } |
| 3735 | |
| 3736 | /** |
| 3737 | * Returns a result set containing the original value of the current |
| 3738 | * row only. |
| 3739 | * |
| 3740 | * @return the original result set of the row |
| 3741 | * @throws SQLException if there is no current row |
| 3742 | * @see #setOriginalRow |
| 3743 | */ |
| 3744 | public void setOriginalRow() throws SQLException { |
| 3745 | crsInternal.setOriginalRow(); |
| 3746 | } |
| 3747 | |
| 3748 | /** |
| 3749 | * Returns the columns that make a key to uniquely identify a |
| 3750 | * row in this <code>JoinRowSetImpl</code> object. |
| 3751 | * |
| 3752 | * @return an array of column number that constites a primary |
| 3753 | * key for this rowset. This array should be empty |
| 3754 | * if no columns is representitive of a primary key |
| 3755 | * @throws SQLException if the rowset is empty or no columns |
| 3756 | * are designated as primary keys |
| 3757 | * @see #setKeyColumns |
| 3758 | */ |
| 3759 | public int[] getKeyColumns() throws SQLException { |
| 3760 | return crsInternal.getKeyColumns(); |
| 3761 | } |
| 3762 | |
| 3763 | /** |
| 3764 | * Sets this <code>JoinRowSetImpl</code> object's |
| 3765 | * <code>keyCols</code> field with the given array of column |
| 3766 | * numbers, which forms a key for uniquely identifying a row |
| 3767 | * in this rowset. |
| 3768 | * |
| 3769 | * @param cols an array of <code>int</code> indicating the |
| 3770 | * columns that form a primary key for this |
| 3771 | * <code>JoinRowSetImpl</code> object; every |
| 3772 | * element in the array must be greater than |
| 3773 | * <code>0</code> and less than or equal to the number |
| 3774 | * of columns in this rowset |
| 3775 | * @throws SQLException if any of the numbers in the |
| 3776 | * given array is not valid for this rowset |
| 3777 | * @see #getKeyColumns |
| 3778 | */ |
| 3779 | public void setKeyColumns(int[] cols) throws SQLException { |
| 3780 | crsInternal.setKeyColumns(cols); |
| 3781 | } |
| 3782 | |
| 3783 | /** |
| 3784 | * Sets the designated column in either the current row or the insert |
| 3785 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3786 | * <code>Ref</code> value. |
| 3787 | * <P> |
| 3788 | * This method updates a column value in the current row or the insert |
| 3789 | * row of this rowset, but it does not update the database. |
| 3790 | * If the cursor is on a row in the rowset, the |
| 3791 | * method {@link #updateRow} must be called to update the database. |
| 3792 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3793 | * must be called, which will insert the new row into both this rowset |
| 3794 | * and the database. Either of these methods must be called before the |
| 3795 | * cursor moves to another row. |
| 3796 | * |
| 3797 | * @param columnIndex the first column is <code>1</code>, the second |
| 3798 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3799 | * and equal to or less than the number of columns in this rowset |
| 3800 | * @param ref the <code>java.sql.Ref</code> object that will be set as |
| 3801 | * the new column value |
| 3802 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3803 | * (2) the cursor is not on one of this rowset's rows or its |
| 3804 | * insert row, or (3) this rowset is |
| 3805 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3806 | */ |
| 3807 | public void updateRef(int columnIndex, java.sql.Ref ref) throws SQLException { |
| 3808 | crsInternal.updateRef(columnIndex, ref); |
| 3809 | } |
| 3810 | |
| 3811 | /** |
| 3812 | * Sets the designated column in either the current row or the insert |
| 3813 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3814 | * <code>Ref</code> value. |
| 3815 | * <P> |
| 3816 | * This method updates a column value in the current row or the insert |
| 3817 | * row of this rowset, but it does not update the database. |
| 3818 | * If the cursor is on a row in the rowset, the |
| 3819 | * method {@link #updateRow} must be called to update the database. |
| 3820 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3821 | * must be called, which will insert the new row into both this rowset |
| 3822 | * and the database. Either of these methods must be called before the |
| 3823 | * cursor moves to another row. |
| 3824 | * |
| 3825 | * @param columnName a <code>String</code> object giving the name of the column |
| 3826 | * to be updated; must match one of the column names in this |
| 3827 | * <code>JoinRowSetImpl</code> object |
| 3828 | * @param ref the <code>java.sql.Ref</code> object that will be set as |
| 3829 | * the new column value |
| 3830 | * @throws SQLException if (1) the given column name is not valid, |
| 3831 | * (2) the cursor is not on one of this rowset's rows or its |
| 3832 | * insert row, or (3) this rowset is |
| 3833 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3834 | */ |
| 3835 | public void updateRef(String columnName, java.sql.Ref ref) throws SQLException { |
| 3836 | crsInternal.updateRef(columnName, ref); |
| 3837 | } |
| 3838 | |
| 3839 | /** |
| 3840 | * Sets the designated column in either the current row or the insert |
| 3841 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3842 | * <code>Clob</code> object. |
| 3843 | * <P> |
| 3844 | * This method updates a column value in the current row or the insert |
| 3845 | * row of this rowset, but it does not update the database. |
| 3846 | * If the cursor is on a row in the rowset, the |
| 3847 | * method {@link #updateRow} must be called to update the database. |
| 3848 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3849 | * must be called, which will insert the new row into both this rowset |
| 3850 | * and the database. Either of these methods must be called before the |
| 3851 | * cursor moves to another row. |
| 3852 | * |
| 3853 | * @param columnIndex the first column is <code>1</code>, the second |
| 3854 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3855 | * and equal to or less than the number of columns in this rowset |
| 3856 | * @param c the <code>java.sql.Clob</code> object that will be set as |
| 3857 | * the new column value |
| 3858 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3859 | * (2) the cursor is not on one of this rowset's rows or its |
| 3860 | * insert row, or (3) this rowset is |
| 3861 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3862 | */ |
| 3863 | public void updateClob(int columnIndex, Clob c) throws SQLException { |
| 3864 | crsInternal.updateClob(columnIndex, c); |
| 3865 | } |
| 3866 | |
| 3867 | /** |
| 3868 | * Sets the designated column in either the current row or the insert |
| 3869 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3870 | * <code>Clob</code> object. |
| 3871 | * <P> |
| 3872 | * This method updates a column value in the current row or the insert |
| 3873 | * row of this rowset, but it does not update the database. |
| 3874 | * If the cursor is on a row in the rowset, the |
| 3875 | * method {@link #updateRow} must be called to update the database. |
| 3876 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3877 | * must be called, which will insert the new row into both this rowset |
| 3878 | * and the database. Either of these methods must be called before the |
| 3879 | * cursor moves to another row. |
| 3880 | * |
| 3881 | * @param columnName a <code>String</code> object giving the name of the column |
| 3882 | * to be updated; must match one of the column names in this |
| 3883 | * <code>JoinRowSetImpl</code> object |
| 3884 | * @param c the <code>java.sql.Clob</code> object that will be set as |
| 3885 | * the new column value |
| 3886 | * @throws SQLException if (1) the given column name is not valid, |
| 3887 | * (2) the cursor is not on one of this rowset's rows or its |
| 3888 | * insert row, or (3) this rowset is |
| 3889 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3890 | */ |
| 3891 | public void updateClob(String columnName, Clob c) throws SQLException { |
| 3892 | crsInternal.updateClob(columnName, c); |
| 3893 | } |
| 3894 | |
| 3895 | /** |
| 3896 | * Sets the designated column in either the current row or the insert |
| 3897 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3898 | * <code>Blob</code> value. |
| 3899 | * <P> |
| 3900 | * This method updates a column value in the current row or the insert |
| 3901 | * row of this rowset, but it does not update the database. |
| 3902 | * If the cursor is on a row in the rowset, the |
| 3903 | * method {@link #updateRow} must be called to update the database. |
| 3904 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3905 | * must be called, which will insert the new row into both this rowset |
| 3906 | * and the database. Either of these methods must be called before the |
| 3907 | * cursor moves to another row. |
| 3908 | * |
| 3909 | * @param columnIndex the first column is <code>1</code>, the second |
| 3910 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3911 | * and equal to or less than the number of columns in this rowset |
| 3912 | * @param b the <code>java.sql.Blob</code> object that will be set as |
| 3913 | * the new column value |
| 3914 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3915 | * (2) the cursor is not on one of this rowset's rows or its |
| 3916 | * insert row, or (3) this rowset is |
| 3917 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3918 | */ |
| 3919 | public void updateBlob(int columnIndex, Blob b) throws SQLException { |
| 3920 | crsInternal.updateBlob(columnIndex, b); |
| 3921 | } |
| 3922 | |
| 3923 | /** |
| 3924 | * Sets the designated column in either the current row or the insert |
| 3925 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3926 | * <code>Blob</code> object. |
| 3927 | * <P> |
| 3928 | * This method updates a column value in the current row or the insert |
| 3929 | * row of this rowset, but it does not update the database. |
| 3930 | * If the cursor is on a row in the rowset, the |
| 3931 | * method {@link #updateRow} must be called to update the database. |
| 3932 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3933 | * must be called, which will insert the new row into both this rowset |
| 3934 | * and the database. Either of these methods must be called before the |
| 3935 | * cursor moves to another row. |
| 3936 | * |
| 3937 | * @param columnName a <code>String</code> object giving the name of the column |
| 3938 | * to be updated; must match one of the column names in this |
| 3939 | * <code>JoinRowSetImpl</code> object |
| 3940 | * @param b the <code>java.sql.Blob</code> object that will be set as |
| 3941 | * the new column value |
| 3942 | * @throws SQLException if (1) the given column name is not valid, |
| 3943 | * (2) the cursor is not on one of this rowset's rows or its |
| 3944 | * insert row, or (3) this rowset is |
| 3945 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3946 | */ |
| 3947 | public void updateBlob(String columnName, Blob b) throws SQLException { |
| 3948 | crsInternal.updateBlob(columnName, b); |
| 3949 | } |
| 3950 | |
| 3951 | /** |
| 3952 | * Sets the designated column in either the current row or the insert |
| 3953 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3954 | * <code>Array</code> object. |
| 3955 | * <P> |
| 3956 | * This method updates a column value in the current row or the insert |
| 3957 | * row of this rowset, but it does not update the database. |
| 3958 | * If the cursor is on a row in the rowset, the |
| 3959 | * method {@link #updateRow} must be called to update the database. |
| 3960 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3961 | * must be called, which will insert the new row into both this rowset |
| 3962 | * and the database. Either of these methods must be called before the |
| 3963 | * cursor moves to another row. |
| 3964 | * |
| 3965 | * @param columnIndex the first column is <code>1</code>, the second |
| 3966 | * is <code>2</code>, and so on; must be <code>1</code> or larger |
| 3967 | * and equal to or less than the number of columns in this rowset |
| 3968 | * @param a the <code>java.sql.Array</code> object that will be set as |
| 3969 | * the new column value |
| 3970 | * @throws SQLException if (1) the given column index is out of bounds, |
| 3971 | * (2) the cursor is not on one of this rowset's rows or its |
| 3972 | * insert row, or (3) this rowset is |
| 3973 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 3974 | */ |
| 3975 | public void updateArray(int columnIndex, Array a) throws SQLException { |
| 3976 | crsInternal.updateArray(columnIndex, a); |
| 3977 | } |
| 3978 | |
| 3979 | /** |
| 3980 | * Sets the designated column in either the current row or the insert |
| 3981 | * row of this <code>JoinRowSetImpl</code> object with the given |
| 3982 | * <code>Array</code> object. |
| 3983 | * <P> |
| 3984 | * This method updates a column value in the current row or the insert |
| 3985 | * row of this rowset, but it does not update the database. |
| 3986 | * If the cursor is on a row in the rowset, the |
| 3987 | * method {@link #updateRow} must be called to update the database. |
| 3988 | * If the cursor is on the insert row, the method {@link #insertRow} |
| 3989 | * must be called, which will insert the new row into both this rowset |
| 3990 | * and the database. Either of these methods must be called before the |
| 3991 | * cursor moves to another row. |
| 3992 | * |
| 3993 | * @param columnName a <code>String</code> object giving the name of the column |
| 3994 | * to be updated; must match one of the column names in this |
| 3995 | * <code>JoinRowSetImpl</code> object |
| 3996 | * @param a the <code>java.sql.Array</code> object that will be set as |
| 3997 | * the new column value |
| 3998 | * @throws SQLException if (1) the given column name is not valid, |
| 3999 | * (2) the cursor is not on one of this rowset's rows or its |
| 4000 | * insert row, or (3) this rowset is |
| 4001 | * <code>ResultSet.CONCUR_READ_ONLY</code> |
| 4002 | */ |
| 4003 | public void updateArray(String columnName, Array a) throws SQLException { |
| 4004 | crsInternal.updateArray(columnName, a); |
| 4005 | } |
| 4006 | |
| 4007 | /** |
| 4008 | * Populates this <code>JoinRowSetImpl</code> object with data. |
| 4009 | * This form of the method uses the rowset's user, password, and url or |
| 4010 | * data source name properties to create a database |
| 4011 | * connection. If properties that are needed |
| 4012 | * have not been set, this method will throw an exception. |
| 4013 | * <P> |
| 4014 | * Another form of this method uses an existing JDBC <code>Connection</code> |
| 4015 | * object instead of creating a new one; therefore, it ignores the |
| 4016 | * properties used for establishing a new connection. |
| 4017 | * <P> |
| 4018 | * The query specified by the command property is executed to create a |
| 4019 | * <code>ResultSet</code> object from which to retrieve data. |
| 4020 | * The current contents of the rowset are discarded, and the |
| 4021 | * rowset's metadata is also (re)set. If there are outstanding updates, |
| 4022 | * they are also ignored. |
| 4023 | * <P> |
| 4024 | * The method <code>execute</code> closes any database connections that it |
| 4025 | * creates. |
| 4026 | * |
| 4027 | * @throws SQLException if an error occurs or the |
| 4028 | * necessary properties have not been set |
| 4029 | */ |
| 4030 | public void execute() throws SQLException { |
| 4031 | crsInternal.execute(); |
| 4032 | } |
| 4033 | |
| 4034 | /** |
| 4035 | * Populates this <code>JoinRowSetImpl</code> object with data, |
| 4036 | * using the given connection to produce the result set from |
| 4037 | * which data will be read. A second form of this method, |
| 4038 | * which takes no arguments, uses the values from this rowset's |
| 4039 | * user, password, and either url or data source properties to |
| 4040 | * create a new database connection. The form of <code>execute</code> |
| 4041 | * that is given a connection ignores these properties. |
| 4042 | * |
| 4043 | * @param conn A standard JDBC <code>Connection</code> object with valid |
| 4044 | * properties that the <code>JoinRowSet</code> implementation |
| 4045 | * can pass to a synchronization provider to establish a |
| 4046 | * connection to the datasource |
| 4047 | * @throws SQLException if an invalid <code>Connection</code> is supplied |
| 4048 | * or an error occurs in establishing the connection to the |
| 4049 | * data soure |
| 4050 | * @see java.sql.Connection |
| 4051 | */ |
| 4052 | public void execute(Connection conn) throws SQLException { |
| 4053 | crsInternal.execute(conn); |
| 4054 | } |
| 4055 | |
| 4056 | /** |
| 4057 | * Provide interface coverage for getURL(int) in ResultSet->RowSet |
| 4058 | */ |
| 4059 | public java.net.URL getURL(int columnIndex) throws SQLException { |
| 4060 | return crsInternal.getURL(columnIndex); |
| 4061 | } |
| 4062 | |
| 4063 | /** |
| 4064 | * Provide interface coverage for getURL(String) in ResultSet->RowSet |
| 4065 | */ |
| 4066 | public java.net.URL getURL(String columnName) throws SQLException { |
| 4067 | return crsInternal.getURL(columnName); |
| 4068 | } |
| 4069 | |
| 4070 | /** |
| 4071 | * Creates a new <code>WebRowSet</code> object, populates it with the |
| 4072 | * data in the given <code>ResultSet</code> object, and writes it |
| 4073 | * to the given <code>java.io.Writer</code> object in XML format. |
| 4074 | * |
| 4075 | * @throws SQLException if an error occurs writing out the rowset |
| 4076 | * contents to XML |
| 4077 | */ |
| 4078 | public void writeXml(ResultSet rs, java.io.Writer writer) |
| 4079 | throws SQLException { |
| 4080 | wrs = new WebRowSetImpl(); |
| 4081 | wrs.populate(rs); |
| 4082 | wrs.writeXml(writer); |
| 4083 | } |
| 4084 | |
| 4085 | /** |
| 4086 | * Writes this <code>JoinRowSet</code> object to the given |
| 4087 | * <code>java.io.Writer</code> object in XML format. In |
| 4088 | * addition to the rowset's data, its properties and metadata |
| 4089 | * are also included. |
| 4090 | * |
| 4091 | * @throws SQLException if an error occurs writing out the rowset |
| 4092 | * contents to XML |
| 4093 | */ |
| 4094 | public void writeXml(java.io.Writer writer) throws SQLException { |
| 4095 | createWebRowSet().writeXml(writer); |
| 4096 | } |
| 4097 | |
| 4098 | /** |
| 4099 | * Reads this <code>JoinRowSet</code> object in its XML format. |
| 4100 | * |
| 4101 | * @throws SQLException if a database access error occurs |
| 4102 | */ |
| 4103 | public void readXml(java.io.Reader reader) throws SQLException { |
| 4104 | wrs = new WebRowSetImpl(); |
| 4105 | wrs.readXml(reader); |
| 4106 | crsInternal = (CachedRowSetImpl)wrs; |
| 4107 | } |
| 4108 | |
| 4109 | // Stream based methods |
| 4110 | /** |
| 4111 | * Reads a stream based XML input to populate an <code>WebRowSet</code> |
| 4112 | * |
| 4113 | * @throws SQLException if a data source access occurs |
| 4114 | * @throws IOException if a IO exception occurs |
| 4115 | */ |
| 4116 | public void readXml(java.io.InputStream iStream) throws SQLException, IOException { |
| 4117 | wrs = new WebRowSetImpl(); |
| 4118 | wrs.readXml(iStream); |
| 4119 | crsInternal = (CachedRowSetImpl)wrs; |
| 4120 | } |
| 4121 | |
| 4122 | /** |
| 4123 | * Creates an an output stream of the internal state and contents of a |
| 4124 | * <code>WebRowSet</code> for XML proceessing |
| 4125 | * |
| 4126 | * @throws SQLException if a datasource access occurs |
| 4127 | * @throws IOException if an IO exception occurs |
| 4128 | */ |
| 4129 | public void writeXml(java.io.OutputStream oStream) throws SQLException, IOException { |
| 4130 | createWebRowSet().writeXml(oStream); |
| 4131 | } |
| 4132 | |
| 4133 | /** |
| 4134 | * Creates a new <code>WebRowSet</code> object, populates it with |
| 4135 | * the contents of the <code>ResultSet</code> and creates an output |
| 4136 | * streams the internal state and contents of the rowset for XML processing. |
| 4137 | * |
| 4138 | * @throws SQLException if a datasource access occurs |
| 4139 | * @throws IOException if an IO exception occurs |
| 4140 | */ |
| 4141 | public void writeXml(ResultSet rs, java.io.OutputStream oStream) throws SQLException, IOException { |
| 4142 | wrs = new WebRowSetImpl(); |
| 4143 | wrs.populate(rs); |
| 4144 | wrs.writeXml(oStream); |
| 4145 | } |
| 4146 | |
| 4147 | /** |
| 4148 | * %%% Javadoc comments to be added here |
| 4149 | */ |
| 4150 | private WebRowSet createWebRowSet() throws SQLException { |
| 4151 | if(wrs != null) { |
| 4152 | // check if it has already been initialized. |
| 4153 | return wrs; |
| 4154 | } else { |
| 4155 | wrs = new WebRowSetImpl(); |
| 4156 | crsInternal.beforeFirst(); |
| 4157 | wrs.populate(crsInternal); |
| 4158 | return wrs; |
| 4159 | } |
| 4160 | } |
| 4161 | |
| 4162 | /** |
| 4163 | * Returns the last set SQL <code>JOIN</code> type in this JoinRowSetImpl |
| 4164 | * object |
| 4165 | * |
| 4166 | * @return joinType One of the standard JoinRowSet static field JOIN types |
| 4167 | * @throws SQLException if an error occurs determining the current join type |
| 4168 | */ |
| 4169 | public int getJoinType() throws SQLException { |
| 4170 | if (vecJoinType == null) { |
| 4171 | // Default JoinRowSet type |
| 4172 | this.setJoinType(JoinRowSet.INNER_JOIN); |
| 4173 | } |
| 4174 | Integer i = (Integer)(vecJoinType.get(vecJoinType.size()-1)); |
| 4175 | return i.intValue(); |
| 4176 | } |
| 4177 | |
| 4178 | /** |
| 4179 | * The listener will be notified whenever an event occurs on this <code>JoinRowSet</code> |
| 4180 | * object. |
| 4181 | * <P> |
| 4182 | * A listener might, for example, be a table or graph that needs to |
| 4183 | * be updated in order to accurately reflect the current state of |
| 4184 | * the <code>RowSet</code> object. |
| 4185 | * <p> |
| 4186 | * <b>Note</b>: if the <code>RowSetListener</code> object is |
| 4187 | * <code>null</code>, this method silently discards the <code>null</code> |
| 4188 | * value and does not add a null reference to the set of listeners. |
| 4189 | * <p> |
| 4190 | * <b>Note</b>: if the listener is already set, and the new <code>RowSetListerner</code> |
| 4191 | * instance is added to the set of listeners already registered to receive |
| 4192 | * event notifications from this <code>RowSet</code>. |
| 4193 | * |
| 4194 | * @param listener an object that has implemented the |
| 4195 | * <code>javax.sql.RowSetListener</code> interface and wants to be notified |
| 4196 | * of any events that occur on this <code>JoinRowSet</code> object; May be |
| 4197 | * null. |
| 4198 | * @see #removeRowSetListener |
| 4199 | */ |
| 4200 | public void addRowSetListener(RowSetListener listener) { |
| 4201 | crsInternal.addRowSetListener(listener); |
| 4202 | } |
| 4203 | |
| 4204 | /** |
| 4205 | * Removes the designated object from this <code>JoinRowSet</code> object's list of listeners. |
| 4206 | * If the given argument is not a registered listener, this method |
| 4207 | * does nothing. |
| 4208 | * |
| 4209 | * <b>Note</b>: if the <code>RowSetListener</code> object is |
| 4210 | * <code>null</code>, this method silently discards the <code>null</code> |
| 4211 | * value. |
| 4212 | * |
| 4213 | * @param listener a <code>RowSetListener</code> object that is on the list |
| 4214 | * of listeners for this <code>JoinRowSet</code> object |
| 4215 | * @see #addRowSetListener |
| 4216 | */ |
| 4217 | public void removeRowSetListener(RowSetListener listener) { |
| 4218 | crsInternal.removeRowSetListener(listener); |
| 4219 | } |
| 4220 | |
| 4221 | /** |
| 4222 | * Converts this <code>JoinRowSetImpl</code> object to a collection |
| 4223 | * of tables. The sample implementation utilitizes the <code>TreeMap</code> |
| 4224 | * collection type. |
| 4225 | * This class guarantees that the map will be in ascending key order, |
| 4226 | * sorted according to the natural order for the key's class. |
| 4227 | * |
| 4228 | * @return a <code>Collection</code> object consisting of tables, |
| 4229 | * each of which is a copy of a row in this |
| 4230 | * <code>JoinRowSetImpl</code> object |
| 4231 | * @throws SQLException if an error occurs in generating the collection |
| 4232 | * @see #toCollection(int) |
| 4233 | * @see #toCollection(String) |
| 4234 | * @see java.util.TreeMap |
| 4235 | */ |
| 4236 | public Collection<?> toCollection() throws SQLException { |
| 4237 | return crsInternal.toCollection(); |
| 4238 | } |
| 4239 | |
| 4240 | /** |
| 4241 | * Returns the specified column of this <code>JoinRowSetImpl</code> object |
| 4242 | * as a <code>Collection</code> object. This method makes a copy of the |
| 4243 | * column's data and utilitizes the <code>Vector</code> to establish the |
| 4244 | * collection. The <code>Vector</code> class implements a growable array |
| 4245 | * objects allowing the individual components to be accessed using an |
| 4246 | * an integer index similar to that of an array. |
| 4247 | * |
| 4248 | * @return a <code>Collection</code> object that contains the value(s) |
| 4249 | * stored in the specified column of this |
| 4250 | * <code>JoinRowSetImpl</code> |
| 4251 | * object |
| 4252 | * @throws SQLException if an error occurs generated the collection; or |
| 4253 | * an invalid column is provided. |
| 4254 | * @see #toCollection() |
| 4255 | * @see #toCollection(String) |
| 4256 | * @see java.util.Vector |
| 4257 | */ |
| 4258 | public Collection<?> toCollection(int column) throws SQLException { |
| 4259 | return crsInternal.toCollection(column); |
| 4260 | } |
| 4261 | |
| 4262 | /** |
| 4263 | * Returns the specified column of this <code>JoinRowSetImpl</code> object |
| 4264 | * as a <code>Collection</code> object. This method makes a copy of the |
| 4265 | * column's data and utilitizes the <code>Vector</code> to establish the |
| 4266 | * collection. The <code>Vector</code> class implements a growable array |
| 4267 | * objects allowing the individual components to be accessed using an |
| 4268 | * an integer index similar to that of an array. |
| 4269 | * |
| 4270 | * @return a <code>Collection</code> object that contains the value(s) |
| 4271 | * stored in the specified column of this |
| 4272 | * <code>JoinRowSetImpl</code> |
| 4273 | * object |
| 4274 | * @throws SQLException if an error occurs generated the collection; or |
| 4275 | * an invalid column is provided. |
| 4276 | * @see #toCollection() |
| 4277 | * @see #toCollection(int) |
| 4278 | * @see java.util.Vector |
| 4279 | */ |
| 4280 | public Collection<?> toCollection(String column) throws SQLException { |
| 4281 | return crsInternal.toCollection(column); |
| 4282 | } |
| 4283 | |
| 4284 | /** |
| 4285 | * Creates a <code>RowSet</code> object that is a copy of |
| 4286 | * this <code>JoinRowSetImpl</code> object's table structure |
| 4287 | * and the constraints only. |
| 4288 | * There will be no data in the object being returned. |
| 4289 | * Updates made on a copy are not visible to the original rowset. |
| 4290 | * <P> |
| 4291 | * This helps in getting the underlying XML schema which can |
| 4292 | * be used as the basis for populating a <code>WebRowSet</code>. |
| 4293 | * |
| 4294 | * @return a new <code>CachedRowSet</code> object that is a copy |
| 4295 | * of this <code>JoinRowSetImpl</code> object's schema and |
| 4296 | * retains all the constraints on the original rowset but contains |
| 4297 | * no data |
| 4298 | * @throws SQLException if an error occurs in generating the copy |
| 4299 | * of the <code>CachedRowSet</code> object |
| 4300 | * @see #createShared |
| 4301 | * @see #createCopy |
| 4302 | * @see #createCopyNoConstraints |
| 4303 | * @see javax.sql.RowSetEvent |
| 4304 | * @see javax.sql.RowSetListener |
| 4305 | */ |
| 4306 | public CachedRowSet createCopySchema() throws SQLException { |
| 4307 | return crsInternal.createCopySchema(); |
| 4308 | } |
| 4309 | |
| 4310 | static final long serialVersionUID = -5590501621560008453L; |
| 4311 | } |