1 /* 2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. 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. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * 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 import java.beans.*; 35 36 import javax.sql.rowset.*; 37 38 /** 39 * The standard implementation of the <code>JdbcRowSet</code> interface. See the interface 40 * defintion for full behavior and implementation requirements. 41 * 42 * @author Jonathan Bruce, Amit Handa 43 */ 44 45 public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { 46 47 /** 48 * The <code>Connection</code> object that is this rowset's 49 * current connection to the database. This field is set 50 * internally when the connection is established. 51 */ 52 private Connection conn; 53 54 /** 55 * The <code>PreparedStatement</code> object that is this rowset's 56 * current command. This field is set internally when the method 57 * <code>execute</code> creates the <code>PreparedStatement</code> 58 * object. 59 */ 60 private PreparedStatement ps; 61 62 /** 63 * The <code>ResultSet</code> object that is this rowset's 64 * current result set. This field is set internally when the method 65 * <code>execute</code> executes the rowset's command and thereby 66 * creates the rowset's <code>ResultSet</code> object. 67 */ 68 private ResultSet rs; 69 70 /** 71 * The <code>RowSetMetaDataImpl</code> object that is contructed when 72 * a <code>ResultSet</code> object is passed to the <code>JdbcRowSet</code> 73 * constructor. This helps in constructing all metadata associated 74 * with the <code>ResultSet</code> object using the setter methods of 75 * <code>RowSetMetaDataImpl</code>. 76 */ 77 private RowSetMetaDataImpl rowsMD; 78 79 /** 80 * The <code>ResultSetMetaData</code> object from which this 81 * <code>RowSetMetaDataImpl</code> is formed and which helps in getting 82 * the metadata information. 83 */ 84 private ResultSetMetaData resMD; 85 86 /** 87 * The property that helps to fire the property changed event when certain 88 * properties are changed in the <code>JdbcRowSet</code> object. This property 89 * is being added to satisfy Rave requirements. 90 */ 91 private PropertyChangeSupport propertyChangeSupport; 92 93 /** 94 * The Vector holding the Match Columns 95 */ 96 private Vector<Integer> iMatchColumns; 97 98 /** 99 * The Vector that will hold the Match Column names. 100 */ 101 private Vector<String> strMatchColumns; 102 103 104 protected transient JdbcRowSetResourceBundle resBundle; 105 106 /** 107 * Constructs a default <code>JdbcRowSet</code> object. 108 * The new instance of <code>JdbcRowSet</code> will serve as a proxy 109 * for the <code>ResultSet</code> object it creates, and by so doing, 110 * it will make it possible to use the result set as a JavaBeans 111 * component. 112 * <P> 113 * The following is true of a default <code>JdbcRowSet</code> instance: 114 * <UL> 115 * <LI>Does not show deleted rows 116 * <LI>Has no time limit for how long a driver may take to 117 * execute the rowset's command 118 * <LI>Has no limit for the number of rows it may contain 119 * <LI>Has no limit for the number of bytes a column may contain 120 * <LI>Has a scrollable cursor and does not show changes 121 * made by others 122 * <LI>Will not see uncommitted data (make "dirty" reads) 123 * <LI>Has escape processing turned on 124 * <LI>Has its connection's type map set to <code>null</code> 125 * <LI>Has an empty <code>Hashtable</code> object for storing any 126 * parameters that are set 127 * </UL> 128 * A newly created <code>JdbcRowSet</code> object must have its 129 * <code>execute</code> method invoked before other public methods 130 * are called on it; otherwise, such method calls will cause an 131 * exception to be thrown. 132 * 133 * @throws SQLException [1] if any of its public methods are called prior 134 * to calling the <code>execute</code> method; [2] if invalid JDBC driver 135 * properties are set or [3] if no connection to a data source exists. 136 */ 137 public JdbcRowSetImpl() { 138 conn = null; 139 ps = null; 140 rs = null; 141 142 try { 143 resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle(); 144 } catch(IOException ioe) { 145 throw new RuntimeException(ioe); 146 } 147 148 propertyChangeSupport = new PropertyChangeSupport(this); 149 150 initParams(); 151 152 // set the defaults 153 154 try { 155 setShowDeleted(false); 156 } catch(SQLException sqle) { 157 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setshowdeleted").toString() + 158 sqle.getLocalizedMessage()); 159 } 160 161 try { 162 setQueryTimeout(0); 163 } catch(SQLException sqle) { 164 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setquerytimeout").toString() + 165 sqle.getLocalizedMessage()); 166 } 167 168 try { 169 setMaxRows(0); 170 } catch(SQLException sqle) { 171 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setmaxrows").toString() + 172 sqle.getLocalizedMessage()); 173 } 174 175 try { 176 setMaxFieldSize(0); 177 } catch(SQLException sqle) { 178 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setmaxfieldsize").toString() + 179 sqle.getLocalizedMessage()); 180 } 181 182 try { 183 setEscapeProcessing(true); 184 } catch(SQLException sqle) { 185 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setescapeprocessing").toString() + 186 sqle.getLocalizedMessage()); 187 } 188 189 try { 190 setConcurrency(ResultSet.CONCUR_UPDATABLE); 191 } catch (SQLException sqle) { 192 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setconcurrency").toString() + 193 sqle.getLocalizedMessage()); 194 } 195 196 setTypeMap(null); 197 198 try { 199 setType(ResultSet.TYPE_SCROLL_INSENSITIVE); 200 } catch(SQLException sqle){ 201 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.settype").toString() + 202 sqle.getLocalizedMessage()); 203 } 204 205 setReadOnly(true); 206 207 try { 208 setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); 209 } catch(SQLException sqle){ 210 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.settransactionisolation").toString() + 211 sqle.getLocalizedMessage()); 212 } 213 214 //Instantiating the vector for MatchColumns 215 216 iMatchColumns = new Vector<Integer>(10); 217 for(int i = 0; i < 10 ; i++) { 218 iMatchColumns.add(i,Integer.valueOf(-1)); 219 } 220 221 strMatchColumns = new Vector<String>(10); 222 for(int j = 0; j < 10; j++) { 223 strMatchColumns.add(j,null); 224 } 225 } 226 227 /** 228 * Constructs a default <code>JdbcRowSet</code> object given a 229 * valid <code>Connection</code> object. The new 230 * instance of <code>JdbcRowSet</code> will serve as a proxy for 231 * the <code>ResultSet</code> object it creates, and by so doing, 232 * it will make it possible to use the result set as a JavaBeans 233 * component. 234 * <P> 235 * The following is true of a default <code>JdbcRowSet</code> instance: 236 * <UL> 237 * <LI>Does not show deleted rows 238 * <LI>Has no time limit for how long a driver may take to 239 * execute the rowset's command 240 * <LI>Has no limit for the number of rows it may contain 241 * <LI>Has no limit for the number of bytes a column may contain 242 * <LI>Has a scrollable cursor and does not show changes 243 * made by others 244 * <LI>Will not see uncommitted data (make "dirty" reads) 245 * <LI>Has escape processing turned on 246 * <LI>Has its connection's type map set to <code>null</code> 247 * <LI>Has an empty <code>Hashtable</code> object for storing any 248 * parameters that are set 249 * </UL> 250 * A newly created <code>JdbcRowSet</code> object must have its 251 * <code>execute</code> method invoked before other public methods 252 * are called on it; otherwise, such method calls will cause an 253 * exception to be thrown. 254 * 255 * @throws SQLException [1] if any of its public methods are called prior 256 * to calling the <code>execute</code> method, [2] if invalid JDBC driver 257 * properties are set, or [3] if no connection to a data source exists. 258 */ 259 public JdbcRowSetImpl(Connection con) throws SQLException { 260 261 conn = con; 262 ps = null; 263 rs = null; 264 265 try { 266 resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle(); 267 } catch(IOException ioe) { 268 throw new RuntimeException(ioe); 269 } 270 271 propertyChangeSupport = new PropertyChangeSupport(this); 272 273 initParams(); 274 // set the defaults 275 setShowDeleted(false); 276 setQueryTimeout(0); 277 setMaxRows(0); 278 setMaxFieldSize(0); 279 280 setParams(); 281 282 setReadOnly(true); 283 setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); 284 setEscapeProcessing(true); 285 setTypeMap(null); 286 287 //Instantiating the vector for MatchColumns 288 289 iMatchColumns = new Vector<Integer>(10); 290 for(int i = 0; i < 10 ; i++) { 291 iMatchColumns.add(i,Integer.valueOf(-1)); 292 } 293 294 strMatchColumns = new Vector<String>(10); 295 for(int j = 0; j < 10; j++) { 296 strMatchColumns.add(j,null); 297 } 298 } 299 300 /** 301 * Constructs a default <code>JdbcRowSet</code> object using the 302 * URL, username, and password arguments supplied. The new 303 * instance of <code>JdbcRowSet</code> will serve as a proxy for 304 * the <code>ResultSet</code> object it creates, and by so doing, 305 * it will make it possible to use the result set as a JavaBeans 306 * component. 307 * 308 * <P> 309 * The following is true of a default <code>JdbcRowSet</code> instance: 310 * <UL> 311 * <LI>Does not show deleted rows 312 * <LI>Has no time limit for how long a driver may take to 313 * execute the rowset's command 314 * <LI>Has no limit for the number of rows it may contain 315 * <LI>Has no limit for the number of bytes a column may contain 316 * <LI>Has a scrollable cursor and does not show changes 317 * made by others 318 * <LI>Will not see uncommitted data (make "dirty" reads) 319 * <LI>Has escape processing turned on 320 * <LI>Has its connection's type map set to <code>null</code> 321 * <LI>Has an empty <code>Hashtable</code> object for storing any 322 * parameters that are set 323 * </UL> 324 * 325 * @param url - a JDBC URL for the database to which this <code>JdbcRowSet</code> 326 * object will be connected. The form for a JDBC URL is 327 * <code>jdbc:subprotocol:subname</code>. 328 * @param user - the database user on whose behalf the connection 329 * is being made 330 * @param password - the user's password 331 * 332 * @throws SQLException if a database access error occurs 333 * 334 */ 335 public JdbcRowSetImpl(String url, String user, String password) throws SQLException { 336 conn = null; 337 ps = null; 338 rs = null; 339 340 try { 341 resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle(); 342 } catch(IOException ioe) { 343 throw new RuntimeException(ioe); 344 } 345 346 propertyChangeSupport = new PropertyChangeSupport(this); 347 348 initParams(); 349 350 // Pass the arguments to BaseRowSet 351 // setter methods now. 352 353 setUsername(user); 354 setPassword(password); 355 setUrl(url); 356 357 // set the defaults 358 setShowDeleted(false); 359 setQueryTimeout(0); 360 setMaxRows(0); 361 setMaxFieldSize(0); 362 363 // to ensure connection to a db call connect now 364 // and associate a conn with "this" object 365 // in this case. 366 conn = connect(); 367 setParams(); 368 369 setReadOnly(true); 370 setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); 371 setEscapeProcessing(true); 372 setTypeMap(null); 373 374 //Instantiating the vector for MatchColumns 375 376 iMatchColumns = new Vector<Integer>(10); 377 for(int i = 0; i < 10 ; i++) { 378 iMatchColumns.add(i,Integer.valueOf(-1)); 379 } 380 381 strMatchColumns = new Vector<String>(10); 382 for(int j = 0; j < 10; j++) { 383 strMatchColumns.add(j,null); 384 } 385 } 386 387 388 /** 389 * Constructs a <code>JdbcRowSet</code> object using the given valid 390 * <code>ResultSet</code> object. The new 391 * instance of <code>JdbcRowSet</code> will serve as a proxy for 392 * the <code>ResultSet</code> object, and by so doing, 393 * it will make it possible to use the result set as a JavaBeans 394 * component. 395 * 396 * <P> 397 * The following is true of a default <code>JdbcRowSet</code> instance: 398 * <UL> 399 * <LI>Does not show deleted rows 400 * <LI>Has no time limit for how long a driver may take to 401 * execute the rowset's command 402 * <LI>Has no limit for the number of rows it may contain 403 * <LI>Has no limit for the number of bytes a column may contain 404 * <LI>Has a scrollable cursor and does not show changes 405 * made by others 406 * <LI>Will not see uncommitted data (make "dirty" reads) 407 * <LI>Has escape processing turned on 408 * <LI>Has its connection's type map set to <code>null</code> 409 * <LI>Has an empty <code>Hashtable</code> object for storing any 410 * parameters that are set 411 * </UL> 412 * 413 * @param res a valid <code>ResultSet</code> object 414 * 415 * @throws SQLException if a database access occurs due to a non 416 * valid ResultSet handle. 417 */ 418 public JdbcRowSetImpl(ResultSet res) throws SQLException { 419 420 // A ResultSet handle encapsulates a connection handle. 421 // But there is no way we can retrieve a Connection handle 422 // from a ResultSet object. 423 // So to avoid any anomalies we keep the conn = null 424 // The passed rs handle will be a wrapper around for 425 // "this" object's all operations. 426 conn = null; 427 428 ps = null; 429 430 rs = res; 431 432 try { 433 resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle(); 434 } catch(IOException ioe) { 435 throw new RuntimeException(ioe); 436 } 437 438 propertyChangeSupport = new PropertyChangeSupport(this); 439 440 initParams(); 441 442 // get the values from the resultset handle. 443 setShowDeleted(false); 444 setQueryTimeout(0); 445 setMaxRows(0); 446 setMaxFieldSize(0); 447 448 setParams(); 449 450 setReadOnly(true); 451 setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); 452 setEscapeProcessing(true); 453 setTypeMap(null); 454 455 // Get a handle to ResultSetMetaData 456 // Construct RowSetMetaData out of it. 457 458 resMD = rs.getMetaData(); 459 460 rowsMD = new RowSetMetaDataImpl(); 461 462 initMetaData(rowsMD, resMD); 463 464 //Instantiating the vector for MatchColumns 465 466 iMatchColumns = new Vector<Integer>(10); 467 for(int i = 0; i < 10 ; i++) { 468 iMatchColumns.add(i,Integer.valueOf(-1)); 469 } 470 471 strMatchColumns = new Vector<String>(10); 472 for(int j = 0; j < 10; j++) { 473 strMatchColumns.add(j,null); 474 } 475 } 476 477 /** 478 * Initializes the given <code>RowSetMetaData</code> object with the values 479 * in the given <code>ResultSetMetaData</code> object. 480 * 481 * @param md the <code>RowSetMetaData</code> object for this 482 * <code>JdbcRowSetImpl</code> object, which will be set with 483 * values from rsmd 484 * @param rsmd the <code>ResultSetMetaData</code> object from which new 485 * values for md will be read 486 * @throws SQLException if an error occurs 487 */ 488 protected void initMetaData(RowSetMetaData md, ResultSetMetaData rsmd) throws SQLException { 489 int numCols = rsmd.getColumnCount(); 490 491 md.setColumnCount(numCols); 492 for (int col=1; col <= numCols; col++) { 493 md.setAutoIncrement(col, rsmd.isAutoIncrement(col)); 494 md.setCaseSensitive(col, rsmd.isCaseSensitive(col)); 495 md.setCurrency(col, rsmd.isCurrency(col)); 496 md.setNullable(col, rsmd.isNullable(col)); 497 md.setSigned(col, rsmd.isSigned(col)); 498 md.setSearchable(col, rsmd.isSearchable(col)); 499 md.setColumnDisplaySize(col, rsmd.getColumnDisplaySize(col)); 500 md.setColumnLabel(col, rsmd.getColumnLabel(col)); 501 md.setColumnName(col, rsmd.getColumnName(col)); 502 md.setSchemaName(col, rsmd.getSchemaName(col)); 503 md.setPrecision(col, rsmd.getPrecision(col)); 504 md.setScale(col, rsmd.getScale(col)); 505 md.setTableName(col, rsmd.getTableName(col)); 506 md.setCatalogName(col, rsmd.getCatalogName(col)); 507 md.setColumnType(col, rsmd.getColumnType(col)); 508 md.setColumnTypeName(col, rsmd.getColumnTypeName(col)); 509 } 510 } 511 512 513 protected void checkState() throws SQLException { 514 515 // If all the three i.e. conn, ps & rs are 516 // simultaneously null implies we are not connected 517 // to the db, implies undesirable state so throw exception 518 519 if (conn == null && ps == null && rs == null ) { 520 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.invalstate").toString()); 521 } 522 } 523 524 //--------------------------------------------------------------------- 525 // Reading and writing data 526 //--------------------------------------------------------------------- 527 528 /** 529 * Creates the internal <code>ResultSet</code> object for which this 530 * <code>JdbcRowSet</code> object is a wrapper, effectively 531 * making the result set a JavaBeans component. 532 * <P> 533 * Certain properties must have been set before this method is called 534 * so that it can establish a connection to a database and execute the 535 * query that will create the result set. If a <code>DataSource</code> 536 * object will be used to create the connection, properties for the 537 * data source name, user name, and password must be set. If the 538 * <code>DriverManager</code> will be used, the properties for the 539 * URL, user name, and password must be set. In either case, the 540 * property for the command must be set. If the command has placeholder 541 * parameters, those must also be set. This method throws 542 * an exception if the required properties are not set. 543 * <P> 544 * Other properties have default values that may optionally be set 545 * to new values. The <code>execute</code> method will use the value 546 * for the command property to create a <code>PreparedStatement</code> 547 * object and set its properties (escape processing, maximum field 548 * size, maximum number of rows, and query timeout limit) to be those 549 * of this rowset. 550 * 551 * @throws SQLException if (1) a database access error occurs, 552 * (2) any required JDBC properties are not set, or (3) if an 553 * invalid connection exists. 554 */ 555 public void execute() throws SQLException { 556 /* 557 * To execute based on the properties: 558 * i) determine how to get a connection 559 * ii) prepare the statement 560 * iii) set the properties of the statement 561 * iv) parse the params. and set them 562 * v) execute the statement 563 * 564 * During all of this try to tolerate as many errors 565 * as possible, many drivers will not support all of 566 * the properties and will/should throw SQLException 567 * at us... 568 * 569 */ 570 571 prepare(); 572 573 // set the properties of our shiny new statement 574 setProperties(ps); 575 576 577 // set the parameters 578 decodeParams(getParams(), ps); 579 580 581 // execute the statement 582 rs = ps.executeQuery(); 583 584 585 // notify listeners 586 notifyRowSetChanged(); 587 588 589 } 590 591 protected void setProperties(PreparedStatement ps) throws SQLException { 592 593 try { 594 ps.setEscapeProcessing(getEscapeProcessing()); 595 } catch (SQLException ex) { 596 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setescapeprocessing").toString() + 597 ex.getLocalizedMessage()); 598 } 599 600 try { 601 ps.setMaxFieldSize(getMaxFieldSize()); 602 } catch (SQLException ex) { 603 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setmaxfieldsize").toString() + 604 ex.getLocalizedMessage()); 605 } 606 607 try { 608 ps.setMaxRows(getMaxRows()); 609 } catch (SQLException ex) { 610 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setmaxrows").toString() + 611 ex.getLocalizedMessage()); 612 } 613 614 try { 615 ps.setQueryTimeout(getQueryTimeout()); 616 } catch (SQLException ex) { 617 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.setquerytimeout").toString() + 618 ex.getLocalizedMessage()); 619 } 620 621 } 622 623 // An alternate solution is required instead of having the 624 // connect method as protected. 625 // This is a work around to assist Rave Team 626 // :ah 627 628 protected Connection connect() throws SQLException { 629 630 // Get a JDBC connection. 631 632 // First check for Connection handle object as such if 633 // "this" initialized using conn. 634 635 if(conn != null) { 636 return conn; 637 638 } else if (getDataSourceName() != null) { 639 640 // Connect using JNDI. 641 try { 642 Context ctx = new InitialContext(); 643 DataSource ds = (DataSource)ctx.lookup 644 (getDataSourceName()); 645 //return ds.getConnection(getUsername(),getPassword()); 646 647 if(getUsername() != null && !getUsername().equals("")) { 648 return ds.getConnection(getUsername(),getPassword()); 649 } else { 650 return ds.getConnection(); 651 } 652 } 653 catch (javax.naming.NamingException ex) { 654 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.connect").toString()); 655 } 656 657 } else if (getUrl() != null) { 658 // Check only for getUrl() != null because 659 // user, passwd can be null 660 // Connect using the driver manager. 661 662 return DriverManager.getConnection 663 (getUrl(), getUsername(), getPassword()); 664 } 665 else { 666 return null; 667 } 668 669 } 670 671 672 protected PreparedStatement prepare() throws SQLException { 673 // get a connection 674 conn = connect(); 675 676 try { 677 678 Map<String, Class<?>> aMap = getTypeMap(); 679 if( aMap != null) { 680 conn.setTypeMap(aMap); 681 } 682 ps = conn.prepareStatement(getCommand(),ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); 683 } catch (SQLException ex) { 684 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.prepare").toString() + 685 ex.getLocalizedMessage()); 686 687 if (ps != null) 688 ps.close(); 689 if (conn != null) 690 conn.close(); 691 692 throw new SQLException(ex.getMessage()); 693 } 694 695 return ps; 696 } 697 698 @SuppressWarnings("deprecation") 699 private void decodeParams(Object[] params, PreparedStatement ps) 700 throws SQLException { 701 702 // There is a corresponding decodeParams in JdbcRowSetImpl 703 // which does the same as this method. This is a design flaw. 704 // Update the CachedRowsetReader.decodeParams when you update 705 // this method. 706 707 // Adding the same comments to CachedRowsetReader.decodeParams. 708 709 int arraySize; 710 Object[] param = null; 711 712 for (int i=0; i < params.length; i++) { 713 if (params[i] instanceof Object[]) { 714 param = (Object[])params[i]; 715 716 if (param.length == 2) { 717 if (param[0] == null) { 718 ps.setNull(i + 1, ((Integer)param[1]).intValue()); 719 continue; 720 } 721 722 if (param[0] instanceof java.sql.Date || 723 param[0] instanceof java.sql.Time || 724 param[0] instanceof java.sql.Timestamp) { 725 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.detecteddate")); 726 if (param[1] instanceof java.util.Calendar) { 727 System.err.println(resBundle.handleGetObject("jdbcrowsetimpl.detectedcalendar")); 728 ps.setDate(i + 1, (java.sql.Date)param[0], 729 (java.util.Calendar)param[1]); 730 continue; 731 } 732 else { 733 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.paramtype").toString()); 734 } 735 } 736 737 if (param[0] instanceof Reader) { 738 ps.setCharacterStream(i + 1, (Reader)param[0], 739 ((Integer)param[1]).intValue()); 740 continue; 741 } 742 743 /* 744 * What's left should be setObject(int, Object, scale) 745 */ 746 if (param[1] instanceof Integer) { 747 ps.setObject(i + 1, param[0], ((Integer)param[1]).intValue()); 748 continue; 749 } 750 751 } else if (param.length == 3) { 752 753 if (param[0] == null) { 754 ps.setNull(i + 1, ((Integer)param[1]).intValue(), 755 (String)param[2]); 756 continue; 757 } 758 759 if (param[0] instanceof java.io.InputStream) { 760 switch (((Integer)param[2]).intValue()) { 761 case JdbcRowSetImpl.UNICODE_STREAM_PARAM: 762 ps.setUnicodeStream(i + 1, 763 (java.io.InputStream)param[0], 764 ((Integer)param[1]).intValue()); 765 break; 766 case JdbcRowSetImpl.BINARY_STREAM_PARAM: 767 ps.setBinaryStream(i + 1, 768 (java.io.InputStream)param[0], 769 ((Integer)param[1]).intValue()); 770 break; 771 case JdbcRowSetImpl.ASCII_STREAM_PARAM: 772 ps.setAsciiStream(i + 1, 773 (java.io.InputStream)param[0], 774 ((Integer)param[1]).intValue()); 775 break; 776 default: 777 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.paramtype").toString()); 778 } 779 } 780 781 /* 782 * no point at looking at the first element now; 783 * what's left must be the setObject() cases. 784 */ 785 if (param[1] instanceof Integer && param[2] instanceof Integer) { 786 ps.setObject(i + 1, param[0], ((Integer)param[1]).intValue(), 787 ((Integer)param[2]).intValue()); 788 continue; 789 } 790 791 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.paramtype").toString()); 792 793 } else { 794 // common case - this catches all SQL92 types 795 ps.setObject(i + 1, params[i]); 796 continue; 797 } 798 } else { 799 // Try to get all the params to be set here 800 ps.setObject(i + 1, params[i]); 801 802 } 803 } 804 } 805 806 /** 807 * Moves the cursor for this rowset's <code>ResultSet</code> 808 * object down one row from its current position. 809 * A <code>ResultSet</code> cursor is initially positioned 810 * before the first row; the first call to the method 811 * <code>next</code> makes the first row the current row; the 812 * second call makes the second row the current row, and so on. 813 * 814 * <P>If an input stream is open for the current row, a call 815 * to the method <code>next</code> will 816 * implicitly close it. A <code>ResultSet</code> object's 817 * warning chain is cleared when a new row is read. 818 * 819 * @return <code>true</code> if the new current row is valid; 820 * <code>false</code> if there are no more rows 821 * @throws SQLException if a database access error occurs 822 * or this rowset does not currently have a valid connection, 823 * prepared statement, and result set 824 */ 825 public boolean next() throws SQLException { 826 checkState(); 827 828 boolean b = rs.next(); 829 notifyCursorMoved(); 830 return b; 831 } 832 833 /** 834 * Releases this rowset's <code>ResultSet</code> object's database and 835 * JDBC resources immediately instead of waiting for 836 * this to happen when it is automatically closed. 837 * 838 * <P><B>Note:</B> A <code>ResultSet</code> object 839 * is automatically closed by the 840 * <code>Statement</code> object that generated it when 841 * that <code>Statement</code> object is closed, 842 * re-executed, or is used to retrieve the next result from a 843 * sequence of multiple results. A <code>ResultSet</code> object 844 * is also automatically closed when it is garbage collected. 845 * 846 * @throws SQLException if a database access error occurs 847 */ 848 public void close() throws SQLException { 849 if (rs != null) 850 rs.close(); 851 if (ps != null) 852 ps.close(); 853 if (conn != null) 854 conn.close(); 855 } 856 857 /** 858 * Reports whether the last column read from this rowset's 859 * <code>ResultSet</code> object had a value of SQL <code>NULL</code>. 860 * Note that you must first call one of the <code>getXXX</code> methods 861 * on a column to try to read its value and then call 862 * the method <code>wasNull</code> to see if the value read was 863 * SQL <code>NULL</code>. 864 * 865 * @return <code>true</code> if the last column value read was SQL 866 * <code>NULL</code> and <code>false</code> otherwise 867 * @throws SQLException if a database access error occurs 868 * or this rowset does not have a currently valid connection, 869 * prepared statement, and result set 870 */ 871 public boolean wasNull() throws SQLException { 872 checkState(); 873 874 return rs.wasNull(); 875 } 876 877 //====================================================================== 878 // Methods for accessing results by column index 879 //====================================================================== 880 881 /** 882 * Gets the value of the designated column in the current row 883 * of this rowset's <code>ResultSet</code> object as 884 * a <code>String</code>. 885 * 886 * @param columnIndex the first column is 1, the second is 2, and so on 887 * @return the column value; if the value is SQL <code>NULL</code>, the 888 * value returned is <code>null</code> 889 * @throws SQLException if (1) a database access error occurs 890 * or (2) this rowset does not currently have a valid connection, 891 * prepared statement, and result set 892 */ 893 public String getString(int columnIndex) throws SQLException { 894 checkState(); 895 896 return rs.getString(columnIndex); 897 } 898 899 /** 900 * Gets the value of the designated column in the current row 901 * of this rowset's <code>ResultSet</code> object as 902 * a <code>boolean</code>. 903 * 904 * @param columnIndex the first column is 1, the second is 2, and so on 905 * @return the column value; if the value is SQL <code>NULL</code>, the 906 * value returned is <code>false</code> 907 * @throws SQLException if (1) a database access error occurs 908 * or (2) this rowset does not have a currently valid connection, 909 * prepared statement, and result set 910 */ 911 public boolean getBoolean(int columnIndex) throws SQLException { 912 checkState(); 913 914 return rs.getBoolean(columnIndex); 915 } 916 917 /** 918 * Gets the value of the designated column in the current row 919 * of this rowset's <code>ResultSet</code> object as 920 * a <code>byte</code>. 921 * 922 * @param columnIndex the first column is 1, the second is 2, and so on 923 * @return the column value; if the value is SQL <code>NULL</code>, the 924 * value returned is <code>0</code> 925 * @throws SQLException if (1) a database access error occurs 926 * or (2) this rowset does not have a currently valid connection, 927 * prepared statement, and result set 928 */ 929 public byte getByte(int columnIndex) throws SQLException { 930 checkState(); 931 932 return rs.getByte(columnIndex); 933 } 934 935 /** 936 * Gets the value of the designated column in the current row 937 * of this rowset's <code>ResultSet</code> object as 938 * a <code>short</code>. 939 * 940 * @param columnIndex the first column is 1, the second is 2, and so on 941 * @return the column value; if the value is SQL <code>NULL</code>, the 942 * value returned is <code>0</code> 943 * @throws SQLException if (1) a database access error occurs 944 * or (2) this rowset does not have a currently valid connection, 945 * prepared statement, and result set 946 */ 947 public short getShort(int columnIndex) throws SQLException { 948 checkState(); 949 950 return rs.getShort(columnIndex); 951 } 952 953 /** 954 * Gets the value of the designated column in the current row 955 * of this rowset's <code>ResultSet</code> object as 956 * an <code>int</code>. 957 * 958 * @param columnIndex the first column is 1, the second is 2, and so on 959 * @return the column value; if the value is SQL <code>NULL</code>, the 960 * value returned is <code>0</code> 961 * @throws SQLException if (1) a database access error occurs 962 * or (2) this rowset does not have a currently valid connection, 963 * prepared statement, and result set 964 */ 965 public int getInt(int columnIndex) throws SQLException { 966 checkState(); 967 968 return rs.getInt(columnIndex); 969 } 970 971 /** 972 * Gets the value of the designated column in the current row 973 * of this rowset's <code>ResultSet</code> object as 974 * a <code>long</code>. 975 * 976 * @param columnIndex the first column is 1, the second is 2, and so on 977 * @return the column value; if the value is SQL <code>NULL</code>, the 978 * value returned is <code>0</code> 979 * @throws SQLException if (1) a database access error occurs 980 * or (2) this rowset does not have a currently valid connection, 981 * prepared statement, and result set 982 */ 983 public long getLong(int columnIndex) throws SQLException { 984 checkState(); 985 986 return rs.getLong(columnIndex); 987 } 988 989 /** 990 * Gets the value of the designated column in the current row 991 * of this rowset's <code>ResultSet</code> object as 992 * a <code>float</code>. 993 * 994 * @param columnIndex the first column is 1, the second is 2, and so on 995 * @return the column value; if the value is SQL <code>NULL</code>, the 996 * value returned is <code>0</code> 997 * @throws SQLException if (1) a database access error occurs 998 * or (2) this rowset does not have a currently valid connection, 999 * prepared statement, and result set 1000 */ 1001 public float getFloat(int columnIndex) throws SQLException { 1002 checkState(); 1003 1004 return rs.getFloat(columnIndex); 1005 } 1006 1007 /** 1008 * Gets the value of the designated column in the current row 1009 * of this rowset's <code>ResultSet</code> object as 1010 * a <code>double</code>. 1011 * 1012 * @param columnIndex the first column is 1, the second is 2, and so on 1013 * @return the column value; if the value is SQL <code>NULL</code>, the 1014 * value returned is <code>0</code> 1015 * @throws SQLException if (1) a database access error occurs 1016 * or (2) this rowset does not have a currently valid connection, 1017 * prepared statement, and result set 1018 */ 1019 public double getDouble(int columnIndex) throws SQLException { 1020 checkState(); 1021 1022 return rs.getDouble(columnIndex); 1023 } 1024 1025 /** 1026 * Gets the value of the designated column in the current row 1027 * of this rowset's <code>ResultSet</code> object as 1028 * a <code>java.sql.BigDecimal</code>. 1029 * 1030 * @param columnIndex the first column is 1, the second is 2, and so on 1031 * @param scale the number of digits to the right of the decimal point 1032 * @return the column value; if the value is SQL <code>NULL</code>, the 1033 * value returned is <code>null</code> 1034 * @throws SQLException if (1) database access error occurs 1035 * or (2) this rowset does not have a currently valid connection, 1036 * prepared statement, and result set 1037 * @deprecated 1038 */ 1039 public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { 1040 checkState(); 1041 1042 return rs.getBigDecimal(columnIndex, scale); 1043 } 1044 1045 /** 1046 * Gets the value of the designated column in the current row 1047 * of this rowset's <code>ResultSet</code> object as 1048 * a <code>byte</code> array in the Java programming language. 1049 * The bytes represent the raw values returned by the driver. 1050 * 1051 * @param columnIndex the first column is 1, the second is 2, and so on 1052 * @return the column value; if the value is SQL <code>NULL</code>, the 1053 * value returned is <code>null</code> 1054 * @throws SQLException if (1) a database access error occurs 1055 * or (2) this rowset does not have a currently valid connection, 1056 * prepared statement, and result set 1057 */ 1058 public byte[] getBytes(int columnIndex) throws SQLException { 1059 checkState(); 1060 1061 return rs.getBytes(columnIndex); 1062 } 1063 1064 /** 1065 * Gets the value of the designated column in the current row 1066 * of this rowset's <code>ResultSet</code> object as 1067 * a <code>java.sql.Date</code> object in the Java programming language. 1068 * 1069 * @param columnIndex the first column is 1, the second is 2, and so on 1070 * @return the column value; if the value is SQL <code>NULL</code>, the 1071 * value returned is <code>null</code> 1072 * @throws SQLException if (1) a database access error occurs 1073 * or (2) this rowset does not have a currently valid connection, 1074 * prepared statement, and result set 1075 */ 1076 public java.sql.Date getDate(int columnIndex) throws SQLException { 1077 checkState(); 1078 1079 return rs.getDate(columnIndex); 1080 } 1081 1082 /** 1083 * Gets the value of the designated column in the current row 1084 * of this rowset's <code>ResultSet</code> object as 1085 * a <code>java.sql.Time</code> object in the Java programming language. 1086 * 1087 * @param columnIndex the first column is 1, the second is 2, and so on 1088 * @return the column value; if the value is SQL <code>NULL</code>, the 1089 * value returned is <code>null</code> 1090 * @throws SQLException if (1) a database access error occurs 1091 * or (2) this rowset does not have a currently valid connection, 1092 * prepared statement, and result set 1093 */ 1094 public java.sql.Time getTime(int columnIndex) throws SQLException { 1095 checkState(); 1096 1097 return rs.getTime(columnIndex); 1098 } 1099 1100 /** 1101 * Gets the value of the designated column in the current row 1102 * of this rowset's <code>ResultSet</code> object as 1103 * a <code>java.sql.Timestamp</code> object in the Java programming language. 1104 * 1105 * @param columnIndex the first column is 1, the second is 2, and so on 1106 * @return the column value; if the value is SQL <code>NULL</code>, the 1107 * value returned is <code>null</code> 1108 * @throws SQLException if (1) a database access error occurs 1109 * or (2) this rowset does not have a currently valid connection, 1110 * prepared statement, and result set 1111 */ 1112 public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException { 1113 checkState(); 1114 1115 return rs.getTimestamp(columnIndex); 1116 } 1117 1118 /** 1119 * Gets the value of the designated column in the current row 1120 * of this rowset's <code>ResultSet</code> object as 1121 * a stream of ASCII characters. The value can then be read in chunks from the 1122 * stream. This method is particularly 1123 * suitable for retrieving large <code>LONGVARCHAR</code> values. 1124 * The JDBC driver will 1125 * do any necessary conversion from the database format into ASCII. 1126 * 1127 * <P><B>Note:</B> All the data in the returned stream must be 1128 * read prior to getting the value of any other column. The next 1129 * call to a <code>getXXX</code> method implicitly closes the stream. Also, a 1130 * stream may return <code>0</code> when the method 1131 * <code>InputStream.available</code> 1132 * is called whether there is data available or not. 1133 * 1134 * @param columnIndex the first column is 1, the second is 2, and so on 1135 * @return a Java input stream that delivers the database column value 1136 * as a stream of one-byte ASCII characters; 1137 * if the value is SQL <code>NULL</code>, the 1138 * value returned is <code>null</code> 1139 * @throws SQLException if (1) database access error occurs 1140 * (2) this rowset does not have a currently valid connection, 1141 * prepared statement, and result set 1142 */ 1143 public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException { 1144 checkState(); 1145 1146 return rs.getAsciiStream(columnIndex); 1147 } 1148 1149 /** 1150 * Gets the value of the designated column in the current row 1151 * of this rowset's <code>ResultSet</code> object as 1152 * as a stream of Unicode characters. 1153 * The value can then be read in chunks from the 1154 * stream. This method is particularly 1155 * suitable for retrieving large<code>LONGVARCHAR</code>values. The JDBC driver will 1156 * do any necessary conversion from the database format into Unicode. 1157 * The byte format of the Unicode stream must be Java UTF-8, 1158 * as specified in the Java virtual machine specification. 1159 * 1160 * <P><B>Note:</B> All the data in the returned stream must be 1161 * read prior to getting the value of any other column. The next 1162 * call to a <code>getXXX</code> method implicitly closes the stream. Also, a 1163 * stream may return <code>0</code> when the method 1164 * <code>InputStream.available</code> 1165 * is called whether there is data available or not. 1166 * 1167 * @param columnIndex the first column is 1, the second is 2, and so on 1168 * @return a Java input stream that delivers the database column value 1169 * as a stream in Java UTF-8 byte format; 1170 * if the value is SQL <code>NULL</code>, the value returned is <code>null</code> 1171 * @throws SQLException if (1) a database access error occurs 1172 * or (2) this rowset does not have a currently valid connection, 1173 * prepared statement, and result set 1174 * @deprecated use <code>getCharacterStream</code> in place of 1175 * <code>getUnicodeStream</code> 1176 */ 1177 public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { 1178 checkState(); 1179 1180 return rs.getUnicodeStream(columnIndex); 1181 } 1182 1183 /** 1184 * Gets the value of a column in the current row as a stream of 1185 * the value of the designated column in the current row 1186 * of this rowset's <code>ResultSet</code> object as a binary stream of 1187 * uninterpreted bytes. The value can then be read in chunks from the 1188 * stream. This method is particularly 1189 * suitable for retrieving large <code>LONGVARBINARY</code> values. 1190 * 1191 * <P><B>Note:</B> All the data in the returned stream must be 1192 * read prior to getting the value of any other column. The next 1193 * call to a <code>getXXX</code> method implicitly closes the stream. Also, a 1194 * stream may return <code>0</code> when the method 1195 * <code>InputStream.available</code> 1196 * is called whether there is data available or not. 1197 * 1198 * @param columnIndex the first column is 1, the second is 2, and so on 1199 * @return a Java input stream that delivers the database column value 1200 * as a stream of uninterpreted bytes; 1201 * if the value is SQL <code>NULL</code>, the value returned is <code>null</code> 1202 * @throws SQLException if (1) a database access error occurs 1203 * or (2) this rowset does not have a currently valid connection, 1204 * prepared statement, and result set 1205 */ 1206 public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException { 1207 checkState(); 1208 1209 return rs.getBinaryStream(columnIndex); 1210 } 1211 1212 1213 //====================================================================== 1214 // Methods for accessing results by column name 1215 //====================================================================== 1216 1217 /** 1218 * Gets the value of the designated column in the current row 1219 * of this rowset's <code>ResultSet</code> object as 1220 * a <code>String</code>. 1221 * 1222 * @param columnName the SQL name of the column 1223 * @return the column value; if the value is SQL <code>NULL</code>, the 1224 * value returned is <code>null</code> 1225 * @throws SQLException if (1) a database access error occurs 1226 * or (2) this rowset does not have a currently valid connection, 1227 * prepared statement, and result set 1228 */ 1229 public String getString(String columnName) throws SQLException { 1230 return getString(findColumn(columnName)); 1231 } 1232 1233 /** 1234 * Gets the value of the designated column in the current row 1235 * of this rowset's <code>ResultSet</code> object as 1236 * a <code>boolean</code>. 1237 * 1238 * @param columnName the SQL name of the column 1239 * @return the column value; if the value is SQL <code>NULL</code>, the 1240 * value returned is <code>false</code> 1241 * @throws SQLException if (1) a database access error occurs 1242 * or (2) this rowset does not have a currently valid connection, 1243 * prepared statement, and result set 1244 */ 1245 public boolean getBoolean(String columnName) throws SQLException { 1246 return getBoolean(findColumn(columnName)); 1247 } 1248 1249 /** 1250 * Gets the value of the designated column in the current row 1251 * of this rowset's <code>ResultSet</code> object as 1252 * a <code>byte</code>. 1253 * 1254 * @param columnName the SQL name of the column 1255 * @return the column value; if the value is SQL <code>NULL</code>, the 1256 * value returned is <code>0</code> 1257 * @throws SQLException if (1) a database access error occurs 1258 * or (2) this rowset does not have a currently valid connection, 1259 * prepared statement, and result set 1260 */ 1261 public byte getByte(String columnName) throws SQLException { 1262 return getByte(findColumn(columnName)); 1263 } 1264 1265 /** 1266 * Gets the value of the designated column in the current row 1267 * of this rowset's <code>ResultSet</code> object as 1268 * a <code>short</code>. 1269 * 1270 * @param columnName the SQL name of the column 1271 * @return the column value; if the value is SQL <code>NULL</code>, the 1272 * value returned is <code>0</code> 1273 * @throws SQLException if (1) a database access error occurs 1274 * or (2) this rowset does not have a currently valid connection, 1275 * prepared statement, and result set 1276 */ 1277 public short getShort(String columnName) throws SQLException { 1278 return getShort(findColumn(columnName)); 1279 } 1280 1281 /** 1282 * Gets the value of the designated column in the current row 1283 * of this rowset's <code>ResultSet</code> object as 1284 * an <code>int</code>. 1285 * 1286 * @param columnName the SQL name of the column 1287 * @return the column value; if the value is SQL <code>NULL</code>, the 1288 * value returned is <code>0</code> 1289 * @throws SQLException if (1) a database access error occurs 1290 * or (2) this rowset does not have a currently valid connection, 1291 * prepared statement, and result set 1292 */ 1293 public int getInt(String columnName) throws SQLException { 1294 return getInt(findColumn(columnName)); 1295 } 1296 1297 /** 1298 * Gets the value of the designated column in the current row 1299 * of this rowset's <code>ResultSet</code> object as 1300 * a <code>long</code>. 1301 * 1302 * @param columnName the SQL name of the column 1303 * @return the column value; if the value is SQL <code>NULL</code>, the 1304 * value returned is <code>0</code> 1305 * @throws SQLException if a database access error occurs 1306 * or this rowset does not have a currently valid connection, 1307 * prepared statement, and result set 1308 */ 1309 public long getLong(String columnName) throws SQLException { 1310 return getLong(findColumn(columnName)); 1311 } 1312 1313 /** 1314 * Gets the value of the designated column in the current row 1315 * of this rowset's <code>ResultSet</code> object as 1316 * a <code>float</code>. 1317 * 1318 * @param columnName the SQL name of the column 1319 * @return the column value; if the value is SQL <code>NULL</code>, the 1320 * value returned is <code>0</code> 1321 * @throws SQLException if (1) a database access error occurs 1322 * or (2) this rowset does not have a currently valid connection, 1323 * prepared statement, and result set 1324 */ 1325 public float getFloat(String columnName) throws SQLException { 1326 return getFloat(findColumn(columnName)); 1327 } 1328 1329 /** 1330 * Gets the value of the designated column in the current row 1331 * of this rowset's <code>ResultSet</code> object as 1332 * a <code>double</code>. 1333 * 1334 * @param columnName the SQL name of the column 1335 * @return the column value; if the value is SQL <code>NULL</code>, the 1336 * value returned is <code>0</code> 1337 * @throws SQLException if (1) a database access error occurs 1338 * or (2) this rowset does not have a currently valid connection, 1339 * prepared statement, and result set 1340 */ 1341 public double getDouble(String columnName) throws SQLException { 1342 return getDouble(findColumn(columnName)); 1343 } 1344 1345 /** 1346 * Gets the value of the designated column in the current row 1347 * of this rowset's <code>ResultSet</code> object as 1348 * a <code>java.math.BigDecimal</code>. 1349 * 1350 * @param columnName the SQL name of the column 1351 * @param scale the number of digits to the right of the decimal point 1352 * @return the column value; if the value is SQL <code>NULL</code>, the 1353 * value returned is <code>null</code> 1354 * @throws SQLException if (1) adatabase access error occurs 1355 * or (2) this rowset does not have a currently valid connection, 1356 * prepared statement, and result set 1357 * @deprecated 1358 */ 1359 public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { 1360 return getBigDecimal(findColumn(columnName), scale); 1361 } 1362 1363 /** 1364 * Gets the value of the designated column in the current row 1365 * of this rowset's <code>ResultSet</code> object as 1366 * a <code>byte</code> array in the Java programming language. 1367 * The bytes represent the raw values returned by the driver. 1368 * 1369 * @param columnName the SQL name of the column 1370 * @return the column value; if the value is SQL <code>NULL</code>, the 1371 * value returned is <code>null</code> 1372 * @throws SQLException if (1) a database access error occurs 1373 * or (2) this rowset does not have a currently valid connection, 1374 * prepared statement, and result set 1375 */ 1376 public byte[] getBytes(String columnName) throws SQLException { 1377 return getBytes(findColumn(columnName)); 1378 } 1379 1380 /** 1381 * Gets the value of the designated column in the current row 1382 * of this rowset's <code>ResultSet</code> object as 1383 * a <code>java.sql.Date</code> object in the Java programming language. 1384 * 1385 * @param columnName the SQL name of the column 1386 * @return the column value; if the value is SQL <code>NULL</code>, the 1387 * value returned is <code>null</code> 1388 * @throws SQLException if (1) a database access error occurs 1389 * or (2) this rowset does not have a currently valid connection, 1390 * prepared statement, and result set 1391 */ 1392 public java.sql.Date getDate(String columnName) throws SQLException { 1393 return getDate(findColumn(columnName)); 1394 } 1395 1396 /** 1397 * Gets the value of the designated column in the current row 1398 * of this rowset's <code>ResultSet</code> object as 1399 * a <code>java.sql.Time</code> object in the Java programming language. 1400 * 1401 * @param columnName the SQL name of the column 1402 * @return the column value; 1403 * if the value is SQL <code>NULL</code>, 1404 * the value returned is <code>null</code> 1405 * @throws SQLException if (1) a database access error occurs 1406 * or (2) this rowset does not have a currently valid connection, 1407 * prepared statement, and result set 1408 */ 1409 public java.sql.Time getTime(String columnName) throws SQLException { 1410 return getTime(findColumn(columnName)); 1411 } 1412 1413 /** 1414 * Gets the value of the designated column in the current row 1415 * of this rowset's <code>ResultSet</code> object as 1416 * a <code>java.sql.Timestamp</code> object. 1417 * 1418 * @param columnName the SQL name of the column 1419 * @return the column value; if the value is SQL <code>NULL</code>, the 1420 * value returned is <code>null</code> 1421 * @throws SQLException if (1) a database access error occurs 1422 * or (2) this rowset does not have a currently valid connection, 1423 * prepared statement, and result set 1424 */ 1425 public java.sql.Timestamp getTimestamp(String columnName) throws SQLException { 1426 return getTimestamp(findColumn(columnName)); 1427 } 1428 1429 /** 1430 * Gets the value of the designated column in the current row 1431 * of this rowset's <code>ResultSet</code> object as a stream of 1432 * ASCII characters. The value can then be read in chunks from the 1433 * stream. This method is particularly 1434 * suitable for retrieving large <code>LONGVARCHAR</code> values. 1435 * The JDBC driver will 1436 * do any necessary conversion from the database format into ASCII. 1437 * 1438 * <P><B>Note:</B> All the data in the returned stream must be 1439 * read prior to getting the value of any other column. The next 1440 * call to a <code>getXXX</code> method implicitly closes the stream. Also, a 1441 * stream may return <code>0</code> when the method <code>available</code> 1442 * is called whether there is data available or not. 1443 * 1444 * @param columnName the SQL name of the column 1445 * @return a Java input stream that delivers the database column value 1446 * as a stream of one-byte ASCII characters. 1447 * If the value is SQL <code>NULL</code>, 1448 * the value returned is <code>null</code>. 1449 * @throws SQLException if (1) a database access error occurs 1450 * or (2) this rowset does not have a currently valid connection, 1451 * prepared statement, and result set 1452 */ 1453 public java.io.InputStream getAsciiStream(String columnName) throws SQLException { 1454 return getAsciiStream(findColumn(columnName)); 1455 } 1456 1457 /** 1458 * Gets the value of the designated column in the current row 1459 * of this rowset's <code>ResultSet</code> object as a stream of 1460 * Unicode characters. The value can then be read in chunks from the 1461 * stream. This method is particularly 1462 * suitable for retrieving large <code>LONGVARCHAR</code> values. 1463 * The JDBC driver will 1464 * do any necessary conversion from the database format into Unicode. 1465 * The byte format of the Unicode stream must be Java UTF-8, 1466 * as defined in the Java virtual machine specification. 1467 * 1468 * <P><B>Note:</B> All the data in the returned stream must be 1469 * read prior to getting the value of any other column. The next 1470 * call to a <code>getXXX</code> method implicitly closes the stream. Also, a 1471 * stream may return <code>0</code> when the method <code>available</code> 1472 * is called whether there is data available or not. 1473 * 1474 * @param columnName the SQL name of the column 1475 * @return a Java input stream that delivers the database column value 1476 * as a stream of two-byte Unicode characters. 1477 * If the value is SQL <code>NULL</code>, 1478 * the value returned is <code>null</code>. 1479 * @throws SQLException if (1) a database access error occurs 1480 * or (2) this rowset does not have a currently valid connection, 1481 * prepared statement, and result set 1482 * @deprecated 1483 */ 1484 public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { 1485 return getUnicodeStream(findColumn(columnName)); 1486 } 1487 1488 /** 1489 * Gets the value of the designated column in the current row 1490 * of this rowset's <code>ResultSet</code> object as a stream of uninterpreted 1491 * <code>byte</code>s. 1492 * The value can then be read in chunks from the 1493 * stream. This method is particularly 1494 * suitable for retrieving large <code>LONGVARBINARY</code> 1495 * values. 1496 * 1497 * <P><B>Note:</B> All the data in the returned stream must be 1498 * read prior to getting the value of any other column. The next 1499 * call to a <code>getXXX</code> method implicitly closes the stream. Also, a 1500 * stream may return <code>0</code> when the method <code>available</code> 1501 * is called whether there is data available or not. 1502 * 1503 * @param columnName the SQL name of the column 1504 * @return a Java input stream that delivers the database column value 1505 * as a stream of uninterpreted bytes; 1506 * if the value is SQL <code>NULL</code>, the result is <code>null</code> 1507 * @throws SQLException if (1) a database access error occurs 1508 * or (2) this rowset does not have a currently valid connection, 1509 * prepared statement, and result set 1510 */ 1511 public java.io.InputStream getBinaryStream(String columnName) throws SQLException { 1512 return getBinaryStream(findColumn(columnName)); 1513 } 1514 1515 1516 //===================================================================== 1517 // Advanced features: 1518 //===================================================================== 1519 1520 /** 1521 * Returns the first warning reported by calls on this rowset's 1522 * <code>ResultSet</code> object. 1523 * Subsequent warnings on this rowset's <code>ResultSet</code> object 1524 * will be chained to the <code>SQLWarning</code> object that 1525 * this method returns. 1526 * 1527 * <P>The warning chain is automatically cleared each time a new 1528 * row is read. 1529 * 1530 * <P><B>Note:</B> This warning chain only covers warnings caused 1531 * by <code>ResultSet</code> methods. Any warning caused by 1532 * <code>Statement</code> methods 1533 * (such as reading OUT parameters) will be chained on the 1534 * <code>Statement</code> object. 1535 * 1536 * @return the first <code>SQLWarning</code> object reported or <code>null</code> 1537 * @throws SQLException if (1) a database access error occurs 1538 * or (2) this rowset does not have a currently valid connection, 1539 * prepared statement, and result set 1540 */ 1541 public SQLWarning getWarnings() throws SQLException { 1542 checkState(); 1543 1544 return rs.getWarnings(); 1545 } 1546 1547 /** 1548 * Clears all warnings reported on this rowset's <code>ResultSet</code> object. 1549 * After this method is called, the method <code>getWarnings</code> 1550 * returns <code>null</code> until a new warning is 1551 * reported for this rowset's <code>ResultSet</code> object. 1552 * 1553 * @throws SQLException if (1) a database access error occurs 1554 * or (2) this rowset does not have a currently valid connection, 1555 * prepared statement, and result set 1556 */ 1557 public void clearWarnings() throws SQLException { 1558 checkState(); 1559 1560 rs.clearWarnings(); 1561 } 1562 1563 /** 1564 * Gets the name of the SQL cursor used by this rowset's <code>ResultSet</code> 1565 * object. 1566 * 1567 * <P>In SQL, a result table is retrieved through a cursor that is 1568 * named. The current row of a result set can be updated or deleted 1569 * using a positioned update/delete statement that references the 1570 * cursor name. To insure that the cursor has the proper isolation 1571 * level to support update, the cursor's <code>select</code> statement should be 1572 * of the form 'select for update'. If the 'for update' clause is 1573 * omitted, the positioned updates may fail. 1574 * 1575 * <P>The JDBC API supports this SQL feature by providing the name of the 1576 * SQL cursor used by a <code>ResultSet</code> object. 1577 * The current row of a <code>ResultSet</code> object 1578 * is also the current row of this SQL cursor. 1579 * 1580 * <P><B>Note:</B> If positioned update is not supported, a 1581 * <code>SQLException</code> is thrown. 1582 * 1583 * @return the SQL name for this rowset's <code>ResultSet</code> object's cursor 1584 * @throws SQLException if (1) a database access error occurs 1585 * or (2) xthis rowset does not have a currently valid connection, 1586 * prepared statement, and result set 1587 */ 1588 public String getCursorName() throws SQLException { 1589 checkState(); 1590 1591 return rs.getCursorName(); 1592 } 1593 1594 /** 1595 * Retrieves the number, types and properties of 1596 * this rowset's <code>ResultSet</code> object's columns. 1597 * 1598 * @return the description of this rowset's <code>ResultSet</code> 1599 * object's columns 1600 * @throws SQLException if (1) a database access error occurs 1601 * or (2) this rowset does not have a currently valid connection, 1602 * prepared statement, and result set 1603 */ 1604 public ResultSetMetaData getMetaData() throws SQLException { 1605 1606 checkState(); 1607 1608 // It may be the case that JdbcRowSet might not have been 1609 // initialized with ResultSet handle and may be by PreparedStatement 1610 // internally when we set JdbcRowSet.setCommand(). 1611 // We may require all the basic properties of setEscapeProcessing 1612 // setMaxFieldSize etc. which an application can use before we call 1613 // execute. 1614 try { 1615 checkState(); 1616 } catch(SQLException sqle) { 1617 prepare(); 1618 // will return ResultSetMetaData 1619 return ps.getMetaData(); 1620 } 1621 return rs.getMetaData(); 1622 } 1623 1624 /** 1625 * <p>Gets the value of the designated column in the current row 1626 * of this rowset's <code>ResultSet</code> object as 1627 * an <code>Object</code>. 1628 * 1629 * <p>This method will return the value of the given column as a 1630 * Java object. The type of the Java object will be the default 1631 * Java object type corresponding to the column's SQL type, 1632 * following the mapping for built-in types specified in the JDBC 1633 * specification. 1634 * 1635 * <p>This method may also be used to read datatabase-specific 1636 * abstract data types. 1637 * 1638 * In the JDBC 3.0 API, the behavior of method 1639 * <code>getObject</code> is extended to materialize 1640 * data of SQL user-defined types. When a column contains 1641 * a structured or distinct value, the behavior of this method is as 1642 * if it were a call to: <code>getObject(columnIndex, 1643 * this.getStatement().getConnection().getTypeMap())</code>. 1644 * 1645 * @param columnIndex the first column is 1, the second is 2, and so on 1646 * @return a <code>java.lang.Object</code> holding the column value 1647 * @throws SQLException if (1) a database access error occurs 1648 * or (2) this rowset does not currently have a valid connection, 1649 * prepared statement, and result set 1650 */ 1651 public Object getObject(int columnIndex) throws SQLException { 1652 checkState(); 1653 1654 return rs.getObject(columnIndex); 1655 } 1656 1657 /** 1658 * <p>Gets the value of the designated column in the current row 1659 * of this rowset's <code>ResultSet</code> object as 1660 * an <code>Object</code>. 1661 * 1662 * <p>This method will return the value of the given column as a 1663 * Java object. The type of the Java object will be the default 1664 * Java object type corresponding to the column's SQL type, 1665 * following the mapping for built-in types specified in the JDBC 1666 * specification. 1667 * 1668 * <p>This method may also be used to read datatabase-specific 1669 * abstract data types. 1670 * 1671 * In the JDBC 3.0 API, the behavior of the method 1672 * <code>getObject</code> is extended to materialize 1673 * data of SQL user-defined types. When a column contains 1674 * a structured or distinct value, the behavior of this method is as 1675 * if it were a call to: <code>getObject(columnIndex, 1676 * this.getStatement().getConnection().getTypeMap())</code>. 1677 * 1678 * @param columnName the SQL name of the column 1679 * @return a <code>java.lang.Object</code> holding the column value 1680 * @throws SQLException if (1) a database access error occurs 1681 * or (2) this rowset does not currently have a valid connection, 1682 * prepared statement, and result set 1683 */ 1684 public Object getObject(String columnName) throws SQLException { 1685 return getObject(findColumn(columnName)); 1686 } 1687 1688 //---------------------------------------------------------------- 1689 1690 /** 1691 * Maps the given <code>JdbcRowSetImpl</code> column name to its 1692 * <code>JdbcRowSetImpl</code> column index and reflects this on 1693 * the internal <code>ResultSet</code> object. 1694 * 1695 * @param columnName the name of the column 1696 * @return the column index of the given column name 1697 * @throws SQLException if (1) a database access error occurs 1698 * (2) this rowset does not have a currently valid connection, 1699 * prepared statement, and result set 1700 */ 1701 public int findColumn(String columnName) throws SQLException { 1702 checkState(); 1703 1704 return rs.findColumn(columnName); 1705 } 1706 1707 1708 //--------------------------JDBC 2.0----------------------------------- 1709 1710 //--------------------------------------------------------------------- 1711 // Getters and Setters 1712 //--------------------------------------------------------------------- 1713 1714 /** 1715 * Gets the value of the designated column in the current row 1716 * of this rowset's <code>ResultSet</code> object as a 1717 * <code>java.io.Reader</code> object. 1718 * @return a <code>java.io.Reader</code> object that contains the column 1719 * value; if the value is SQL <code>NULL</code>, the value returned is 1720 * <code>null</code>. 1721 * @param columnIndex the first column is 1, the second is 2, and so on 1722 * 1723 */ 1724 public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { 1725 checkState(); 1726 1727 return rs.getCharacterStream(columnIndex); 1728 } 1729 1730 /** 1731 * Gets the value of the designated column in the current row 1732 * of this rowset's <code>ResultSet</code> object as a 1733 * <code>java.io.Reader</code> object. 1734 * 1735 * @return a <code>java.io.Reader</code> object that contains the column 1736 * value; if the value is SQL <code>NULL</code>, the value returned is 1737 * <code>null</code>. 1738 * @param columnName the name of the column 1739 * @return the value in the specified column as a <code>java.io.Reader</code> 1740 * 1741 */ 1742 public java.io.Reader getCharacterStream(String columnName) throws SQLException { 1743 return getCharacterStream(findColumn(columnName)); 1744 } 1745 1746 /** 1747 * Gets the value of the designated column in the current row 1748 * of this rowset's <code>ResultSet</code> object as a 1749 * <code>java.math.BigDecimal</code> with full precision. 1750 * 1751 * @param columnIndex the first column is 1, the second is 2, and so on 1752 * @return the column value (full precision); 1753 * if the value is SQL <code>NULL</code>, the value returned is 1754 * <code>null</code>. 1755 * @throws SQLException if a database access error occurs 1756 * or this rowset does not currently have a valid 1757 * connection, prepared statement, and result set 1758 */ 1759 public BigDecimal getBigDecimal(int columnIndex) throws SQLException { 1760 checkState(); 1761 1762 return rs.getBigDecimal(columnIndex); 1763 } 1764 1765 /** 1766 * Gets the value of the designated column in the current row 1767 * of this rowset's <code>ResultSet</code> object as a 1768 * <code>java.math.BigDecimal</code> with full precision. 1769 * 1770 * @param columnName the column name 1771 * @return the column value (full precision); 1772 * if the value is SQL <code>NULL</code>, the value returned is 1773 * <code>null</code>. 1774 * @throws SQLException if a database access error occurs 1775 * or this rowset does not currently have a valid 1776 * connection, prepared statement, and result set 1777 */ 1778 public BigDecimal getBigDecimal(String columnName) throws SQLException { 1779 return getBigDecimal(findColumn(columnName)); 1780 } 1781 1782 //--------------------------------------------------------------------- 1783 // Traversal/Positioning 1784 //--------------------------------------------------------------------- 1785 1786 /** 1787 * Indicates whether the cursor is before the first row in 1788 * this rowset's <code>ResultSet</code> object. 1789 * 1790 * @return <code>true</code> if the cursor is before the first row; 1791 * <code>false</code> if the cursor is at any other position or the 1792 * result set contains no rows 1793 * @throws SQLException if a database access error occurs 1794 * or this rowset does not currently have a valid 1795 * connection, prepared statement, and result set 1796 */ 1797 public boolean isBeforeFirst() throws SQLException { 1798 checkState(); 1799 1800 return rs.isBeforeFirst(); 1801 } 1802 1803 /** 1804 * Indicates whether the cursor is after the last row in 1805 * this rowset's <code>ResultSet</code> object. 1806 * 1807 * @return <code>true</code> if the cursor is after the last row; 1808 * <code>false</code> if the cursor is at any other position or the 1809 * result set contains no rows 1810 * @throws SQLException if a database access error occurs 1811 * or this rowset does not currently have a valid 1812 * connection, prepared statement, and result set 1813 */ 1814 public boolean isAfterLast() throws SQLException { 1815 checkState(); 1816 1817 return rs.isAfterLast(); 1818 } 1819 1820 /** 1821 * Indicates whether the cursor is on the first row of 1822 * this rowset's <code>ResultSet</code> object. 1823 * 1824 * @return <code>true</code> if the cursor is on the first row; 1825 * <code>false</code> otherwise 1826 * @throws SQLException if a database access error occurs 1827 * or this rowset does not currently have a valid 1828 * connection, prepared statement, and result set 1829 */ 1830 public boolean isFirst() throws SQLException { 1831 checkState(); 1832 1833 return rs.isFirst(); 1834 } 1835 1836 /** 1837 * Indicates whether the cursor is on the last row of 1838 * this rowset's <code>ResultSet</code> object. 1839 * Note: Calling the method <code>isLast</code> may be expensive 1840 * because the JDBC driver 1841 * might need to fetch ahead one row in order to determine 1842 * whether the current row is the last row in the result set. 1843 * 1844 * @return <code>true</code> if the cursor is on the last row; 1845 * <code>false</code> otherwise 1846 * @throws SQLException if a database access error occurs 1847 * or this rowset does not currently have a valid 1848 * connection, prepared statement, and result set 1849 * 1850 */ 1851 public boolean isLast() throws SQLException { 1852 checkState(); 1853 1854 return rs.isLast(); 1855 } 1856 1857 /** 1858 * Moves the cursor to the front of 1859 * this rowset's <code>ResultSet</code> object, just before the 1860 * first row. This method has no effect if the result set contains no rows. 1861 * 1862 * @throws SQLException if (1) a database access error occurs, 1863 * (2) the result set type is <code>TYPE_FORWARD_ONLY</code>, 1864 * or (3) this rowset does not currently have a valid 1865 * connection, prepared statement, and result set 1866 */ 1867 public void beforeFirst() throws SQLException { 1868 checkState(); 1869 1870 rs.beforeFirst(); 1871 notifyCursorMoved(); 1872 } 1873 1874 /** 1875 * Moves the cursor to the end of 1876 * this rowset's <code>ResultSet</code> object, just after the 1877 * last row. This method has no effect if the result set contains no rows. 1878 * @throws SQLException if (1) a database access error occurs, 1879 * (2) the result set type is <code>TYPE_FORWARD_ONLY</code>, 1880 * or (3) this rowset does not currently have a valid 1881 * connection, prepared statement, and result set 1882 */ 1883 public void afterLast() throws SQLException { 1884 checkState(); 1885 1886 rs.afterLast(); 1887 notifyCursorMoved(); 1888 } 1889 1890 /** 1891 * Moves the cursor to the first row in 1892 * this rowset's <code>ResultSet</code> object. 1893 * 1894 * @return <code>true</code> if the cursor is on a valid row; 1895 * <code>false</code> if there are no rows in the result set 1896 * @throws SQLException if (1) a database access error occurs, 1897 * (2) the result set type is <code>TYPE_FORWARD_ONLY</code>, 1898 * or (3) this rowset does not currently have a valid 1899 * connection, prepared statement, and result set 1900 */ 1901 public boolean first() throws SQLException { 1902 checkState(); 1903 1904 boolean b = rs.first(); 1905 notifyCursorMoved(); 1906 return b; 1907 1908 } 1909 1910 /** 1911 * Moves the cursor to the last row in 1912 * this rowset's <code>ResultSet</code> object. 1913 * 1914 * @return <code>true</code> if the cursor is on a valid row; 1915 * <code>false</code> if there are no rows in the result set 1916 * @throws SQLException if (1) a database access error occurs, 1917 * (2) the result set type is <code>TYPE_FORWARD_ONLY</code>, 1918 * or (3) this rowset does not currently have a valid 1919 * connection, prepared statement, and result set 1920 */ 1921 public boolean last() throws SQLException { 1922 checkState(); 1923 1924 boolean b = rs.last(); 1925 notifyCursorMoved(); 1926 return b; 1927 } 1928 1929 /** 1930 * Retrieves the current row number. The first row is number 1, the 1931 * second is number 2, and so on. 1932 * 1933 * @return the current row number; <code>0</code> if there is no current row 1934 * @throws SQLException if a database access error occurs 1935 * or this rowset does not currently have a valid connection, 1936 * prepared statement, and result set 1937 */ 1938 public int getRow() throws SQLException { 1939 checkState(); 1940 1941 return rs.getRow(); 1942 } 1943 1944 /** 1945 * Moves the cursor to the given row number in 1946 * this rowset's internal <code>ResultSet</code> object. 1947 * 1948 * <p>If the row number is positive, the cursor moves to 1949 * the given row number with respect to the 1950 * beginning of the result set. The first row is row 1, the second 1951 * is row 2, and so on. 1952 * 1953 * <p>If the given row number is negative, the cursor moves to 1954 * an absolute row position with respect to 1955 * the end of the result set. For example, calling the method 1956 * <code>absolute(-1)</code> positions the 1957 * cursor on the last row, calling the method <code>absolute(-2)</code> 1958 * moves the cursor to the next-to-last row, and so on. 1959 * 1960 * <p>An attempt to position the cursor beyond the first/last row in 1961 * the result set leaves the cursor before the first row or after 1962 * the last row. 1963 * 1964 * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same 1965 * as calling <code>first()</code>. Calling <code>absolute(-1)</code> 1966 * is the same as calling <code>last()</code>. 1967 * 1968 * @return <code>true</code> if the cursor is on the result set; 1969 * <code>false</code> otherwise 1970 * @throws SQLException if (1) a database access error occurs, 1971 * (2) the row is <code>0</code>, (3) the result set 1972 * type is <code>TYPE_FORWARD_ONLY</code>, or (4) this 1973 * rowset does not currently have a valid connection, 1974 * prepared statement, and result set 1975 */ 1976 public boolean absolute(int row) throws SQLException { 1977 checkState(); 1978 1979 boolean b = rs.absolute(row); 1980 notifyCursorMoved(); 1981 return b; 1982 } 1983 1984 /** 1985 * Moves the cursor a relative number of rows, either positive or negative. 1986 * Attempting to move beyond the first/last row in the 1987 * result set positions the cursor before/after the 1988 * the first/last row. Calling <code>relative(0)</code> is valid, but does 1989 * not change the cursor position. 1990 * 1991 * <p>Note: Calling the method <code>relative(1)</code> 1992 * is different from calling the method <code>next()</code> 1993 * because is makes sense to call <code>next()</code> when there 1994 * is no current row, 1995 * for example, when the cursor is positioned before the first row 1996 * or after the last row of the result set. 1997 * 1998 * @return <code>true</code> if the cursor is on a row; 1999 * <code>false</code> otherwise 2000 * @throws SQLException if (1) a database access error occurs, 2001 * (2) there is no current row, (3) the result set 2002 * type is <code>TYPE_FORWARD_ONLY</code>, or (4) this 2003 * rowset does not currently have a valid connection, 2004 * prepared statement, and result set 2005 */ 2006 public boolean relative(int rows) throws SQLException { 2007 checkState(); 2008 2009 boolean b = rs.relative(rows); 2010 notifyCursorMoved(); 2011 return b; 2012 } 2013 2014 /** 2015 * Moves the cursor to the previous row in this 2016 * <code>ResultSet</code> object. 2017 * 2018 * <p><B>Note:</B> Calling the method <code>previous()</code> is not the same as 2019 * calling the method <code>relative(-1)</code> because it 2020 * makes sense to call <code>previous()</code> when there is no current row. 2021 * 2022 * @return <code>true</code> if the cursor is on a valid row; 2023 * <code>false</code> if it is off the result set 2024 * @throws SQLException if (1) a database access error occurs, 2025 * (2) the result set type is <code>TYPE_FORWARD_ONLY</code>, 2026 * or (3) this rowset does not currently have a valid 2027 * connection, prepared statement, and result set 2028 */ 2029 public boolean previous() throws SQLException { 2030 checkState(); 2031 2032 boolean b = rs.previous(); 2033 notifyCursorMoved(); 2034 return b; 2035 } 2036 2037 /** 2038 * Gives a hint as to the direction in which the rows in this 2039 * <code>ResultSet</code> object will be processed. 2040 * The initial value is determined by the 2041 * <code>Statement</code> object 2042 * that produced this rowset's <code>ResultSet</code> object. 2043 * The fetch direction may be changed at any time. 2044 * 2045 * @throws SQLException if (1) a database access error occurs, 2046 * (2) the result set type is <code>TYPE_FORWARD_ONLY</code> 2047 * and the fetch direction is not <code>FETCH_FORWARD</code>, 2048 * or (3) this rowset does not currently have a valid 2049 * connection, prepared statement, and result set 2050 * @see java.sql.Statement#setFetchDirection 2051 */ 2052 public void setFetchDirection(int direction) throws SQLException { 2053 checkState(); 2054 2055 rs.setFetchDirection(direction); 2056 } 2057 2058 /** 2059 * Returns the fetch direction for this 2060 * <code>ResultSet</code> object. 2061 * 2062 * @return the current fetch direction for this rowset's 2063 * <code>ResultSet</code> object 2064 * @throws SQLException if a database access error occurs 2065 * or this rowset does not currently have a valid connection, 2066 * prepared statement, and result set 2067 */ 2068 public int getFetchDirection() throws SQLException { 2069 try { 2070 checkState(); 2071 } catch(SQLException sqle) { 2072 super.getFetchDirection(); 2073 } 2074 return rs.getFetchDirection(); 2075 } 2076 2077 /** 2078 * Gives the JDBC driver a hint as to the number of rows that should 2079 * be fetched from the database when more rows are needed for this 2080 * <code>ResultSet</code> object. 2081 * If the fetch size specified is zero, the JDBC driver 2082 * ignores the value and is free to make its own best guess as to what 2083 * the fetch size should be. The default value is set by the 2084 * <code>Statement</code> object 2085 * that created the result set. The fetch size may be changed at any time. 2086 * 2087 * @param rows the number of rows to fetch 2088 * @throws SQLException if (1) a database access error occurs, (2) the 2089 * condition <code>0 <= rows <= this.getMaxRows()</code> is not 2090 * satisfied, or (3) this rowset does not currently have a valid 2091 * connection, prepared statement, and result set 2092 * 2093 */ 2094 public void setFetchSize(int rows) throws SQLException { 2095 checkState(); 2096 2097 rs.setFetchSize(rows); 2098 } 2099 2100 /** 2101 * 2102 * Returns the fetch size for this 2103 * <code>ResultSet</code> object. 2104 * 2105 * @return the current fetch size for this rowset's <code>ResultSet</code> object 2106 * @throws SQLException if a database access error occurs 2107 * or this rowset does not currently have a valid connection, 2108 * prepared statement, and result set 2109 */ 2110 public int getType() throws SQLException { 2111 try { 2112 checkState(); 2113 } catch(SQLException sqle) { 2114 return super.getType(); 2115 } 2116 2117 // If the ResultSet has not been created, then return the default type 2118 // otherwise return the type from the ResultSet. 2119 if(rs == null) { 2120 return super.getType(); 2121 } else { 2122 int rstype = rs.getType(); 2123 return rstype; 2124 } 2125 2126 2127 } 2128 2129 /** 2130 * Returns the concurrency mode of this rowset's <code>ResultSet</code> object. 2131 * The concurrency used is determined by the 2132 * <code>Statement</code> object that created the result set. 2133 * 2134 * @return the concurrency type, either <code>CONCUR_READ_ONLY</code> 2135 * or <code>CONCUR_UPDATABLE</code> 2136 * @throws SQLException if (1) a database access error occurs 2137 * or (2) this rowset does not currently have a valid connection, 2138 * prepared statement, and result set 2139 */ 2140 public int getConcurrency() throws SQLException { 2141 try { 2142 checkState(); 2143 } catch(SQLException sqle) { 2144 super.getConcurrency(); 2145 } 2146 return rs.getConcurrency(); 2147 } 2148 2149 //--------------------------------------------------------------------- 2150 // Updates 2151 //--------------------------------------------------------------------- 2152 2153 /** 2154 * Indicates whether the current row has been updated. The value returned 2155 * depends on whether or not the result set can detect updates. 2156 * 2157 * @return <code>true</code> if the row has been visibly updated 2158 * by the owner or another, and updates are detected 2159 * @throws SQLException if a database access error occurs 2160 * or this rowset does not currently have a valid connection, 2161 * prepared statement, and result set 2162 * @see java.sql.DatabaseMetaData#updatesAreDetected 2163 */ 2164 public boolean rowUpdated() throws SQLException { 2165 checkState(); 2166 2167 return rs.rowUpdated(); 2168 } 2169 2170 /** 2171 * Indicates whether the current row has had an insertion. 2172 * The value returned depends on whether or not this 2173 * <code>ResultSet</code> object can detect visible inserts. 2174 * 2175 * @return <code>true</code> if a row has had an insertion 2176 * and insertions are detected; <code>false</code> otherwise 2177 * @throws SQLException if a database access error occurs 2178 * or this rowset does not currently have a valid connection, 2179 * prepared statement, and result set 2180 * @see java.sql.DatabaseMetaData#insertsAreDetected 2181 * 2182 */ 2183 public boolean rowInserted() throws SQLException { 2184 checkState(); 2185 2186 return rs.rowInserted(); 2187 } 2188 2189 /** 2190 * Indicates whether a row has been deleted. A deleted row may leave 2191 * a visible "hole" in a result set. This method can be used to 2192 * detect holes in a result set. The value returned depends on whether 2193 * or not this rowset's <code>ResultSet</code> object can detect deletions. 2194 * 2195 * @return <code>true</code> if a row was deleted and deletions are detected; 2196 * <code>false</code> otherwise 2197 * @throws SQLException if a database access error occurs 2198 * or this rowset does not currently have a valid connection, 2199 * prepared statement, and result set 2200 * @see java.sql.DatabaseMetaData#deletesAreDetected 2201 */ 2202 public boolean rowDeleted() throws SQLException { 2203 checkState(); 2204 2205 return rs.rowDeleted(); 2206 } 2207 2208 /** 2209 * Gives a nullable column a null value. 2210 * 2211 * The <code>updateXXX</code> methods are used to update column values in the 2212 * current row or the insert row. The <code>updateXXX</code> methods do not 2213 * update the underlying database; instead the <code>updateRow</code> 2214 * or <code>insertRow</code> methods are called to update the database. 2215 * 2216 * @param columnIndex the first column is 1, the second is 2, and so on 2217 * @throws SQLException if a database access error occurs 2218 * or this rowset does not currently have a valid connection, 2219 * prepared statement, and result set 2220 */ 2221 public void updateNull(int columnIndex) throws SQLException { 2222 checkState(); 2223 2224 // To check the type and concurrency of the ResultSet 2225 // to verify whether updates are possible or not 2226 checkTypeConcurrency(); 2227 2228 rs.updateNull(columnIndex); 2229 } 2230 2231 /** 2232 * Updates the designated column with a <code>boolean</code> value. 2233 * The <code>updateXXX</code> methods are used to update column values in the 2234 * current row or the insert row. The <code>updateXXX</code> methods do not 2235 * update the underlying database; instead the <code>updateRow</code> or 2236 * <code>insertRow</code> methods are called to update the database. 2237 * 2238 * @param columnIndex the first column is 1, the second is 2, and so on 2239 * @param x the new column value 2240 * @throws SQLException if a database access error occurs 2241 * or this rowset does not currently have a valid connection, 2242 * prepared statement, and result set 2243 * 2244 */ 2245 public void updateBoolean(int columnIndex, boolean x) throws SQLException { 2246 checkState(); 2247 2248 // To check the type and concurrency of the ResultSet 2249 // to verify whether updates are possible or not 2250 checkTypeConcurrency(); 2251 2252 rs.updateBoolean(columnIndex, x); 2253 } 2254 2255 /** 2256 * Updates the designated column with a <code>byte</code> value. 2257 * The <code>updateXXX</code> methods are used to update column values in the 2258 * current row or the insert row. The <code>updateXXX</code> methods do not 2259 * update the underlying database; instead the <code>updateRow</code> or 2260 * <code>insertRow</code> methods are called to update the database. 2261 * 2262 * 2263 * @param columnIndex the first column is 1, the second is 2, and so on 2264 * @param x the new column value 2265 * @throws SQLException if a database access error occurs 2266 * or this rowset does not currently have a valid connection, 2267 * prepared statement, and result set 2268 * 2269 */ 2270 public void updateByte(int columnIndex, byte x) throws SQLException { 2271 checkState(); 2272 2273 // To check the type and concurrency of the ResultSet 2274 // to verify whether updates are possible or not 2275 checkTypeConcurrency(); 2276 2277 rs.updateByte(columnIndex, x); 2278 } 2279 2280 /** 2281 * Updates the designated column with a <code>short</code> value. 2282 * The <code>updateXXX</code> methods are used to update column values in the 2283 * current row or the insert row. The <code>updateXXX</code> methods do not 2284 * update the underlying database; instead the <code>updateRow</code> or 2285 * <code>insertRow</code> methods are called to update the database. 2286 * 2287 * @param columnIndex the first column is 1, the second is 2, and so on 2288 * @param x the new column value 2289 * @throws SQLException if a database access error occurs 2290 * or this rowset does not currently have a valid connection, 2291 * prepared statement, and result set 2292 * 2293 */ 2294 public void updateShort(int columnIndex, short x) throws SQLException { 2295 checkState(); 2296 2297 // To check the type and concurrency of the ResultSet 2298 // to verify whether updates are possible or not 2299 checkTypeConcurrency(); 2300 2301 rs.updateShort(columnIndex, x); 2302 } 2303 2304 /** 2305 * Updates the designated column with an <code>int</code> value. 2306 * The <code>updateXXX</code> methods are used to update column values in the 2307 * current row or the insert row. The <code>updateXXX</code> methods do not 2308 * update the underlying database; instead the <code>updateRow</code> or 2309 * <code>insertRow</code> methods are called to update the database. 2310 * 2311 * @param columnIndex the first column is 1, the second is 2, and so on 2312 * @param x the new column value 2313 * @throws SQLException if a database access error occurs 2314 * or this rowset does not currently have a valid connection, 2315 * prepared statement, and result set 2316 */ 2317 public void updateInt(int columnIndex, int x) throws SQLException { 2318 checkState(); 2319 2320 // To check the type and concurrency of the ResultSet 2321 // to verify whether updates are possible or not 2322 checkTypeConcurrency(); 2323 2324 rs.updateInt(columnIndex, x); 2325 } 2326 2327 /** 2328 * Updates the designated column with a <code>long</code> value. 2329 * The <code>updateXXX</code> methods are used to update column values in the 2330 * current row or the insert row. The <code>updateXXX</code> methods do not 2331 * update the underlying database; instead the <code>updateRow</code> or 2332 * <code>insertRow</code> methods are called to update the database. 2333 * 2334 * @param columnIndex the first column is 1, the second is 2, and so on 2335 * @param x the new column value 2336 * @throws SQLException if a database access error occurs 2337 * or this rowset does not currently have a valid connection, 2338 * prepared statement, and result set 2339 * 2340 */ 2341 public void updateLong(int columnIndex, long x) throws SQLException { 2342 checkState(); 2343 2344 // To check the type and concurrency of the ResultSet 2345 // to verify whether updates are possible or not 2346 checkTypeConcurrency(); 2347 2348 rs.updateLong(columnIndex, x); 2349 } 2350 2351 /** 2352 * Updates the designated column with a <code>float</code> value. 2353 * The <code>updateXXX</code> methods are used to update column values in the 2354 * current row or the insert row. The <code>updateXXX</code> methods do not 2355 * update the underlying database; instead the <code>updateRow</code> or 2356 * <code>insertRow</code> methods are called to update the database. 2357 * 2358 * @param columnIndex the first column is 1, the second is 2, and so on 2359 * @param x the new column value 2360 * @throws SQLException if a database access error occurs 2361 * or this rowset does not currently have a valid connection, 2362 * prepared statement, and result set 2363 * 2364 */ 2365 public void updateFloat(int columnIndex, float x) throws SQLException { 2366 checkState(); 2367 2368 // To check the type and concurrency of the ResultSet 2369 // to verify whether updates are possible or not 2370 checkTypeConcurrency(); 2371 2372 rs.updateFloat(columnIndex, x); 2373 } 2374 2375 /** 2376 * Updates the designated column with a <code>double</code> value. 2377 * The <code>updateXXX</code> methods are used to update column values in the 2378 * current row or the insert row. The <code>updateXXX</code> methods do not 2379 * update the underlying database; instead the <code>updateRow</code> or 2380 * <code>insertRow</code> methods are called to update the database. 2381 * 2382 * @param columnIndex the first column is 1, the second is 2, and so on 2383 * @param x the new column value 2384 * @throws SQLException if a database access error occurs 2385 * or this rowset does not currently have a valid connection, 2386 * prepared statement, and result set 2387 * 2388 */ 2389 public void updateDouble(int columnIndex, double x) throws SQLException { 2390 checkState(); 2391 2392 // To check the type and concurrency of the ResultSet 2393 // to verify whether updates are possible or not 2394 checkTypeConcurrency(); 2395 2396 rs.updateDouble(columnIndex, x); 2397 } 2398 2399 /** 2400 * Updates the designated column with a <code>java.math.BigDecimal</code> 2401 * value. 2402 * The <code>updateXXX</code> methods are used to update column values in the 2403 * current row or the insert row. The <code>updateXXX</code> methods do not 2404 * update the underlying database; instead the <code>updateRow</code> or 2405 * <code>insertRow</code> methods are called to update the database. 2406 * 2407 * @param columnIndex the first column is 1, the second is 2, and so on 2408 * @param x the new column value 2409 * @throws SQLException if a database access error occurs 2410 * or this rowset does not currently have a valid connection, 2411 * prepared statement, and result set 2412 * 2413 */ 2414 public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { 2415 checkState(); 2416 2417 // To check the type and concurrency of the ResultSet 2418 // to verify whether updates are possible or not 2419 checkTypeConcurrency(); 2420 2421 rs.updateBigDecimal(columnIndex, x); 2422 } 2423 2424 /** 2425 * Updates the designated column with a <code>String</code> value. 2426 * The <code>updateXXX</code> methods are used to update column values in the 2427 * current row or the insert row. The <code>updateXXX</code> methods do not 2428 * update the underlying database; instead the <code>updateRow</code> or 2429 * <code>insertRow</code> methods are called to update the database. 2430 * 2431 * @param columnIndex the first column is 1, the second is 2, and so on 2432 * @param x the new column value 2433 * @throws SQLException if a database access error occurs 2434 * or this rowset does not currently have a valid connection, 2435 * prepared statement, and result set 2436 * 2437 */ 2438 public void updateString(int columnIndex, String x) throws SQLException { 2439 checkState(); 2440 2441 // To check the type and concurrency of the ResultSet 2442 // to verify whether updates are possible or not 2443 checkTypeConcurrency(); 2444 2445 rs.updateString(columnIndex, x); 2446 } 2447 2448 /** 2449 * Updates the designated column with a <code>byte</code> array value. 2450 * The <code>updateXXX</code> methods are used to update column values in the 2451 * current row or the insert row. The <code>updateXXX</code> methods do not 2452 * update the underlying database; instead the <code>updateRow</code> or 2453 * <code>insertRow</code> methods are called to update the database. 2454 * 2455 * @param columnIndex the first column is 1, the second is 2, and so on 2456 * @param x the new column value 2457 * @throws SQLException if a database access error occurs 2458 * or this rowset does not currently have a valid connection, 2459 * prepared statement, and result set 2460 * 2461 */ 2462 public void updateBytes(int columnIndex, byte x[]) throws SQLException { 2463 checkState(); 2464 2465 // To check the type and concurrency of the ResultSet 2466 // to verify whether updates are possible or not 2467 checkTypeConcurrency(); 2468 2469 rs.updateBytes(columnIndex, x); 2470 } 2471 2472 /** 2473 * Updates the designated column with a <code>java.sql.Date</code> value. 2474 * The <code>updateXXX</code> methods are used to update column values in the 2475 * current row or the insert row. The <code>updateXXX</code> methods do not 2476 * update the underlying database; instead the <code>updateRow</code> or 2477 * <code>insertRow</code> methods are called to update the database. 2478 * 2479 * @param columnIndex the first column is 1, the second is 2, and so on 2480 * @param x the new column value 2481 * @throws SQLException if a database access error occurs 2482 * or this rowset does not currently have a valid connection, 2483 * prepared statement, and result set 2484 * 2485 */ 2486 public void updateDate(int columnIndex, java.sql.Date x) throws SQLException { 2487 checkState(); 2488 2489 // To check the type and concurrency of the ResultSet 2490 // to verify whether updates are possible or not 2491 checkTypeConcurrency(); 2492 2493 rs.updateDate(columnIndex, x); 2494 } 2495 2496 2497 /** 2498 * Updates the designated column with a <code>java.sql.Time</code> value. 2499 * The <code>updateXXX</code> methods are used to update column values in the 2500 * current row or the insert row. The <code>updateXXX</code> methods do not 2501 * update the underlying database; instead the <code>updateRow</code> or 2502 * <code>insertRow</code> methods are called to update the database. 2503 * 2504 * @param columnIndex the first column is 1, the second is 2, and so on 2505 * @param x the new column value 2506 * @throws SQLException if a database access error occurs 2507 * or this rowset does not currently have a valid connection, 2508 * prepared statement, and result set 2509 * 2510 */ 2511 public void updateTime(int columnIndex, java.sql.Time x) throws SQLException { 2512 checkState(); 2513 2514 // To check the type and concurrency of the ResultSet 2515 // to verify whether updates are possible or not 2516 checkTypeConcurrency(); 2517 2518 rs.updateTime(columnIndex, x); 2519 } 2520 2521 /** 2522 * Updates the designated column with a <code>java.sql.Timestamp</code> 2523 * value. 2524 * The <code>updateXXX</code> methods are used to update column values in the 2525 * current row or the insert row. The <code>updateXXX</code> methods do not 2526 * update the underlying database; instead the <code>updateRow</code> or 2527 * <code>insertRow</code> methods are called to update the database. 2528 * 2529 * @param columnIndex the first column is 1, the second is 2, and so on 2530 * @param x the new column value 2531 * @throws SQLException if a database access error occurs 2532 * or this rowset does not currently have a valid connection, 2533 * prepared statement, and result set 2534 * 2535 */ 2536 public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws SQLException { 2537 checkState(); 2538 2539 // To check the type and concurrency of the ResultSet 2540 // to verify whether updates are possible or not 2541 checkTypeConcurrency(); 2542 2543 rs.updateTimestamp(columnIndex, x); 2544 } 2545 2546 /** 2547 * Updates the designated column with an ascii stream value. 2548 * The <code>updateXXX</code> methods are used to update column values in the 2549 * current row or the insert row. The <code>updateXXX</code> methods do not 2550 * update the underlying database; instead the <code>updateRow</code> or 2551 * <code>insertRow</code> methods are called to update the database. 2552 * 2553 * @param columnIndex the first column is 1, the second is 2, and so on 2554 * @param x the new column value 2555 * @param length the length of the stream 2556 * @throws SQLException if (1) a database access error occurs 2557 * (2) or this rowset does not currently have a valid connection, 2558 * prepared statement, and result set 2559 * 2560 */ 2561 public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { 2562 checkState(); 2563 2564 // To check the type and concurrency of the ResultSet 2565 // to verify whether updates are possible or not 2566 checkTypeConcurrency(); 2567 2568 rs.updateAsciiStream(columnIndex, x, length); 2569 } 2570 2571 /** 2572 * Updates the designated column with a binary stream value. 2573 * The <code>updateXXX</code> methods are used to update column values in the 2574 * current row or the insert row. The <code>updateXXX</code> methods do not 2575 * update the underlying database; instead the <code>updateRow</code> or 2576 * <code>insertRow</code> methods are called to update the database. 2577 * 2578 * @param columnIndex the first column is 1, the second is 2, and so on 2579 * @param x the new column value 2580 * @param length the length of the stream 2581 * @throws SQLException if a database access error occurs 2582 * or this rowset does not currently have a valid connection, 2583 * prepared statement, and result set 2584 * 2585 */ 2586 public void updateBinaryStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { 2587 checkState(); 2588 2589 // To check the type and concurrency of the ResultSet 2590 // to verify whether updates are possible or not 2591 checkTypeConcurrency(); 2592 2593 rs.updateBinaryStream(columnIndex, x, length); 2594 } 2595 2596 /** 2597 * Updates the designated column with a character stream value. 2598 * The <code>updateXXX</code> methods are used to update column values in the 2599 * current row or the insert row. The <code>updateXXX</code> methods do not 2600 * update the underlying database; instead the <code>updateRow</code> or 2601 * <code>insertRow</code> methods are called to update the database. 2602 * 2603 * @param columnIndex the first column is 1, the second is 2, and so on 2604 * @param x the new column value 2605 * @param length the length of the stream 2606 * @throws SQLException if a database access error occurs 2607 * or this rowset does not currently have a valid connection, 2608 * prepared statement, and result set 2609 * 2610 */ 2611 public void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws SQLException { 2612 checkState(); 2613 2614 // To check the type and concurrency of the ResultSet 2615 // to verify whether updates are possible or not 2616 checkTypeConcurrency(); 2617 2618 rs.updateCharacterStream(columnIndex, x, length); 2619 } 2620 2621 /** 2622 * Updates the designated column with an <code>Object</code> value. 2623 * The <code>updateXXX</code> methods are used to update column values in the 2624 * current row or the insert row. The <code>updateXXX</code> methods do not 2625 * update the underlying database; instead the <code>updateRow</code> or 2626 * <code>insertRow</code> methods are called to update the database. 2627 * 2628 * @param columnIndex the first column is 1, the second is 2, and so on 2629 * @param x the new column value 2630 * @param scale for <code>java.sql.Types.DECIMAl</code> 2631 * or <code>java.sql.Types.NUMERIC</code> types, 2632 * this is the number of digits after the decimal point. For all other 2633 * types this value will be ignored. 2634 * @throws SQLException if a database access error occurs 2635 * or this rowset does not currently have a valid connection, 2636 * prepared statement, and result set 2637 * 2638 */ 2639 public void updateObject(int columnIndex, Object x, int scale) throws SQLException { 2640 checkState(); 2641 2642 // To check the type and concurrency of the ResultSet 2643 // to verify whether updates are possible or not 2644 checkTypeConcurrency(); 2645 2646 rs.updateObject(columnIndex, x, scale); 2647 } 2648 2649 /** 2650 * Updates the designated column with an <code>Object</code> value. 2651 * The <code>updateXXX</code> methods are used to update column values in the 2652 * current row or the insert row. The <code>updateXXX</code> methods do not 2653 * update the underlying database; instead the <code>updateRow</code> or 2654 * <code>insertRow</code> methods are called to update the database. 2655 * 2656 * @param columnIndex the first column is 1, the second is 2, and so on 2657 * @param x the new column value 2658 * @throws SQLException if a database access error occurs 2659 * or this rowset does not currently have a valid connection, 2660 * prepared statement, and result set 2661 * 2662 */ 2663 public void updateObject(int columnIndex, Object x) throws SQLException { 2664 checkState(); 2665 2666 // To check the type and concurrency of the ResultSet 2667 // to verify whether updates are possible or not 2668 checkTypeConcurrency(); 2669 2670 rs.updateObject(columnIndex, x); 2671 } 2672 2673 /** 2674 * Updates the designated column with a <code>null</code> value. 2675 * The <code>updateXXX</code> methods are used to update column values in the 2676 * current row or the insert row. The <code>updateXXX</code> methods do not 2677 * update the underlying database; instead the <code>updateRow</code> or 2678 * <code>insertRow</code> methods are called to update the database. 2679 * 2680 * @param columnName the name of the column 2681 * @throws SQLException if a database access error occurs 2682 * or this rowset does not currently have a valid connection, 2683 * prepared statement, and result set 2684 * 2685 */ 2686 public void updateNull(String columnName) throws SQLException { 2687 updateNull(findColumn(columnName)); 2688 } 2689 2690 /** 2691 * Updates the designated column with a <code>boolean</code> value. 2692 * The <code>updateXXX</code> methods are used to update column values in the 2693 * current row or the insert row. The <code>updateXXX</code> methods do not 2694 * update the underlying database; instead the <code>updateRow</code> or 2695 * <code>insertRow</code> methods are called to update the database. 2696 * 2697 * @param columnName the name of the column 2698 * @param x the new column value 2699 * @throws SQLException if a database access error occurs 2700 * 2701 */ 2702 public void updateBoolean(String columnName, boolean x) throws SQLException { 2703 updateBoolean(findColumn(columnName), x); 2704 } 2705 2706 /** 2707 * Updates the designated column with a <code>byte</code> value. 2708 * The <code>updateXXX</code> methods are used to update column values in the 2709 * current row or the insert row. The <code>updateXXX</code> methods do not 2710 * update the underlying database; instead the <code>updateRow</code> or 2711 * <code>insertRow</code> methods are called to update the database. 2712 * 2713 * @param columnName the name of the column 2714 * @param x the new column value 2715 * @throws SQLException if a database access error occurs 2716 * 2717 */ 2718 public void updateByte(String columnName, byte x) throws SQLException { 2719 updateByte(findColumn(columnName), x); 2720 } 2721 2722 /** 2723 * Updates the designated column with a <code>short</code> value. 2724 * The <code>updateXXX</code> methods are used to update column values in the 2725 * current row or the insert row. The <code>updateXXX</code> methods do not 2726 * update the underlying database; instead the <code>updateRow</code> or 2727 * <code>insertRow</code> methods are called to update the database. 2728 * 2729 * @param columnName the name of the column 2730 * @param x the new column value 2731 * @throws SQLException if a database access error occurs 2732 * 2733 */ 2734 public void updateShort(String columnName, short x) throws SQLException { 2735 updateShort(findColumn(columnName), x); 2736 } 2737 2738 /** 2739 * Updates the designated column with an <code>int</code> value. 2740 * The <code>updateXXX</code> methods are used to update column values in the 2741 * current row or the insert row. The <code>updateXXX</code> methods do not 2742 * update the underlying database; instead the <code>updateRow</code> or 2743 * <code>insertRow</code> methods are called to update the database. 2744 * 2745 * @param columnName the name of the column 2746 * @param x the new column value 2747 * @throws SQLException if a database access error occurs 2748 * 2749 */ 2750 public void updateInt(String columnName, int x) throws SQLException { 2751 updateInt(findColumn(columnName), x); 2752 } 2753 2754 /** 2755 * Updates the designated column with a <code>long</code> value. 2756 * The <code>updateXXX</code> methods are used to update column values in the 2757 * current row or the insert row. The <code>updateXXX</code> methods do not 2758 * update the underlying database; instead the <code>updateRow</code> or 2759 * <code>insertRow</code> methods are called to update the database. 2760 * 2761 * @param columnName the name of the column 2762 * @param x the new column value 2763 * @throws SQLException if a database access error occurs 2764 * 2765 */ 2766 public void updateLong(String columnName, long x) throws SQLException { 2767 updateLong(findColumn(columnName), x); 2768 } 2769 2770 /** 2771 * Updates the designated column with a <code>float </code> value. 2772 * The <code>updateXXX</code> methods are used to update column values in the 2773 * current row or the insert row. The <code>updateXXX</code> methods do not 2774 * update the underlying database; instead the <code>updateRow</code> or 2775 * <code>insertRow</code> methods are called to update the database. 2776 * 2777 * @param columnName the name of the column 2778 * @param x the new column value 2779 * @throws SQLException if a database access error occurs 2780 * 2781 */ 2782 public void updateFloat(String columnName, float x) throws SQLException { 2783 updateFloat(findColumn(columnName), x); 2784 } 2785 2786 /** 2787 * Updates the designated column with a <code>double</code> value. 2788 * The <code>updateXXX</code> methods are used to update column values in the 2789 * current row or the insert row. The <code>updateXXX</code> methods do not 2790 * update the underlying database; instead the <code>updateRow</code> or 2791 * <code>insertRow</code> methods are called to update the database. 2792 * 2793 * @param columnName the name of the column 2794 * @param x the new column value 2795 * @throws SQLException if a database access error occurs 2796 * 2797 */ 2798 public void updateDouble(String columnName, double x) throws SQLException { 2799 updateDouble(findColumn(columnName), x); 2800 } 2801 2802 /** 2803 * Updates the designated column with a <code>java.sql.BigDecimal</code> 2804 * value. 2805 * The <code>updateXXX</code> methods are used to update column values in the 2806 * current row or the insert row. The <code>updateXXX</code> methods do not 2807 * update the underlying database; instead the <code>updateRow</code> or 2808 * <code>insertRow</code> methods are called to update the database. 2809 * 2810 * @param columnName the name of the column 2811 * @param x the new column value 2812 * @throws SQLException if a database access error occurs 2813 * 2814 */ 2815 public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { 2816 updateBigDecimal(findColumn(columnName), x); 2817 } 2818 2819 /** 2820 * Updates the designated column with a <code>String</code> value. 2821 * The <code>updateXXX</code> methods are used to update column values in the 2822 * current row or the insert row. The <code>updateXXX</code> methods do not 2823 * update the underlying database; instead the <code>updateRow</code> or 2824 * <code>insertRow</code> methods are called to update the database. 2825 * 2826 * @param columnName the name of the column 2827 * @param x the new column value 2828 * @throws SQLException if a database access error occurs 2829 * 2830 */ 2831 public void updateString(String columnName, String x) throws SQLException { 2832 updateString(findColumn(columnName), x); 2833 } 2834 2835 /** 2836 * Updates the designated column with a <code>boolean</code> value. 2837 * The <code>updateXXX</code> methods are used to update column values in the 2838 * current row or the insert row. The <code>updateXXX</code> methods do not 2839 * update the underlying database; instead the <code>updateRow</code> or 2840 * <code>insertRow</code> methods are called to update the database. 2841 * 2842 * JDBC 2.0 2843 * 2844 * Updates a column with a byte array value. 2845 * 2846 * The <code>updateXXX</code> methods are used to update column values in the 2847 * current row, or the insert row. The <code>updateXXX</code> methods do not 2848 * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> 2849 * methods are called to update the database. 2850 * 2851 * @param columnName the name of the column 2852 * @param x the new column value 2853 * @throws SQLException if a database access error occurs 2854 * 2855 */ 2856 public void updateBytes(String columnName, byte x[]) throws SQLException { 2857 updateBytes(findColumn(columnName), x); 2858 } 2859 2860 /** 2861 * Updates the designated column with a <code>java.sql.Date</code> value. 2862 * The <code>updateXXX</code> methods are used to update column values in the 2863 * current row or the insert row. The <code>updateXXX</code> methods do not 2864 * update the underlying database; instead the <code>updateRow</code> or 2865 * <code>insertRow</code> methods are called to update the database. 2866 * 2867 * @param columnName the name of the column 2868 * @param x the new column value 2869 * @throws SQLException if a database access error occurs 2870 * 2871 */ 2872 public void updateDate(String columnName, java.sql.Date x) throws SQLException { 2873 updateDate(findColumn(columnName), x); 2874 } 2875 2876 /** 2877 * Updates the designated column with a <code>java.sql.Time</code> value. 2878 * The <code>updateXXX</code> methods are used to update column values in the 2879 * current row or the insert row. The <code>updateXXX</code> methods do not 2880 * update the underlying database; instead the <code>updateRow</code> or 2881 * <code>insertRow</code> methods are called to update the database. 2882 * 2883 * @param columnName the name of the column 2884 * @param x the new column value 2885 * @throws SQLException if a database access error occurs 2886 * 2887 */ 2888 public void updateTime(String columnName, java.sql.Time x) throws SQLException { 2889 updateTime(findColumn(columnName), x); 2890 } 2891 2892 /** 2893 * Updates the designated column with a <code>java.sql.Timestamp</code> 2894 * value. 2895 * The <code>updateXXX</code> methods are used to update column values in the 2896 * current row or the insert row. The <code>updateXXX</code> methods do not 2897 * update the underlying database; instead the <code>updateRow</code> or 2898 * <code>insertRow</code> methods are called to update the database. 2899 * 2900 * @param columnName the name of the column 2901 * @param x the new column value 2902 * @throws SQLException if a database access error occurs 2903 * 2904 */ 2905 public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException { 2906 updateTimestamp(findColumn(columnName), x); 2907 } 2908 2909 /** 2910 * Updates the designated column with an ascii stream value. 2911 * The <code>updateXXX</code> methods are used to update column values in the 2912 * current row or the insert row. The <code>updateXXX</code> methods do not 2913 * update the underlying database; instead the <code>updateRow</code> or 2914 * <code>insertRow</code> methods are called to update the database. 2915 * 2916 * @param columnName the name of the column 2917 * @param x the new column value 2918 * @param length the length of the stream 2919 * @throws SQLException if a database access error occurs 2920 * 2921 */ 2922 public void updateAsciiStream(String columnName, java.io.InputStream x, int length) throws SQLException { 2923 updateAsciiStream(findColumn(columnName), x, length); 2924 } 2925 2926 /** 2927 * Updates the designated column with a binary stream value. 2928 * The <code>updateXXX</code> methods are used to update column values in the 2929 * current row or the insert row. The <code>updateXXX</code> methods do not 2930 * update the underlying database; instead the <code>updateRow</code> or 2931 * <code>insertRow</code> methods are called to update the database. 2932 * 2933 * @param columnName the name of the column 2934 * @param x the new column value 2935 * @param length the length of the stream 2936 * @throws SQLException if a database access error occurs 2937 * 2938 */ 2939 public void updateBinaryStream(String columnName, java.io.InputStream x, int length) throws SQLException { 2940 updateBinaryStream(findColumn(columnName), x, length); 2941 } 2942 2943 /** 2944 * Updates the designated column with a character stream value. 2945 * The <code>updateXXX</code> methods are used to update column values 2946 * in the current row or the insert row. The <code>updateXXX</code> 2947 * methods do not update the underlying database; instead the 2948 * <code>updateRow</code> or <code>insertRow</code> methods are called 2949 * to update the database. 2950 * 2951 * @param columnName the name of the column 2952 * @param reader the new column <code>Reader</code> stream value 2953 * @param length the length of the stream 2954 * @throws SQLException if a database access error occurs 2955 * 2956 */ 2957 public void updateCharacterStream(String columnName, java.io.Reader reader, int length) throws SQLException { 2958 updateCharacterStream(findColumn(columnName), reader, length); 2959 } 2960 2961 /** 2962 * Updates the designated column with an <code>Object</code> value. 2963 * The <code>updateXXX</code> methods are used to update column values in the 2964 * current row or the insert row. The <code>updateXXX</code> methods do not 2965 * update the underlying database; instead the <code>updateRow</code> or 2966 * <code>insertRow</code> methods are called to update the database. 2967 * 2968 * @param columnName the name of the column 2969 * @param x the new column value 2970 * @param scale for <code>java.sql.Types.DECIMAL</code> 2971 * or <code>java.sql.Types.NUMERIC</code> types, 2972 * this is the number of digits after the decimal point. For all other 2973 * types this value will be ignored. 2974 * @throws SQLException if a database access error occurs 2975 * 2976 */ 2977 public void updateObject(String columnName, Object x, int scale) throws SQLException { 2978 updateObject(findColumn(columnName), x, scale); 2979 } 2980 2981 /** 2982 * Updates the designated column with an <code>Object</code> value. 2983 * The <code>updateXXX</code> methods are used to update column values in the 2984 * current row or the insert row. The <code>updateXXX</code> methods do not 2985 * update the underlying database; instead the <code>updateRow</code> or 2986 * <code>insertRow</code> methods are called to update the database. 2987 * 2988 * @param columnName the name of the column 2989 * @param x the new column value 2990 * @throws SQLException if a database access error occurs 2991 * 2992 */ 2993 public void updateObject(String columnName, Object x) throws SQLException { 2994 updateObject(findColumn(columnName), x); 2995 } 2996 2997 /** 2998 * Inserts the contents of the insert row into this 2999 * <code>ResultSet</code> object and into the database 3000 * and also notifies listeners that a row has changed. 3001 * The cursor must be on the insert row when this method is called. 3002 * 3003 * @throws SQLException if (1) a database access error occurs, 3004 * (2) this method is called when the cursor is not 3005 * on the insert row, (3) not all non-nullable columns in 3006 * the insert row have been given a value, or (4) this 3007 * rowset does not currently have a valid connection, 3008 * prepared statement, and result set 3009 */ 3010 public void insertRow() throws SQLException { 3011 checkState(); 3012 3013 rs.insertRow(); 3014 notifyRowChanged(); 3015 } 3016 3017 /** 3018 * Updates the underlying database with the new contents of the 3019 * current row of this rowset's <code>ResultSet</code> object 3020 * and notifies listeners that a row has changed. 3021 * This method cannot be called when the cursor is on the insert row. 3022 * 3023 * @throws SQLException if (1) a database access error occurs, 3024 * (2) this method is called when the cursor is 3025 * on the insert row, (3) the concurrency of the result 3026 * set is <code>ResultSet.CONCUR_READ_ONLY</code>, or 3027 * (4) this rowset does not currently have a valid connection, 3028 * prepared statement, and result set 3029 */ 3030 public void updateRow() throws SQLException { 3031 checkState(); 3032 3033 rs.updateRow(); 3034 notifyRowChanged(); 3035 } 3036 3037 /** 3038 * Deletes the current row from this rowset's <code>ResultSet</code> object 3039 * and from the underlying database and also notifies listeners that a row 3040 * has changed. This method cannot be called when the cursor is on the insert 3041 * row. 3042 * 3043 * @throws SQLException if a database access error occurs 3044 * or if this method is called when the cursor is on the insert row 3045 * @throws SQLException if (1) a database access error occurs, 3046 * (2) this method is called when the cursor is before the 3047 * first row, after the last row, or on the insert row, 3048 * (3) the concurrency of this rowset's result 3049 * set is <code>ResultSet.CONCUR_READ_ONLY</code>, or 3050 * (4) this rowset does not currently have a valid connection, 3051 * prepared statement, and result set 3052 */ 3053 public void deleteRow() throws SQLException { 3054 checkState(); 3055 3056 rs.deleteRow(); 3057 notifyRowChanged(); 3058 } 3059 3060 /** 3061 * Refreshes the current row of this rowset's <code>ResultSet</code> 3062 * object with its most recent value in the database. This method 3063 * cannot be called when the cursor is on the insert row. 3064 * 3065 * <P>The <code>refreshRow</code> method provides a way for an 3066 * application to explicitly tell the JDBC driver to refetch 3067 * a row(s) from the database. An application may want to call 3068 * <code>refreshRow</code> when caching or prefetching is being 3069 * done by the JDBC driver to fetch the latest value of a row 3070 * from the database. The JDBC driver may actually refresh multiple 3071 * rows at once if the fetch size is greater than one. 3072 * 3073 * <P> All values are refetched subject to the transaction isolation 3074 * level and cursor sensitivity. If <code>refreshRow</code> is called after 3075 * calling an <code>updateXXX</code> method, but before calling 3076 * the method <code>updateRow</code>, then the 3077 * updates made to the row are lost. Calling the method 3078 * <code>refreshRow</code> frequently will likely slow performance. 3079 * 3080 * @throws SQLException if (1) a database access error occurs, 3081 * (2) this method is called when the cursor is 3082 * on the insert row, or (3) this rowset does not 3083 * currently have a valid connection, prepared statement, 3084 * and result set 3085 * 3086 */ 3087 public void refreshRow() throws SQLException { 3088 checkState(); 3089 3090 rs.refreshRow(); 3091 } 3092 3093 /** 3094 * Cancels the updates made to the current row in this 3095 * <code>ResultSet</code> object and notifies listeners that a row 3096 * has changed. This method may be called after calling an 3097 * <code>updateXXX</code> method(s) and before calling 3098 * the method <code>updateRow</code> to roll back 3099 * the updates made to a row. If no updates have been made or 3100 * <code>updateRow</code> has already been called, this method has no 3101 * effect. 3102 * 3103 * @throws SQLException if (1) a database access error occurs, 3104 * (2) this method is called when the cursor is 3105 * on the insert row, or (3) this rowset does not 3106 * currently have a valid connection, prepared statement, 3107 * and result set 3108 */ 3109 public void cancelRowUpdates() throws SQLException { 3110 checkState(); 3111 3112 rs.cancelRowUpdates(); 3113 3114 notifyRowChanged(); 3115 } 3116 3117 /** 3118 * Moves the cursor to the insert row. The current cursor position is 3119 * remembered while the cursor is positioned on the insert row. 3120 * 3121 * The insert row is a special row associated with an updatable 3122 * result set. It is essentially a buffer where a new row may 3123 * be constructed by calling the <code>updateXXX</code> methods prior to 3124 * inserting the row into the result set. 3125 * 3126 * Only the <code>updateXXX</code>, <code>getXXX</code>, 3127 * and <code>insertRow</code> methods may be 3128 * called when the cursor is on the insert row. All of the columns in 3129 * a result set must be given a value each time this method is 3130 * called before calling <code>insertRow</code>. 3131 * An <code>updateXXX</code> method must be called before a 3132 * <code>getXXX</code> method can be called on a column value. 3133 * 3134 * @throws SQLException if (1) a database access error occurs, 3135 * (2) this rowset's <code>ResultSet</code> object is 3136 * not updatable, or (3) this rowset does not 3137 * currently have a valid connection, prepared statement, 3138 * and result set 3139 * 3140 */ 3141 public void moveToInsertRow() throws SQLException { 3142 checkState(); 3143 3144 rs.moveToInsertRow(); 3145 } 3146 3147 /** 3148 * Moves the cursor to the remembered cursor position, usually the 3149 * current row. This method has no effect if the cursor is not on 3150 * the insert row. 3151 * 3152 * @throws SQLException if (1) a database access error occurs, 3153 * (2) this rowset's <code>ResultSet</code> object is 3154 * not updatable, or (3) this rowset does not 3155 * currently have a valid connection, prepared statement, 3156 * and result set 3157 */ 3158 public void moveToCurrentRow() throws SQLException { 3159 checkState(); 3160 3161 rs.moveToCurrentRow(); 3162 } 3163 3164 /** 3165 * Returns the <code>Statement</code> object that produced this 3166 * <code>ResultSet</code> object. 3167 * If the result set was generated some other way, such as by a 3168 * <code>DatabaseMetaData</code> method, this method returns 3169 * <code>null</code>. 3170 * 3171 * @return the <code>Statment</code> object that produced 3172 * this rowset's <code>ResultSet</code> object or <code>null</code> 3173 * if the result set was produced some other way 3174 * @throws SQLException if a database access error occurs 3175 */ 3176 public java.sql.Statement getStatement() throws SQLException { 3177 3178 if(rs != null) 3179 { 3180 return rs.getStatement(); 3181 } else { 3182 return null; 3183 } 3184 } 3185 3186 /** 3187 * Returns the value of the designated column in the current row 3188 * of this rowset's <code>ResultSet</code> object as an <code>Object</code>. 3189 * This method uses the given <code>Map</code> object 3190 * for the custom mapping of the 3191 * SQL structured or distinct type that is being retrieved. 3192 * 3193 * @param i the first column is 1, the second is 2, and so on 3194 * @param map a <code>java.util.Map</code> object that contains the mapping 3195 * from SQL type names to classes in the Java programming language 3196 * @return an <code>Object</code> in the Java programming language 3197 * representing the SQL value 3198 * @throws SQLException if (1) a database access error occurs 3199 * or (2) this rowset does not currently have a valid connection, 3200 * prepared statement, and result set 3201 */ 3202 public Object getObject(int i, java.util.Map<String,Class<?>> map) 3203 throws SQLException 3204 { 3205 checkState(); 3206 3207 return rs.getObject(i, map); 3208 } 3209 3210 /** 3211 * Returns the value of the designated column in the current row 3212 * of this rowset's <code>ResultSet</code> object as a <code>Ref</code> object. 3213 * 3214 * @param i the first column is 1, the second is 2, and so on 3215 * @return a <code>Ref</code> object representing an SQL <code>REF</code> value 3216 * @throws SQLException if (1) a database access error occurs 3217 * or (2) this rowset does not currently have a valid connection, 3218 * prepared statement, and result set 3219 */ 3220 public Ref getRef(int i) throws SQLException { 3221 checkState(); 3222 3223 return rs.getRef(i); 3224 } 3225 3226 3227 /** 3228 * Returns the value of the designated column in the current row 3229 * of this rowset's <code>ResultSet</code> object as a <code>Blob</code> object. 3230 * 3231 * @param i the first column is 1, the second is 2, and so on 3232 * @return a <code>Blob</code> object representing the SQL <code>BLOB</code> 3233 * value in the specified column 3234 * @throws SQLException if (1) a database access error occurs 3235 * or (2) this rowset does not currently have a valid connection, 3236 * prepared statement, and result set 3237 */ 3238 public Blob getBlob(int i) throws SQLException { 3239 checkState(); 3240 3241 return rs.getBlob(i); 3242 } 3243 3244 /** 3245 * Returns the value of the designated column in the current row 3246 * of this rowset's <code>ResultSet</code> object as a <code>Clob</code> object. 3247 * 3248 * @param i the first column is 1, the second is 2, and so on 3249 * @return a <code>Clob</code> object representing the SQL <code>CLOB</code> 3250 * value in the specified column 3251 * @throws SQLException if (1) a database access error occurs 3252 * or (2) this rowset does not currently have a valid connection, 3253 * prepared statement, and result set 3254 */ 3255 public Clob getClob(int i) throws SQLException { 3256 checkState(); 3257 3258 return rs.getClob(i); 3259 } 3260 3261 /** 3262 * Returns the value of the designated column in the current row 3263 * of this rowset's <code>ResultSet</code> object as an <code>Array</code> object. 3264 * 3265 * @param i the first column is 1, the second is 2, and so on. 3266 * @return an <code>Array</code> object representing the SQL <code>ARRAY</code> 3267 * value in the specified column 3268 * @throws SQLException if (1) a database access error occurs 3269 * or (2) this rowset does not currently have a valid connection, 3270 * prepared statement, and result set 3271 */ 3272 public Array getArray(int i) throws SQLException { 3273 checkState(); 3274 3275 return rs.getArray(i); 3276 } 3277 3278 /** 3279 * Returns the value of the designated column in the current row 3280 * of this rowset's <code>ResultSet</code> object as an <code>Object</code>. 3281 * This method uses the specified <code>Map</code> object for 3282 * custom mapping if appropriate. 3283 * 3284 * @param colName the name of the column from which to retrieve the value 3285 * @param map a <code>java.util.Map</code> object that contains the mapping 3286 * from SQL type names to classes in the Java programming language 3287 * @return an <code>Object</code> representing the SQL 3288 * value in the specified column 3289 * @throws SQLException if (1) a database access error occurs 3290 * or (2) this rowset does not currently have a valid connection, 3291 * prepared statement, and result set 3292 */ 3293 public Object getObject(String colName, java.util.Map<String,Class<?>> map) 3294 throws SQLException 3295 { 3296 return getObject(findColumn(colName), map); 3297 } 3298 3299 /** 3300 * Returns the value of the designated column in the current row 3301 * of this rowset's <code>ResultSet</code> object as a <code>Ref</code> object. 3302 * 3303 * @param colName the column name 3304 * @return a <code>Ref</code> object representing the SQL <code>REF</code> value in 3305 * the specified column 3306 * @throws SQLException if (1) a database access error occurs 3307 * or (2) this rowset does not currently have a valid connection, 3308 * prepared statement, and result set 3309 */ 3310 public Ref getRef(String colName) throws SQLException { 3311 return getRef(findColumn(colName)); 3312 } 3313 3314 /** 3315 * Returns the value of the designated column in the current row 3316 * of this rowset's <code>ResultSet</code> object as a <code>Blob</code> object. 3317 * 3318 * @param colName the name of the column from which to retrieve the value 3319 * @return a <code>Blob</code> object representing the SQL <code>BLOB</code> 3320 * value in the specified column 3321 * @throws SQLException if (1) a database access error occurs 3322 * or (2) this rowset does not currently have a valid connection, 3323 * prepared statement, and result set 3324 */ 3325 public Blob getBlob(String colName) throws SQLException { 3326 return getBlob(findColumn(colName)); 3327 } 3328 3329 /** 3330 * Returns the value of the designated column in the current row 3331 * of this rowset's <code>ResultSet</code> object as a <code>Clob</code> object. 3332 * 3333 * @param colName the name of the column from which to retrieve the value 3334 * @return a <code>Clob</code> object representing the SQL <code>CLOB</code> 3335 * value in the specified column 3336 * @throws SQLException if (1) a database access error occurs 3337 * or (2) this rowset does not currently have a valid connection, 3338 * prepared statement, and result set 3339 */ 3340 public Clob getClob(String colName) throws SQLException { 3341 return getClob(findColumn(colName)); 3342 } 3343 3344 /** 3345 * Returns the value of the designated column in the current row 3346 * of this rowset's <code>ResultSet</code> object as an <code>Array</code> object. 3347 * 3348 * @param colName the name of the column from which to retrieve the value 3349 * @return an <code>Array</code> object representing the SQL <code>ARRAY</code> 3350 * value in the specified column 3351 * @throws SQLException if (1) a database access error occurs 3352 * or (2) this rowset does not currently have a valid connection, 3353 * prepared statement, and result set 3354 */ 3355 public Array getArray(String colName) throws SQLException { 3356 return getArray(findColumn(colName)); 3357 } 3358 3359 /** 3360 * Returns the value of the designated column in the current row 3361 * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Date</code> 3362 * object. This method uses the given calendar to construct an appropriate 3363 * millisecond value for the date if the underlying database does not store 3364 * timezone information. 3365 * 3366 * @param columnIndex the first column is 1, the second is 2, and so on 3367 * @param cal the <code>java.util.Calendar</code> object 3368 * to use in constructing the date 3369 * @return the column value as a <code>java.sql.Date</code> object; 3370 * if the value is SQL <code>NULL</code>, 3371 * the value returned is <code>null</code> 3372 * @throws SQLException if (1) a database access error occurs 3373 * or (2) this rowset does not currently have a valid connection, 3374 * prepared statement, and result set 3375 */ 3376 public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException { 3377 checkState(); 3378 3379 return rs.getDate(columnIndex, cal); 3380 } 3381 3382 /** 3383 * Returns the value of the designated column in the current row 3384 * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Date</code> 3385 * object. This method uses the given calendar to construct an appropriate 3386 * millisecond value for the date if the underlying database does not store 3387 * timezone information. 3388 * 3389 * @param columnName the SQL name of the column from which to retrieve the value 3390 * @param cal the <code>java.util.Calendar</code> object 3391 * to use in constructing the date 3392 * @return the column value as a <code>java.sql.Date</code> object; 3393 * if the value is SQL <code>NULL</code>, 3394 * the value returned is <code>null</code> 3395 * @throws SQLException if a database access error occurs 3396 * or this rowset does not currently have a valid connection, 3397 * prepared statement, and result set 3398 * 3399 */ 3400 public java.sql.Date getDate(String columnName, Calendar cal) throws SQLException { 3401 return getDate(findColumn(columnName), cal); 3402 } 3403 3404 /** 3405 * Returns the value of the designated column in the current row 3406 * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Time</code> 3407 * object. This method uses the given calendar to construct an appropriate 3408 * millisecond value for the date if the underlying database does not store 3409 * timezone information. 3410 * 3411 * @param columnIndex the first column is 1, the second is 2, and so on 3412 * @param cal the <code>java.util.Calendar</code> object 3413 * to use in constructing the time 3414 * @return the column value as a <code>java.sql.Time</code> object; 3415 * if the value is SQL <code>NULL</code>, 3416 * the value returned is <code>null</code> in the Java programming language 3417 * @throws SQLException if a database access error occurs 3418 * or this rowset does not currently have a valid connection, 3419 * prepared statement, and result set 3420 */ 3421 public java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException { 3422 checkState(); 3423 3424 return rs.getTime(columnIndex, cal); 3425 } 3426 3427 /** 3428 * Returns the value of the designated column in the current row 3429 * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Time</code> 3430 * object. This method uses the given calendar to construct an appropriate 3431 * millisecond value for the date if the underlying database does not store 3432 * timezone information. 3433 * 3434 * @param columnName the SQL name of the column 3435 * @param cal the <code>java.util.Calendar</code> object 3436 * to use in constructing the time 3437 * @return the column value as a <code>java.sql.Time</code> object; 3438 * if the value is SQL <code>NULL</code>, 3439 * the value returned is <code>null</code> in the Java programming language 3440 * @throws SQLException if a database access error occurs 3441 * or this rowset does not currently have a valid connection, 3442 * prepared statement, and result set 3443 */ 3444 public java.sql.Time getTime(String columnName, Calendar cal) throws SQLException { 3445 return getTime(findColumn(columnName), cal); 3446 } 3447 3448 /** 3449 * Returns the value of the designated column in the current row 3450 * of this rowset's <code>ResultSet</code> object as a 3451 * <code>java.sql.Timestamp</code> object. 3452 * This method uses the given calendar to construct an appropriate millisecond 3453 * value for the timestamp if the underlying database does not store 3454 * timezone information. 3455 * 3456 * @param columnIndex the first column is 1, the second is 2, and so on 3457 * @param cal the <code>java.util.Calendar</code> object 3458 * to use in constructing the timestamp 3459 * @return the column value as a <code>java.sql.Timestamp</code> object; 3460 * if the value is SQL <code>NULL</code>, 3461 * the value returned is <code>null</code> 3462 * @throws SQLException if a database access error occurs 3463 * or this rowset does not currently have a valid connection, 3464 * prepared statement, and result set 3465 */ 3466 public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { 3467 checkState(); 3468 3469 return rs.getTimestamp(columnIndex, cal); 3470 } 3471 3472 /** 3473 * Returns the value of the designated column in the current row 3474 * of this rowset's <code>ResultSet</code> object as a 3475 * <code>java.sql.Timestamp</code> object. 3476 * This method uses the given calendar to construct an appropriate millisecond 3477 * value for the timestamp if the underlying database does not store 3478 * timezone information. 3479 * 3480 * @param columnName the SQL name of the column 3481 * @param cal the <code>java.util.Calendar</code> object 3482 * to use in constructing the timestamp 3483 * @return the column value as a <code>java.sql.Timestamp</code> object; 3484 * if the value is SQL <code>NULL</code>, 3485 * the value returned is <code>null</code> 3486 * @throws SQLException if a database access error occurs 3487 * or this rowset does not currently have a valid connection, 3488 * prepared statement, and result set 3489 */ 3490 public java.sql.Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException { 3491 return getTimestamp(findColumn(columnName), cal); 3492 } 3493 3494 3495 /** 3496 * Sets the designated column in either the current row or the insert 3497 * row of this <code>JdbcRowSetImpl</code> object with the given 3498 * <code>double</code> value. 3499 * 3500 * This method updates a column value in either the current row or 3501 * the insert row of this rowset, but it does not update the 3502 * database. If the cursor is on a row in the rowset, the 3503 * method {@link #updateRow} must be called to update the database. 3504 * If the cursor is on the insert row, the method {@link #insertRow} 3505 * must be called, which will insert the new row into both this rowset 3506 * and the database. Both of these methods must be called before the 3507 * cursor moves to another row. 3508 * 3509 * @param columnIndex the first column is <code>1</code>, the second 3510 * is <code>2</code>, and so on; must be <code>1</code> or larger 3511 * and equal to or less than the number of columns in this rowset 3512 * @param ref the new <code>Ref</code> column value 3513 * @throws SQLException if (1) the given column index is out of bounds, 3514 * (2) the cursor is not on one of this rowset's rows or its 3515 * insert row, or (3) this rowset is 3516 * <code>ResultSet.CONCUR_READ_ONLY</code> 3517 */ 3518 public void updateRef(int columnIndex, java.sql.Ref ref) 3519 throws SQLException { 3520 checkState(); 3521 rs.updateRef(columnIndex, ref); 3522 } 3523 3524 /** 3525 * Sets the designated column in either the current row or the insert 3526 * row of this <code>JdbcRowSetImpl</code> object with the given 3527 * <code>double</code> value. 3528 * 3529 * This method updates a column value in either the current row or 3530 * the insert row of this rowset, but it does not update the 3531 * database. If the cursor is on a row in the rowset, the 3532 * method {@link #updateRow} must be called to update the database. 3533 * If the cursor is on the insert row, the method {@link #insertRow} 3534 * must be called, which will insert the new row into both this rowset 3535 * and the database. Both of these methods must be called before the 3536 * cursor moves to another row. 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 * @param ref the new column value 3541 * @throws SQLException if (1) the given column name does not match the 3542 * name of a column in this rowset, (2) the cursor is not on 3543 * one of this rowset's rows or its insert row, or (3) this 3544 * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> 3545 */ 3546 public void updateRef(String columnName, java.sql.Ref ref) 3547 throws SQLException { 3548 updateRef(findColumn(columnName), ref); 3549 } 3550 3551 /** 3552 * Sets the designated column in either the current row or the insert 3553 * row of this <code>JdbcRowSetImpl</code> object with the given 3554 * <code>double</code> value. 3555 * 3556 * This method updates a column value in either the current row or 3557 * the insert row of this rowset, but it does not update the 3558 * database. If the cursor is on a row in the rowset, the 3559 * method {@link #updateRow} must be called to update the database. 3560 * If the cursor is on the insert row, the method {@link #insertRow} 3561 * must be called, which will insert the new row into both this rowset 3562 * and the database. Both of these methods must be called before the 3563 * cursor moves to another row. 3564 * 3565 * @param columnIndex the first column is <code>1</code>, the second 3566 * is <code>2</code>, and so on; must be <code>1</code> or larger 3567 * and equal to or less than the number of columns in this rowset 3568 * @param c the new column <code>Clob</code> value 3569 * @throws SQLException if (1) the given column index is out of bounds, 3570 * (2) the cursor is not on one of this rowset's rows or its 3571 * insert row, or (3) this rowset is 3572 * <code>ResultSet.CONCUR_READ_ONLY</code> 3573 */ 3574 public void updateClob(int columnIndex, Clob c) throws SQLException { 3575 checkState(); 3576 rs.updateClob(columnIndex, c); 3577 } 3578 3579 3580 /** 3581 * Sets the designated column in either the current row or the insert 3582 * row of this <code>JdbcRowSetImpl</code> object with the given 3583 * <code>double</code> value. 3584 * 3585 * This method updates a column value in either the current row or 3586 * the insert row of this rowset, but it does not update the 3587 * database. If the cursor is on a row in the rowset, the 3588 * method {@link #updateRow} must be called to update the database. 3589 * If the cursor is on the insert row, the method {@link #insertRow} 3590 * must be called, which will insert the new row into both this rowset 3591 * and the database. Both of these methods must be called before the 3592 * cursor moves to another row. 3593 * 3594 * @param columnName a <code>String</code> object that must match the 3595 * SQL name of a column in this rowset, ignoring case 3596 * @param c the new column <code>Clob</code> value 3597 * @throws SQLException if (1) the given column name does not match the 3598 * name of a column in this rowset, (2) the cursor is not on 3599 * one of this rowset's rows or its insert row, or (3) this 3600 * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> 3601 */ 3602 public void updateClob(String columnName, Clob c) throws SQLException { 3603 updateClob(findColumn(columnName), c); 3604 } 3605 3606 /** 3607 * Sets the designated column in either the current row or the insert 3608 * row of this <code>JdbcRowSetImpl</code> object with the given 3609 * <code>java.sql.Blob</code> value. 3610 * 3611 * This method updates a column value in either the current row or 3612 * the insert row of this rowset, but it does not update the 3613 * database. If the cursor is on a row in the rowset, the 3614 * method {@link #updateRow} must be called to update the database. 3615 * If the cursor is on the insert row, the method {@link #insertRow} 3616 * must be called, which will insert the new row into both this rowset 3617 * and the database. Both of these methods must be called before the 3618 * cursor moves to another row. 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 this rowset 3623 * @param b the new column <code>Blob</code> value 3624 * @throws SQLException if (1) the given column index is out of bounds, 3625 * (2) the cursor is not on one of this rowset's rows or its 3626 * insert row, or (3) this rowset is 3627 * <code>ResultSet.CONCUR_READ_ONLY</code> 3628 */ 3629 public void updateBlob(int columnIndex, Blob b) throws SQLException { 3630 checkState(); 3631 rs.updateBlob(columnIndex, b); 3632 } 3633 3634 /** 3635 * Sets the designated column in either the current row or the insert 3636 * row of this <code>JdbcRowSetImpl</code> object with the given 3637 * <code>java.sql.Blob </code> value. 3638 * 3639 * This method updates a column value in either the current row or 3640 * the insert row of this rowset, but it does not update the 3641 * database. If the cursor is on a row in the rowset, the 3642 * method {@link #updateRow} must be called to update the database. 3643 * If the cursor is on the insert row, the method {@link #insertRow} 3644 * must be called, which will insert the new row into both this rowset 3645 * and the database. Both of these methods must be called before the 3646 * cursor moves to another row. 3647 * 3648 * @param columnName a <code>String</code> object that must match the 3649 * SQL name of a column in this rowset, ignoring case 3650 * @param b the new column <code>Blob</code> value 3651 * @throws SQLException if (1) the given column name does not match the 3652 * name of a column in this rowset, (2) the cursor is not on 3653 * one of this rowset's rows or its insert row, or (3) this 3654 * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> 3655 */ 3656 public void updateBlob(String columnName, Blob b) throws SQLException { 3657 updateBlob(findColumn(columnName), b); 3658 } 3659 3660 /** 3661 * Sets the designated column in either the current row or the insert 3662 * row of this <code>JdbcRowSetImpl</code> object with the given 3663 * <code>java.sql.Array</code> values. 3664 * 3665 * This method updates a column value in either the current row or 3666 * the insert row of this rowset, but it does not update the 3667 * database. If the cursor is on a row in the rowset, the 3668 * method {@link #updateRow} must be called to update the database. 3669 * If the cursor is on the insert row, the method {@link #insertRow} 3670 * must be called, which will insert the new row into both this rowset 3671 * and the database. Both of these methods must be called before the 3672 * cursor moves to another row. 3673 * 3674 * @param columnIndex the first column is <code>1</code>, the second 3675 * is <code>2</code>, and so on; must be <code>1</code> or larger 3676 * and equal to or less than the number of columns in this rowset 3677 * @param a the new column <code>Array</code> value 3678 * @throws SQLException if (1) the given column index is out of bounds, 3679 * (2) the cursor is not on one of this rowset's rows or its 3680 * insert row, or (3) this rowset is 3681 * <code>ResultSet.CONCUR_READ_ONLY</code> 3682 */ 3683 public void updateArray(int columnIndex, Array a) throws SQLException { 3684 checkState(); 3685 rs.updateArray(columnIndex, a); 3686 } 3687 3688 /** 3689 * Sets the designated column in either the current row or the insert 3690 * row of this <code>JdbcRowSetImpl</code> object with the given 3691 * <code>java.sql.Array</code> value. 3692 * 3693 * This method updates a column value in either the current row or 3694 * the insert row of this rowset, but it does not update the 3695 * database. If the cursor is on a row in the rowset, the 3696 * method {@link #updateRow} must be called to update the database. 3697 * If the cursor is on the insert row, the method {@link #insertRow} 3698 * must be called, which will insert the new row into both this rowset 3699 * and the database. Both of these methods must be called before the 3700 * cursor moves to another row. 3701 * 3702 * @param columnName a <code>String</code> object that must match the 3703 * SQL name of a column in this rowset, ignoring case 3704 * @param a the new column <code>Array</code> value 3705 * @throws SQLException if (1) the given column name does not match the 3706 * name of a column in this rowset, (2) the cursor is not on 3707 * one of this rowset's rows or its insert row, or (3) this 3708 * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> 3709 */ 3710 public void updateArray(String columnName, Array a) throws SQLException { 3711 updateArray(findColumn(columnName), a); 3712 } 3713 3714 /** 3715 * Provide interface coverage for getURL(int) in ResultSet->RowSet 3716 */ 3717 public java.net.URL getURL(int columnIndex) throws SQLException { 3718 checkState(); 3719 return rs.getURL(columnIndex); 3720 } 3721 3722 /** 3723 * Provide interface coverage for getURL(String) in ResultSet->RowSet 3724 */ 3725 public java.net.URL getURL(String columnName) throws SQLException { 3726 return getURL(findColumn(columnName)); 3727 } 3728 3729 /** 3730 * Return the RowSetWarning object for the current row of a 3731 * <code>JdbcRowSetImpl</code> 3732 */ 3733 public RowSetWarning getRowSetWarnings() throws SQLException { 3734 return null; 3735 } 3736 /** 3737 * Unsets the designated parameter to the given int array. 3738 * This was set using <code>setMatchColumn</code> 3739 * as the column which will form the basis of the join. 3740 * <P> 3741 * The parameter value unset by this method should be same 3742 * as was set. 3743 * 3744 * @param columnIdxes the index into this rowset 3745 * object's internal representation of parameter values 3746 * @throws SQLException if an error occurs or the 3747 * parameter index is out of bounds or if the columnIdx is 3748 * not the same as set using <code>setMatchColumn(int [])</code> 3749 */ 3750 public void unsetMatchColumn(int[] columnIdxes) throws SQLException { 3751 3752 int i_val; 3753 for( int j= 0 ;j < columnIdxes.length; j++) { 3754 i_val = (Integer.parseInt(iMatchColumns.get(j).toString())); 3755 if(columnIdxes[j] != i_val) { 3756 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols").toString()); 3757 } 3758 } 3759 3760 for( int i = 0;i < columnIdxes.length ;i++) { 3761 iMatchColumns.set(i,Integer.valueOf(-1)); 3762 } 3763 } 3764 3765 /** 3766 * Unsets the designated parameter to the given String array. 3767 * This was set using <code>setMatchColumn</code> 3768 * as the column which will form the basis of the join. 3769 * <P> 3770 * The parameter value unset by this method should be same 3771 * as was set. 3772 * 3773 * @param columnIdxes the index into this rowset 3774 * object's internal representation of parameter values 3775 * @throws SQLException if an error occurs or the 3776 * parameter index is out of bounds or if the columnName is 3777 * not the same as set using <code>setMatchColumn(String [])</code> 3778 */ 3779 public void unsetMatchColumn(String[] columnIdxes) throws SQLException { 3780 3781 for(int j = 0 ;j < columnIdxes.length; j++) { 3782 if( !columnIdxes[j].equals(strMatchColumns.get(j)) ){ 3783 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols").toString()); 3784 } 3785 } 3786 3787 for(int i = 0 ; i < columnIdxes.length; i++) { 3788 strMatchColumns.set(i,null); 3789 } 3790 } 3791 3792 /** 3793 * Retrieves the column name as <code>String</code> array 3794 * that was set using <code>setMatchColumn(String [])</code> 3795 * for this rowset. 3796 * 3797 * @return a <code>String</code> array object that contains the column names 3798 * for the rowset which has this the match columns 3799 * 3800 * @throws SQLException if an error occurs or column name is not set 3801 */ 3802 public String[] getMatchColumnNames() throws SQLException { 3803 3804 String []str_temp = new String[strMatchColumns.size()]; 3805 3806 if( strMatchColumns.get(0) == null) { 3807 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.setmatchcols").toString()); 3808 } 3809 3810 strMatchColumns.copyInto(str_temp); 3811 return str_temp; 3812 } 3813 3814 /** 3815 * Retrieves the column id as <code>int</code> array that was set using 3816 * <code>setMatchColumn(int [])</code> for this rowset. 3817 * 3818 * @return a <code>int</code> array object that contains the column ids 3819 * for the rowset which has this as the match columns. 3820 * 3821 * @throws SQLException if an error occurs or column index is not set 3822 */ 3823 public int[] getMatchColumnIndexes() throws SQLException { 3824 3825 Integer []int_temp = new Integer[iMatchColumns.size()]; 3826 int [] i_temp = new int[iMatchColumns.size()]; 3827 int i_val; 3828 3829 i_val = iMatchColumns.get(0); 3830 3831 if( i_val == -1 ) { 3832 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.setmatchcols").toString()); 3833 } 3834 3835 3836 iMatchColumns.copyInto(int_temp); 3837 3838 for(int i = 0; i < int_temp.length; i++) { 3839 i_temp[i] = (int_temp[i]).intValue(); 3840 } 3841 3842 return i_temp; 3843 } 3844 3845 /** 3846 * Sets the designated parameter to the given int array. 3847 * This forms the basis of the join for the 3848 * <code>JoinRowSet</code> as the column which will form the basis of the 3849 * join. 3850 * <P> 3851 * The parameter value set by this method is stored internally and 3852 * will be supplied as the appropriate parameter in this rowset's 3853 * command when the method <code>getMatchColumnIndexes</code> is called. 3854 * 3855 * @param columnIdxes the indexes into this rowset 3856 * object's internal representation of parameter values; the 3857 * first parameter is 0, the second is 1, and so on; must be 3858 * <code>0</code> or greater 3859 * @throws SQLException if an error occurs or the 3860 * parameter index is out of bounds 3861 */ 3862 public void setMatchColumn(int[] columnIdxes) throws SQLException { 3863 3864 for(int j = 0 ; j < columnIdxes.length; j++) { 3865 if( columnIdxes[j] < 0 ) { 3866 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols1").toString()); 3867 } 3868 } 3869 for(int i = 0 ;i < columnIdxes.length; i++) { 3870 iMatchColumns.add(i,Integer.valueOf(columnIdxes[i])); 3871 } 3872 } 3873 3874 /** 3875 * Sets the designated parameter to the given String array. 3876 * This forms the basis of the join for the 3877 * <code>JoinRowSet</code> as the column which will form the basis of the 3878 * join. 3879 * <P> 3880 * The parameter value set by this method is stored internally and 3881 * will be supplied as the appropriate parameter in this rowset's 3882 * command when the method <code>getMatchColumn</code> is called. 3883 * 3884 * @param columnNames the name of the column into this rowset 3885 * object's internal representation of parameter values 3886 * @throws SQLException if an error occurs or the 3887 * parameter index is out of bounds 3888 */ 3889 public void setMatchColumn(String[] columnNames) throws SQLException { 3890 3891 for(int j = 0; j < columnNames.length; j++) { 3892 if( columnNames[j] == null || columnNames[j].equals("")) { 3893 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols2").toString()); 3894 } 3895 } 3896 for( int i = 0; i < columnNames.length; i++) { 3897 strMatchColumns.add(i,columnNames[i]); 3898 } 3899 } 3900 3901 3902 /** 3903 * Sets the designated parameter to the given <code>int</code> 3904 * object. This forms the basis of the join for the 3905 * <code>JoinRowSet</code> as the column which will form the basis of the 3906 * join. 3907 * <P> 3908 * The parameter value set by this method is stored internally and 3909 * will be supplied as the appropriate parameter in this rowset's 3910 * command when the method <code>getMatchColumn</code> is called. 3911 * 3912 * @param columnIdx the index into this rowset 3913 * object's internal representation of parameter values; the 3914 * first parameter is 0, the second is 1, and so on; must be 3915 * <code>0</code> or greater 3916 * @throws SQLException if an error occurs or the 3917 * parameter index is out of bounds 3918 */ 3919 public void setMatchColumn(int columnIdx) throws SQLException { 3920 // validate, if col is ok to be set 3921 if(columnIdx < 0) { 3922 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols1").toString()); 3923 } else { 3924 // set iMatchColumn 3925 iMatchColumns.set(0, Integer.valueOf(columnIdx)); 3926 //strMatchColumn = null; 3927 } 3928 } 3929 3930 /** 3931 * Sets the designated parameter to the given <code>String</code> 3932 * object. This forms the basis of the join for the 3933 * <code>JoinRowSet</code> as the column which will form the basis of the 3934 * join. 3935 * <P> 3936 * The parameter value set by this method is stored internally and 3937 * will be supplied as the appropriate parameter in this rowset's 3938 * command when the method <code>getMatchColumn</code> is called. 3939 * 3940 * @param columnName the name of the column into this rowset 3941 * object's internal representation of parameter values 3942 * @throws SQLException if an error occurs or the 3943 * parameter index is out of bounds 3944 */ 3945 public void setMatchColumn(String columnName) throws SQLException { 3946 // validate, if col is ok to be set 3947 if(columnName == null || (columnName= columnName.trim()).equals("")) { 3948 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols2").toString()); 3949 } else { 3950 // set strMatchColumn 3951 strMatchColumns.set(0, columnName); 3952 //iMatchColumn = -1; 3953 } 3954 } 3955 3956 /** 3957 * Unsets the designated parameter to the given <code>int</code> 3958 * object. This was set using <code>setMatchColumn</code> 3959 * as the column which will form the basis of the join. 3960 * <P> 3961 * The parameter value unset by this method should be same 3962 * as was set. 3963 * 3964 * @param columnIdx the index into this rowset 3965 * object's internal representation of parameter values 3966 * @throws SQLException if an error occurs or the 3967 * parameter index is out of bounds or if the columnIdx is 3968 * not the same as set using <code>setMatchColumn(int)</code> 3969 */ 3970 public void unsetMatchColumn(int columnIdx) throws SQLException { 3971 // check if we are unsetting the SAME column 3972 if(! iMatchColumns.get(0).equals(Integer.valueOf(columnIdx) ) ) { 3973 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.unsetmatch").toString()); 3974 } else if(strMatchColumns.get(0) != null) { 3975 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.usecolname").toString()); 3976 } else { 3977 // that is, we are unsetting it. 3978 iMatchColumns.set(0, Integer.valueOf(-1)); 3979 } 3980 } 3981 3982 /** 3983 * Unsets the designated parameter to the given <code>String</code> 3984 * object. This was set using <code>setMatchColumn</code> 3985 * as the column which will form the basis of the join. 3986 * <P> 3987 * The parameter value unset by this method should be same 3988 * as was set. 3989 * 3990 * @param columnName the index into this rowset 3991 * object's internal representation of parameter values 3992 * @throws SQLException if an error occurs or the 3993 * parameter index is out of bounds or if the columnName is 3994 * not the same as set using <code>setMatchColumn(String)</code> 3995 * 3996 */ 3997 public void unsetMatchColumn(String columnName) throws SQLException { 3998 // check if we are unsetting the same column 3999 columnName = columnName.trim(); 4000 4001 if(!((strMatchColumns.get(0)).equals(columnName))) { 4002 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.unsetmatch").toString()); 4003 } else if(iMatchColumns.get(0) > 0) { 4004 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.usecolid").toString()); 4005 } else { 4006 strMatchColumns.set(0, null); // that is, we are unsetting it. 4007 } 4008 } 4009 4010 /** 4011 * Retrieves the <code>DatabaseMetaData</code> associated with 4012 * the connection handle associated this this 4013 * <code>JdbcRowSet</code> object. 4014 * 4015 * @return the <code>DatabaseMetadata</code> associated 4016 * with the rowset's connection. 4017 * @throws SQLException if a database access error occurs 4018 */ 4019 public DatabaseMetaData getDatabaseMetaData() throws SQLException { 4020 Connection con = connect(); 4021 return con.getMetaData(); 4022 } 4023 4024 /** 4025 * Retrieves the <code>ParameterMetaData</code> associated with 4026 * the connection handle associated this this 4027 * <code>JdbcRowSet</code> object. 4028 * 4029 * @return the <code>ParameterMetadata</code> associated 4030 * with the rowset's connection. 4031 * @throws SQLException if a database access error occurs 4032 */ 4033 public ParameterMetaData getParameterMetaData() throws SQLException { 4034 prepare(); 4035 return (ps.getParameterMetaData()); 4036 } 4037 4038 /** 4039 * Commits all updates in this <code>JdbcRowSet</code> object by 4040 * wrapping the internal <code>Connection</code> object and calling 4041 * its <code>commit</code> method. 4042 * This method sets this <code>JdbcRowSet</code> object's private field 4043 * <code>rs</code> to <code>null</code> after saving its value to another 4044 * object, but only if the <code>ResultSet</code> 4045 * constant <code>HOLD_CURSORS_OVER_COMMIT</code> has not been set. 4046 * (The field <code>rs</code> is this <code>JdbcRowSet</code> object's 4047 * <code>ResultSet</code> object.) 4048 * 4049 * @throws SQLException if autoCommit is set to true or if a database 4050 * access error occurs 4051 */ 4052 public void commit() throws SQLException { 4053 conn.commit(); 4054 4055 // Checking the holadbility value and making the result set handle null 4056 // Added as per Rave requirements 4057 4058 if( conn.getHoldability() != HOLD_CURSORS_OVER_COMMIT) { 4059 ResultSet oldVal = rs; 4060 rs = null; 4061 // propertyChangeSupport.firePropertyChange("ResultSet",oldVal,rs); 4062 } 4063 } 4064 4065 /** 4066 * Sets auto-commit on the internal <code>Connection</code> object with this 4067 * <code>JdbcRowSet</code> 4068 * 4069 * @throws SQLException if a database access error occurs 4070 */ 4071 public void setAutoCommit(boolean autoCommit) throws SQLException { 4072 // The connection object should be there 4073 // in order to commit the connection handle on or off. 4074 4075 if(conn != null) { 4076 conn.setAutoCommit(autoCommit); 4077 } else { 4078 // Coming here means the connection object is null. 4079 // So generate a connection handle internally, since 4080 // a JdbcRowSet is always connected to a db, it is fine 4081 // to get a handle to the connection. 4082 4083 // Get hold of a connection handle 4084 // and change the autcommit as passesd. 4085 conn = connect(); 4086 4087 // After setting the below the conn.getAutoCommit() 4088 // should return the same value. 4089 conn.setAutoCommit(autoCommit); 4090 4091 } 4092 } 4093 4094 /** 4095 * Returns the auto-commit status with this <code>JdbcRowSet</code>. 4096 * 4097 * @return true if auto commit is true; false otherwise 4098 * @throws SQLException if a database access error occurs 4099 */ 4100 public boolean getAutoCommit() throws SQLException { 4101 return conn.getAutoCommit(); 4102 } 4103 4104 /** 4105 * Rolls back all the updates in this <code>JdbcRowSet</code> object by 4106 * wrapping the internal <code>Connection</code> object and calling its 4107 * <code>rollback</code> method. 4108 * This method sets this <code>JdbcRowSet</code> object's private field 4109 * <code>rs</code> to <code>null</code> after saving its value to another object. 4110 * (The field <code>rs</code> is this <code>JdbcRowSet</code> object's 4111 * internal <code>ResultSet</code> object.) 4112 * 4113 * @throws SQLException if autoCommit is set to true or a database 4114 * access error occurs 4115 */ 4116 public void rollback() throws SQLException { 4117 conn.rollback(); 4118 4119 // Makes the result ste handle null after rollback 4120 // Added as per Rave requirements 4121 4122 ResultSet oldVal = rs; 4123 rs = null; 4124 // propertyChangeSupport.firePropertyChange("ResultSet", oldVal,rs); 4125 } 4126 4127 4128 /** 4129 * Rollbacks all the updates in the <code>JdbcRowSet</code> back to the 4130 * last <code>Savepoint</code> transaction marker. Wraps the internal 4131 * <code>Connection</code> object and call it's rollback method 4132 * 4133 * @param s the <code>Savepoint</code> transaction marker to roll the 4134 * transaction to. 4135 * @throws SQLException if autoCommit is set to true; or ia a database 4136 * access error occurs 4137 */ 4138 public void rollback(Savepoint s) throws SQLException { 4139 conn.rollback(s); 4140 } 4141 4142 // Setting the ResultSet Type and Concurrency 4143 protected void setParams() throws SQLException { 4144 if(rs == null) { 4145 setType(ResultSet.TYPE_SCROLL_INSENSITIVE); 4146 setConcurrency(ResultSet.CONCUR_UPDATABLE); 4147 } 4148 else { 4149 setType(rs.getType()); 4150 setConcurrency(rs.getConcurrency()); 4151 } 4152 } 4153 4154 4155 // Checking ResultSet Type and Concurrency 4156 private void checkTypeConcurrency() throws SQLException { 4157 if(rs.getType() == TYPE_FORWARD_ONLY || 4158 rs.getConcurrency() == CONCUR_READ_ONLY) { 4159 throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.resnotupd").toString()); 4160 } 4161 } 4162 4163 // Returns a Connection Handle 4164 // Added as per Rave requirements 4165 4166 /** 4167 * Gets this <code>JdbcRowSet</code> object's Connection property 4168 * 4169 * 4170 * @return the <code>Connection</code> object associated with this rowset; 4171 */ 4172 4173 protected Connection getConnection() { 4174 return conn; 4175 } 4176 4177 // Sets the connection handle with the parameter 4178 // Added as per rave requirements 4179 4180 /** 4181 * Sets this <code>JdbcRowSet</code> object's connection property 4182 * to the given <code>Connection</code> object. 4183 * 4184 * @param connection the <code>Connection</code> object. 4185 */ 4186 4187 protected void setConnection(Connection connection) { 4188 conn = connection; 4189 } 4190 4191 // Returns a PreparedStatement Handle 4192 // Added as per Rave requirements 4193 4194 /** 4195 * Gets this <code>JdbcRowSet</code> object's PreparedStatement property 4196 * 4197 * 4198 * @return the <code>PreparedStatement</code> object associated with this rowset; 4199 */ 4200 4201 protected PreparedStatement getPreparedStatement() { 4202 return ps; 4203 } 4204 4205 //Sets the prepared statement handle to the parameter 4206 // Added as per Rave requirements 4207 4208 /** 4209 * Sets this <code>JdbcRowSet</code> object's preparedtsatement property 4210 * to the given <code>PreparedStatemennt</code> object. 4211 * 4212 * @param preparedStatement the <code>PreparedStatement</code> object 4213 * 4214 */ 4215 protected void setPreparedStatement(PreparedStatement preparedStatement) { 4216 ps = preparedStatement; 4217 } 4218 4219 // Returns a ResultSet handle 4220 // Added as per Rave requirements 4221 4222 /** 4223 * Gets this <code>JdbcRowSet</code> object's ResultSet property 4224 * 4225 * 4226 * @return the <code>ResultSet</code> object associated with this rowset; 4227 */ 4228 4229 protected ResultSet getResultSet() throws SQLException { 4230 4231 checkState(); 4232 4233 return rs; 4234 } 4235 4236 // Sets the result set handle to the parameter 4237 // Added as per Rave requirements 4238 4239 /** 4240 * Sets this <code>JdbcRowSet</code> object's resultset property 4241 * to the given <code>ResultSet</code> object. 4242 * 4243 * @param resultSet the <code>ResultSet</code> object 4244 * 4245 */ 4246 protected void setResultSet(ResultSet resultSet) { 4247 rs = resultSet; 4248 } 4249 4250 4251 // Over riding the setCommand from BaseRowSet for 4252 // firing the propertyChangeSupport Event for 4253 // Rave requirements when this property's value 4254 // changes. 4255 4256 /** 4257 * Sets this <code>JdbcRowSet</code> object's <code>command</code> property to 4258 * the given <code>String</code> object and clears the parameters, if any, 4259 * that were set for the previous command. In addition, 4260 * if the <code>command</code> property has previously been set to a 4261 * non-null value and it is 4262 * different from the <code>String</code> object supplied, 4263 * this method sets this <code>JdbcRowSet</code> object's private fields 4264 * <code>ps</code> and <code>rs</code> to <code>null</code>. 4265 * (The field <code>ps</code> is its <code>PreparedStatement</code> object, and 4266 * the field <code>rs</code> is its <code>ResultSet</code> object.) 4267 * <P> 4268 * The <code>command</code> property may not be needed if the <code>RowSet</code> 4269 * object gets its data from a source that does not support commands, 4270 * such as a spreadsheet or other tabular file. 4271 * Thus, this property is optional and may be <code>null</code>. 4272 * 4273 * @param command a <code>String</code> object containing an SQL query 4274 * that will be set as this <code>RowSet</code> object's command 4275 * property; may be <code>null</code> but may not be an empty string 4276 * @throws SQLException if an empty string is provided as the command value 4277 * @see #getCommand 4278 */ 4279 public void setCommand(String command) throws SQLException { 4280 String oldVal; 4281 4282 if (getCommand() != null) { 4283 if(!getCommand().equals(command)) { 4284 oldVal = getCommand(); 4285 super.setCommand(command); 4286 ps = null; 4287 rs = null; 4288 propertyChangeSupport.firePropertyChange("command", oldVal,command); 4289 } 4290 } 4291 else { 4292 super.setCommand(command); 4293 propertyChangeSupport.firePropertyChange("command", null,command); 4294 } 4295 } 4296 4297 // Over riding the setDataSourceName from BaseRowSet for 4298 // firing the propertyChangeSupport Event for 4299 // Rave requirements when this property's values 4300 // changes. 4301 4302 /** 4303 * Sets the <code>dataSourceName</code> property for this <code>JdbcRowSet</code> 4304 * object to the given logical name and sets this <code>JdbcRowSet</code> object's 4305 * Url property to <code>null</code>. In addition, if the <code>dataSourceName</code> 4306 * property has previously been set and is different from the one supplied, 4307 * this method sets this <code>JdbcRowSet</code> object's private fields 4308 * <code>ps</code>, <code>rs</code>, and <code>conn</code> to <code>null</code>. 4309 * (The field <code>ps</code> is its <code>PreparedStatement</code> object, 4310 * the field <code>rs</code> is its <code>ResultSet</code> object, and 4311 * the field <code>conn</code> is its <code>Connection</code> object.) 4312 * <P> 4313 * The name supplied to this method must have been bound to a 4314 * <code>DataSource</code> object in a JNDI naming service so that an 4315 * application can do a lookup using that name to retrieve the 4316 * <code>DataSource</code> object bound to it. The <code>DataSource</code> 4317 * object can then be used to establish a connection to the data source it 4318 * represents. 4319 * <P> 4320 * Users should set either the Url property or the dataSourceName property. 4321 * If both properties are set, the driver will use the property set most recently. 4322 * 4323 * @param dsName a <code>String</code> object with the name that can be supplied 4324 * to a naming service based on JNDI technology to retrieve the 4325 * <code>DataSource</code> object that can be used to get a connection; 4326 * may be <code>null</code> 4327 * @throws SQLException if there is a problem setting the 4328 * <code>dataSourceName</code> property 4329 * @see #getDataSourceName 4330 */ 4331 public void setDataSourceName(String dsName) throws SQLException{ 4332 String oldVal; 4333 4334 if(getDataSourceName() != null) { 4335 if(!getDataSourceName().equals(dsName)) { 4336 oldVal = getDataSourceName(); 4337 super.setDataSourceName(dsName); 4338 conn = null; 4339 ps = null; 4340 rs = null; 4341 propertyChangeSupport.firePropertyChange("dataSourceName",oldVal,dsName); 4342 } 4343 } 4344 else { 4345 super.setDataSourceName(dsName); 4346 propertyChangeSupport.firePropertyChange("dataSourceName",null,dsName); 4347 } 4348 } 4349 4350 // Over riding the setUrl from BaseRowSet for 4351 // firing the propertyChangeSupport Event for 4352 // Rave requirements when this property's values 4353 // changes. 4354 4355 /** 4356 * Sets the Url property for this <code>JdbcRowSet</code> object 4357 * to the given <code>String</code> object and sets the dataSource name 4358 * property to <code>null</code>. In addition, if the Url property has 4359 * previously been set to a non <code>null</code> value and its value 4360 * is different from the value to be set, 4361 * this method sets this <code>JdbcRowSet</code> object's private fields 4362 * <code>ps</code>, <code>rs</code>, and <code>conn</code> to <code>null</code>. 4363 * (The field <code>ps</code> is its <code>PreparedStatement</code> object, 4364 * the field <code>rs</code> is its <code>ResultSet</code> object, and 4365 * the field <code>conn</code> is its <code>Connection</code> object.) 4366 * <P> 4367 * The Url property is a JDBC URL that is used when 4368 * the connection is created using a JDBC technology-enabled driver 4369 * ("JDBC driver") and the <code>DriverManager</code>. 4370 * The correct JDBC URL for the specific driver to be used can be found 4371 * in the driver documentation. Although there are guidelines for for how 4372 * a JDBC URL is formed, 4373 * a driver vendor can specify any <code>String</code> object except 4374 * one with a length of <code>0</code> (an empty string). 4375 * <P> 4376 * Setting the Url property is optional if connections are established using 4377 * a <code>DataSource</code> object instead of the <code>DriverManager</code>. 4378 * The driver will use either the URL property or the 4379 * dataSourceName property to create a connection, whichever was 4380 * specified most recently. If an application uses a JDBC URL, it 4381 * must load a JDBC driver that accepts the JDBC URL before it uses the 4382 * <code>RowSet</code> object to connect to a database. The <code>RowSet</code> 4383 * object will use the URL internally to create a database connection in order 4384 * to read or write data. 4385 * 4386 * @param url a <code>String</code> object that contains the JDBC URL 4387 * that will be used to establish the connection to a database for this 4388 * <code>RowSet</code> object; may be <code>null</code> but must not 4389 * be an empty string 4390 * @throws SQLException if an error occurs setting the Url property or the 4391 * parameter supplied is a string with a length of <code>0</code> (an 4392 * empty string) 4393 * @see #getUrl 4394 */ 4395 4396 public void setUrl(String url) throws SQLException { 4397 String oldVal; 4398 4399 if(getUrl() != null) { 4400 if(!getUrl().equals(url)) { 4401 oldVal = getUrl(); 4402 super.setUrl(url); 4403 conn = null; 4404 ps = null; 4405 rs = null; 4406 propertyChangeSupport.firePropertyChange("url", oldVal, url); 4407 } 4408 } 4409 else { 4410 super.setUrl(url); 4411 propertyChangeSupport.firePropertyChange("url", null, url); 4412 } 4413 } 4414 4415 // Over riding the setUsername from BaseRowSet for 4416 // firing the propertyChangeSupport Event for 4417 // Rave requirements when this property's values 4418 // changes. 4419 4420 /** 4421 * Sets the username property for this <code>JdbcRowSet</code> object 4422 * to the given user name. Because it 4423 * is not serialized, the username property is set at run time before 4424 * calling the method <code>execute</code>. In addition, 4425 * if the <code>username</code> property is already set with a 4426 * non-null value and that value is different from the <code>String</code> 4427 * object to be set, 4428 * this method sets this <code>JdbcRowSet</code> object's private fields 4429 * <code>ps</code>, <code>rs</code>, and <code>conn</code> to <code>null</code>. 4430 * (The field <code>ps</code> is its <code>PreparedStatement</code> object, 4431 * <code>rs</code> is its <code>ResultSet</code> object, and 4432 * <code>conn</code> is its <code>Connection</code> object.) 4433 * Setting these fields to <code>null</code> ensures that only current 4434 * values will be used. 4435 * 4436 * @param uname the <code>String</code> object containing the user name that 4437 * is supplied to the data source to create a connection. It may be null. 4438 * @see #getUsername 4439 */ 4440 public void setUsername(String uname) { 4441 String oldVal; 4442 4443 if( getUsername() != null) { 4444 if(!getUsername().equals(uname)) { 4445 oldVal = getUsername(); 4446 super.setUsername(uname); 4447 conn = null; 4448 ps = null; 4449 rs = null; 4450 propertyChangeSupport.firePropertyChange("username",oldVal,uname); 4451 } 4452 } 4453 else{ 4454 super.setUsername(uname); 4455 propertyChangeSupport.firePropertyChange("username",null,uname); 4456 } 4457 } 4458 4459 // Over riding the setPassword from BaseRowSet for 4460 // firing the propertyChangeSupport Event for 4461 // Rave requirements when this property's values 4462 // changes. 4463 4464 /** 4465 * Sets the password property for this <code>JdbcRowSet</code> object 4466 * to the given <code>String</code> object. Because it 4467 * is not serialized, the password property is set at run time before 4468 * calling the method <code>execute</code>. Its default valus is 4469 * <code>null</code>. In addition, 4470 * if the <code>password</code> property is already set with a 4471 * non-null value and that value is different from the one being set, 4472 * this method sets this <code>JdbcRowSet</code> object's private fields 4473 * <code>ps</code>, <code>rs</code>, and <code>conn</code> to <code>null</code>. 4474 * (The field <code>ps</code> is its <code>PreparedStatement</code> object, 4475 * <code>rs</code> is its <code>ResultSet</code> object, and 4476 * <code>conn</code> is its <code>Connection</code> object.) 4477 * Setting these fields to <code>null</code> ensures that only current 4478 * values will be used. 4479 * 4480 * @param password the <code>String</code> object that represents the password 4481 * that must be supplied to the database to create a connection 4482 */ 4483 public void setPassword(String password) { 4484 String oldVal; 4485 4486 if ( getPassword() != null) { 4487 if(!getPassword().equals(password)) { 4488 oldVal = getPassword(); 4489 super.setPassword(password); 4490 conn = null; 4491 ps = null; 4492 rs = null; 4493 propertyChangeSupport.firePropertyChange("password",oldVal,password); 4494 } 4495 } 4496 else{ 4497 super.setPassword(password); 4498 propertyChangeSupport.firePropertyChange("password",null,password); 4499 } 4500 } 4501 4502 /** 4503 * Sets the type for this <code>RowSet</code> object to the specified type. 4504 * The default type is <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>. 4505 * 4506 * @param type one of the following constants: 4507 * <code>ResultSet.TYPE_FORWARD_ONLY</code>, 4508 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or 4509 * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> 4510 * @throws SQLException if the parameter supplied is not one of the 4511 * following constants: 4512 * <code>ResultSet.TYPE_FORWARD_ONLY</code> or 4513 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code> 4514 * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> 4515 * @see #getConcurrency 4516 * @see #getType 4517 */ 4518 4519 public void setType(int type) throws SQLException { 4520 4521 int oldVal; 4522 4523 try { 4524 oldVal = getType(); 4525 }catch(SQLException ex) { 4526 oldVal = 0; 4527 } 4528 4529 if(oldVal != type) { 4530 super.setType(type); 4531 propertyChangeSupport.firePropertyChange("type",oldVal,type); 4532 } 4533 4534 } 4535 4536 /** 4537 * Sets the concurrency for this <code>RowSet</code> object to 4538 * the specified concurrency. The default concurrency for any <code>RowSet</code> 4539 * object (connected or disconnected) is <code>ResultSet.CONCUR_UPDATABLE</code>, 4540 * but this method may be called at any time to change the concurrency. 4541 * 4542 * @param concur one of the following constants: 4543 * <code>ResultSet.CONCUR_READ_ONLY</code> or 4544 * <code>ResultSet.CONCUR_UPDATABLE</code> 4545 * @throws SQLException if the parameter supplied is not one of the 4546 * following constants: 4547 * <code>ResultSet.CONCUR_UPDATABLE</code> or 4548 * <code>ResultSet.CONCUR_READ_ONLY</code> 4549 * @see #getConcurrency 4550 * @see #isReadOnly 4551 */ 4552 public void setConcurrency(int concur) throws SQLException { 4553 4554 int oldVal; 4555 4556 try { 4557 oldVal = getConcurrency(); 4558 }catch(NullPointerException ex) { 4559 oldVal = 0; 4560 } 4561 4562 if(oldVal != concur) { 4563 super.setConcurrency(concur); 4564 propertyChangeSupport.firePropertyChange("concurrency",oldVal,concur); 4565 } 4566 4567 } 4568 4569 /** 4570 * Sets the transaction isolation property for this JDBC <code>RowSet</code> object to the given 4571 * constant. The DBMS will use this transaction isolation level for 4572 * transactions if it can. 4573 * <p> 4574 * For <code>RowSet</code> implementations such as 4575 * the <code>CachedRowSet</code> that operate in a disconnected environment, 4576 * the <code>SyncProvider</code> object being used 4577 * offers complementary locking and data integrity options. The 4578 * options described below are pertinent only to connected <code>RowSet</code> 4579 * objects (<code>JdbcRowSet</code> objects). 4580 * 4581 * @param transIso one of the following constants, listed in ascending order: 4582 * <code>Connection.TRANSACTION_NONE</code>, 4583 * <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>, 4584 * <code>Connection.TRANSACTION_READ_COMMITTED</code>, 4585 * <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or 4586 * <code>Connection.TRANSACTION_SERIALIZABLE</code> 4587 * @throws SQLException if the given parameter is not one of the Connection 4588 * constants 4589 * @see javax.sql.rowset.spi.SyncFactory 4590 * @see javax.sql.rowset.spi.SyncProvider 4591 * @see #getTransactionIsolation 4592 */ 4593 public void setTransactionIsolation(int transIso) throws SQLException { 4594 4595 int oldVal; 4596 4597 try { 4598 oldVal = getTransactionIsolation(); 4599 }catch(NullPointerException ex) { 4600 oldVal = 0; 4601 } 4602 4603 if(oldVal != transIso) { 4604 super.setTransactionIsolation(transIso); 4605 propertyChangeSupport.firePropertyChange("transactionIsolation",oldVal,transIso); 4606 } 4607 4608 } 4609 4610 /** 4611 * Sets the maximum number of rows that this <code>RowSet</code> object may contain to 4612 * the given number. If this limit is exceeded, the excess rows are 4613 * silently dropped. 4614 * 4615 * @param mRows an <code>int</code> indicating the current maximum number 4616 * of rows; zero means that there is no limit 4617 * @throws SQLException if an error occurs internally setting the 4618 * maximum limit on the number of rows that a JDBC <code>RowSet</code> object 4619 * can contain; or if <i>max</i> is less than <code>0</code>; or 4620 * if <i>max</i> is less than the <code>fetchSize</code> of the 4621 * <code>RowSet</code> 4622 */ 4623 public void setMaxRows(int mRows) throws SQLException { 4624 4625 int oldVal; 4626 4627 try { 4628 oldVal = getMaxRows(); 4629 }catch(NullPointerException ex) { 4630 oldVal = 0; 4631 } 4632 4633 if(oldVal != mRows) { 4634 super.setMaxRows(mRows); 4635 propertyChangeSupport.firePropertyChange("maxRows",oldVal,mRows); 4636 } 4637 4638 } 4639 4640 /** 4641 * Retrieves the value of the designated <code>SQL XML</code> parameter as a 4642 * <code>SQLXML</code> object in the Java programming language. 4643 * @param columnIndex the first column is 1, the second is 2, ... 4644 * @return a SQLXML object that maps an SQL XML value 4645 * @throws SQLException if a database access error occurs 4646 * @since 6.0 4647 */ 4648 public SQLXML getSQLXML(int columnIndex) throws SQLException { 4649 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4650 } 4651 4652 /** 4653 * Retrieves the value of the designated <code>SQL XML</code> parameter as a 4654 * <code>SQLXML</code> object in the Java programming language. 4655 * @param colName the name of the column from which to retrieve the value 4656 * @return a SQLXML object that maps an SQL XML value 4657 * @throws SQLException if a database access error occurs 4658 */ 4659 public SQLXML getSQLXML(String colName) throws SQLException { 4660 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4661 } 4662 4663 /** 4664 * Retrieves the value of the designated column in the current row of this 4665 * <code>ResultSet</code> object as a java.sql.RowId object in the Java 4666 * programming language. 4667 * 4668 * @param columnIndex the first column is 1, the second 2, ... 4669 * @return the column value if the value is a SQL <code>NULL</code> the 4670 * value returned is <code>null</code> 4671 * @throws SQLException if a database access error occurs 4672 * @since 6.0 4673 */ 4674 public RowId getRowId(int columnIndex) throws SQLException { 4675 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4676 } 4677 4678 /** 4679 * Retrieves the value of the designated column in the current row of this 4680 * <code>ResultSet</code> object as a java.sql.RowId object in the Java 4681 * programming language. 4682 * 4683 * @param columnName the name of the column 4684 * @return the column value if the value is a SQL <code>NULL</code> the 4685 * value returned is <code>null</code> 4686 * @throws SQLException if a database access error occurs 4687 * @since 6.0 4688 */ 4689 public RowId getRowId(String columnName) throws SQLException { 4690 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4691 } 4692 4693 /** 4694 * Updates the designated column with a <code>RowId</code> value. The updater 4695 * methods are used to update column values in the current row or the insert 4696 * row. The updater methods do not update the underlying database; instead 4697 * the <code>updateRow<code> or <code>insertRow</code> methods are called 4698 * to update the database. 4699 * 4700 * @param columnIndex the first column is 1, the second 2, ... 4701 * @param x the column value 4702 * @throws SQLException if a database access occurs 4703 * @since 6.0 4704 */ 4705 public void updateRowId(int columnIndex, RowId x) throws SQLException { 4706 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4707 } 4708 4709 /** 4710 * Updates the designated column with a <code>RowId</code> value. The updater 4711 * methods are used to update column values in the current row or the insert 4712 * row. The updater methods do not update the underlying database; instead 4713 * the <code>updateRow<code> or <code>insertRow</code> methods are called 4714 * to update the database. 4715 * 4716 * @param columnName the name of the column 4717 * @param x the column value 4718 * @throws SQLException if a database access occurs 4719 * @since 6.0 4720 */ 4721 public void updateRowId(String columnName, RowId x) throws SQLException { 4722 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4723 } 4724 4725 /** 4726 * Retrieves the holdability of this ResultSet object 4727 * @return either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT 4728 * @throws SQLException if a database error occurs 4729 * @since 6.0 4730 */ 4731 public int getHoldability() throws SQLException { 4732 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4733 } 4734 4735 /** 4736 * Retrieves whether this ResultSet object has been closed. A ResultSet is closed if the 4737 * method close has been called on it, or if it is automatically closed. 4738 * @return true if this ResultSet object is closed; false if it is still open 4739 * @throws SQLException if a database access error occurs 4740 * @since 6.0 4741 */ 4742 public boolean isClosed() throws SQLException { 4743 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4744 } 4745 4746 /** 4747 * This method is used for updating columns that support National Character sets. 4748 * It can be used for updating NCHAR,NVARCHAR and LONGNVARCHAR columns. 4749 * @param columnIndex the first column is 1, the second 2, ... 4750 * @param nString the value for the column to be updated 4751 * @throws SQLException if a database access error occurs 4752 * @since 6.0 4753 */ 4754 public void updateNString(int columnIndex, String nString) throws SQLException { 4755 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4756 } 4757 4758 /** 4759 * This method is used for updating columns that support National Character sets. 4760 * It can be used for updating NCHAR,NVARCHAR and LONGNVARCHAR columns. 4761 * @param columnName name of the Column 4762 * @param nString the value for the column to be updated 4763 * @throws SQLException if a database access error occurs 4764 * @since 6.0 4765 */ 4766 public void updateNString(String columnName, String nString) throws SQLException { 4767 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4768 } 4769 4770 4771 /*o 4772 * This method is used for updating SQL <code>NCLOB</code> type that maps 4773 * to <code>java.sql.Types.NCLOB</code> 4774 * @param columnIndex the first column is 1, the second 2, ... 4775 * @param nClob the value for the column to be updated 4776 * @throws SQLException if a database access error occurs 4777 * @since 6.0 4778 */ 4779 public void updateNClob(int columnIndex, NClob nClob) throws SQLException { 4780 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4781 } 4782 4783 /** 4784 * This method is used for updating SQL <code>NCLOB</code> type that maps 4785 * to <code>java.sql.Types.NCLOB</code> 4786 * @param columnName name of the column 4787 * @param nClob the value for the column to be updated 4788 * @throws SQLException if a database access error occurs 4789 * @since 6.0 4790 */ 4791 public void updateNClob(String columnName, NClob nClob) throws SQLException { 4792 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4793 } 4794 4795 /** 4796 * Retrieves the value of the designated column in the current row 4797 * of this <code>ResultSet</code> object as a <code>NClob</code> object 4798 * in the Java programming language. 4799 * 4800 * @param i the first column is 1, the second is 2, ... 4801 * @return a <code>NClob</code> object representing the SQL 4802 * <code>NCLOB</code> value in the specified column 4803 * @exception SQLException if a database access error occurs 4804 * @since 6.0 4805 */ 4806 public NClob getNClob(int i) throws SQLException { 4807 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4808 } 4809 4810 4811 /** 4812 * Retrieves the value of the designated column in the current row 4813 * of this <code>ResultSet</code> object as a <code>NClob</code> object 4814 * in the Java programming language. 4815 * 4816 * @param colName the name of the column from which to retrieve the value 4817 * @return a <code>NClob</code> object representing the SQL <code>NCLOB</code> 4818 * value in the specified column 4819 * @exception SQLException if a database access error occurs 4820 * @since 6.0 4821 */ 4822 public NClob getNClob(String colName) throws SQLException { 4823 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4824 } 4825 4826 public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException{ 4827 return null; 4828 } 4829 4830 public boolean isWrapperFor(Class<?> interfaces) throws SQLException { 4831 return false; 4832 } 4833 4834 /** 4835 * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an 4836 * SQL <code>XML</code> value when it sends it to the database. 4837 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 4838 * @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value 4839 * @throws SQLException if a database access error occurs 4840 * @since 1.6 4841 */ 4842 public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { 4843 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4844 } 4845 4846 /** 4847 * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an 4848 * <code>SQL XML</code> value when it sends it to the database. 4849 * @param parameterName the name of the parameter 4850 * @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value 4851 * @throws SQLException if a database access error occurs 4852 * @since 1.6 4853 */ 4854 public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { 4855 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4856 } 4857 4858 /** 4859 * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The 4860 * driver converts this to a SQL <code>ROWID</code> value when it sends it 4861 * to the database 4862 * 4863 * @param parameterIndex the first parameter is 1, the second is 2, ... 4864 * @param x the parameter value 4865 * @throws SQLException if a database access error occurs 4866 * 4867 * @since 1.6 4868 */ 4869 public void setRowId(int parameterIndex, RowId x) throws SQLException { 4870 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4871 } 4872 4873 /** 4874 * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The 4875 * driver converts this to a SQL <code>ROWID</code> when it sends it to the 4876 * database. 4877 * 4878 * @param parameterName the name of the parameter 4879 * @param x the parameter value 4880 * @throws SQLException if a database access error occurs 4881 * @since 1.6 4882 */ 4883 public void setRowId(String parameterName, RowId x) throws SQLException { 4884 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4885 } 4886 4887 4888 /** 4889 * Sets the designated paramter to the given <code>String</code> object. 4890 * The driver converts this to a SQL <code>NCHAR</code> or 4891 * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value 4892 * (depending on the argument's 4893 * size relative to the driver's limits on <code>NVARCHAR</code> values) 4894 * when it sends it to the database. 4895 * 4896 * @param parameterIndex of the first parameter is 1, the second is 2, ... 4897 * @param value the parameter value 4898 * @throws SQLException if the driver does not support national 4899 * character sets; if the driver can detect that a data conversion 4900 * error could occur ; or if a database access error occurs 4901 * @since 1.6 4902 */ 4903 public void setNString(int parameterIndex, String value) throws SQLException { 4904 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4905 } 4906 4907 4908 /** 4909 * Sets the designated parameter in this <code>RowSet</code> object's command 4910 * to a <code>Reader</code> object. The 4911 * <code>Reader</code> reads the data till end-of-file is reached. The 4912 * driver does the necessary conversion from Java character format to 4913 * the national character set in the database. 4914 4915 * <P><B>Note:</B> This stream object can either be a standard 4916 * Java stream object or your own subclass that implements the 4917 * standard interface. 4918 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 4919 * it might be more efficient to use a version of 4920 * <code>setNCharacterStream</code> which takes a length parameter. 4921 * 4922 * @param parameterIndex of the first parameter is 1, the second is 2, ... 4923 * @param value the parameter value 4924 * @throws SQLException if the driver does not support national 4925 * character sets; if the driver can detect that a data conversion 4926 * error could occur ; if a database access error occurs; or 4927 * this method is called on a closed <code>PreparedStatement</code> 4928 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 4929 * @since 1.6 4930 */ 4931 public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { 4932 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4933 } 4934 4935 /** 4936 * Sets the designated parameter to a <code>java.sql.NClob</code> object. The object 4937 * implements the <code>java.sql.NClob</code> interface. This <code>NClob</code> 4938 * object maps to a SQL <code>NCLOB</code>. 4939 * @param parameterName the name of the column to be set 4940 * @param value the parameter value 4941 * @throws SQLException if the driver does not support national 4942 * character sets; if the driver can detect that a data conversion 4943 * error could occur; or if a database access error occurs 4944 * @since 1.6 4945 */ 4946 public void setNClob(String parameterName, NClob value) throws SQLException { 4947 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4948 } 4949 4950 4951 /** 4952 * Retrieves the value of the designated column in the current row 4953 * of this <code>ResultSet</code> object as a 4954 * <code>java.io.Reader</code> object. 4955 * It is intended for use when 4956 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 4957 * and <code>LONGNVARCHAR</code> columns. 4958 * 4959 * @return a <code>java.io.Reader</code> object that contains the column 4960 * value; if the value is SQL <code>NULL</code>, the value returned is 4961 * <code>null</code> in the Java programming language. 4962 * @param columnIndex the first column is 1, the second is 2, ... 4963 * @exception SQLException if a database access error occurs 4964 * @since 1.6 4965 */ 4966 public java.io.Reader getNCharacterStream(int columnIndex) throws SQLException { 4967 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4968 } 4969 4970 4971 /** 4972 * Retrieves the value of the designated column in the current row 4973 * of this <code>ResultSet</code> object as a 4974 * <code>java.io.Reader</code> object. 4975 * It is intended for use when 4976 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 4977 * and <code>LONGNVARCHAR</code> columns. 4978 * 4979 * @param columnName the name of the column 4980 * @return a <code>java.io.Reader</code> object that contains the column 4981 * value; if the value is SQL <code>NULL</code>, the value returned is 4982 * <code>null</code> in the Java programming language 4983 * @exception SQLException if a database access error occurs 4984 * @since 1.6 4985 */ 4986 public java.io.Reader getNCharacterStream(String columnName) throws SQLException { 4987 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 4988 } 4989 4990 /** 4991 * Updates the designated column with a <code>java.sql.SQLXML</code> value. 4992 * The updater 4993 * methods are used to update column values in the current row or the insert 4994 * row. The updater methods do not update the underlying database; instead 4995 * the <code>updateRow</code> or <code>insertRow</code> methods are called 4996 * to update the database. 4997 * @param columnIndex the first column is 1, the second 2, ... 4998 * @param xmlObject the value for the column to be updated 4999 * @throws SQLException if a database access error occurs 5000 * @since 1.6 5001 */ 5002 public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { 5003 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5004 } 5005 5006 /** 5007 * Updates the designated column with a <code>java.sql.SQLXML</code> value. 5008 * The updater 5009 * methods are used to update column values in the current row or the insert 5010 * row. The updater methods do not update the underlying database; instead 5011 * the <code>updateRow</code> or <code>insertRow</code> methods are called 5012 * to update the database. 5013 * 5014 * @param columnName the name of the column 5015 * @param xmlObject the column value 5016 * @throws SQLException if a database access occurs 5017 * @since 1.6 5018 */ 5019 public void updateSQLXML(String columnName, SQLXML xmlObject) throws SQLException { 5020 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5021 } 5022 5023 /** 5024 * Retrieves the value of the designated column in the current row 5025 * of this <code>ResultSet</code> object as 5026 * a <code>String</code> in the Java programming language. 5027 * It is intended for use when 5028 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 5029 * and <code>LONGNVARCHAR</code> columns. 5030 * 5031 * @param columnIndex the first column is 1, the second is 2, ... 5032 * @return the column value; if the value is SQL <code>NULL</code>, the 5033 * value returned is <code>null</code> 5034 * @exception SQLException if a database access error occurs 5035 * @since 1.6 5036 */ 5037 public String getNString(int columnIndex) throws SQLException { 5038 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5039 } 5040 5041 /** 5042 * Retrieves the value of the designated column in the current row 5043 * of this <code>ResultSet</code> object as 5044 * a <code>String</code> in the Java programming language. 5045 * It is intended for use when 5046 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 5047 * and <code>LONGNVARCHAR</code> columns. 5048 * 5049 * @param columnName the SQL name of the column 5050 * @return the column value; if the value is SQL <code>NULL</code>, the 5051 * value returned is <code>null</code> 5052 * @exception SQLException if a database access error occurs 5053 * @since 1.6 5054 */ 5055 public String getNString(String columnName) throws SQLException { 5056 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5057 } 5058 5059 /** 5060 * Updates the designated column with a character stream value, which will 5061 * have the specified number of bytes. The driver does the necessary conversion 5062 * from Java character format to the national character set in the database. 5063 * It is intended for use when updating NCHAR,NVARCHAR and LONGNVARCHAR columns. 5064 * The updater methods are used to update column values in the current row or 5065 * the insert row. The updater methods do not update the underlying database; 5066 * instead the updateRow or insertRow methods are called to update the database. 5067 * 5068 * @param columnIndex - the first column is 1, the second is 2, ... 5069 * @param x - the new column value 5070 * @param length - the length of the stream 5071 * @exception SQLException if a database access error occurs 5072 * @since 1.6 5073 */ 5074 public void updateNCharacterStream(int columnIndex, 5075 java.io.Reader x, 5076 long length) 5077 throws SQLException { 5078 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5079 } 5080 5081 /** 5082 * Updates the designated column with a character stream value, which will 5083 * have the specified number of bytes. The driver does the necessary conversion 5084 * from Java character format to the national character set in the database. 5085 * It is intended for use when updating NCHAR,NVARCHAR and LONGNVARCHAR columns. 5086 * The updater methods are used to update column values in the current row or 5087 * the insert row. The updater methods do not update the underlying database; 5088 * instead the updateRow or insertRow methods are called to update the database. 5089 * 5090 * @param columnName - name of the Column 5091 * @param x - the new column value 5092 * @param length - the length of the stream 5093 * @exception SQLException if a database access error occurs 5094 * @since 1.6 5095 */ 5096 public void updateNCharacterStream(String columnName, 5097 java.io.Reader x, 5098 long length) 5099 throws SQLException { 5100 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5101 } 5102 5103 /** 5104 * Updates the designated column with a character stream value. The 5105 * driver does the necessary conversion from Java character format to 5106 * the national character set in the database. 5107 * It is intended for use when 5108 * updating <code>NCHAR</code>,<code>NVARCHAR</code> 5109 * and <code>LONGNVARCHAR</code> columns. 5110 * 5111 * The updater methods are used to update column values in the 5112 * current row or the insert row. The updater methods do not 5113 * update the underlying database; instead the <code>updateRow</code> or 5114 * <code>insertRow</code> methods are called to update the database. 5115 * 5116 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5117 * it might be more efficient to use a version of 5118 * <code>updateNCharacterStream</code> which takes a length parameter. 5119 * 5120 * @param columnIndex the first column is 1, the second is 2, ... 5121 * @param x the new column value 5122 * @exception SQLException if a database access error occurs, 5123 * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set 5124 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5125 * this method 5126 * @since 1.6 5127 */ 5128 public void updateNCharacterStream(int columnIndex, 5129 java.io.Reader x) throws SQLException { 5130 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5131 } 5132 5133 /** 5134 * Updates the designated column with a character stream value. The 5135 * driver does the necessary conversion from Java character format to 5136 * the national character set in the database. 5137 * It is intended for use when 5138 * updating <code>NCHAR</code>,<code>NVARCHAR</code> 5139 * and <code>LONGNVARCHAR</code> columns. 5140 * 5141 * The updater methods are used to update column values in the 5142 * current row or the insert row. The updater methods do not 5143 * update the underlying database; instead the <code>updateRow</code> or 5144 * <code>insertRow</code> methods are called to update the database. 5145 * 5146 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5147 * it might be more efficient to use a version of 5148 * <code>updateNCharacterStream</code> which takes a length parameter. 5149 * 5150 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5151 bel is the name of the column 5152 * @param reader the <code>java.io.Reader</code> object containing 5153 * the new column value 5154 * @exception SQLException if a database access error occurs, 5155 * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set 5156 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5157 * this method 5158 * @since 1.6 5159 */ 5160 public void updateNCharacterStream(String columnLabel, 5161 java.io.Reader reader) throws SQLException { 5162 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5163 } 5164 5165 /** 5166 * Updates the designated column using the given input stream, which 5167 * will have the specified number of bytes. 5168 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 5169 * parameter, it may be more practical to send it via a 5170 * <code>java.io.InputStream</code>. Data will be read from the stream 5171 * as needed until end-of-file is reached. The JDBC driver will 5172 * do any necessary conversion from ASCII to the database char format. 5173 * 5174 * <P><B>Note:</B> This stream object can either be a standard 5175 * Java stream object or your own subclass that implements the 5176 * standard interface. 5177 * <p> 5178 * The updater methods are used to update column values in the 5179 * current row or the insert row. The updater methods do not 5180 * update the underlying database; instead the <code>updateRow</code> or 5181 * <code>insertRow</code> methods are called to update the database. 5182 * 5183 * @param columnIndex the first column is 1, the second is 2, ... 5184 * @param inputStream An object that contains the data to set the parameter 5185 * value to. 5186 * @param length the number of bytes in the parameter data. 5187 * @exception SQLException if a database access error occurs, 5188 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5189 * or this method is called on a closed result set 5190 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5191 * this method 5192 * @since 1.6 5193 */ 5194 public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException{ 5195 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5196 } 5197 5198 /** 5199 * Updates the designated column using the given input stream, which 5200 * will have the specified number of bytes. 5201 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 5202 * parameter, it may be more practical to send it via a 5203 * <code>java.io.InputStream</code>. Data will be read from the stream 5204 * as needed until end-of-file is reached. The JDBC driver will 5205 * do any necessary conversion from ASCII to the database char format. 5206 * 5207 * <P><B>Note:</B> This stream object can either be a standard 5208 * Java stream object or your own subclass that implements the 5209 * standard interface. 5210 * <p> 5211 * The updater methods are used to update column values in the 5212 * current row or the insert row. The updater methods do not 5213 * update the underlying database; instead the <code>updateRow</code> or 5214 * <code>insertRow</code> methods are called to update the database. 5215 * 5216 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 5217 * @param inputStream An object that contains the data to set the parameter 5218 * value to. 5219 * @param length the number of bytes in the parameter data. 5220 * @exception SQLException if a database access error occurs, 5221 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5222 * or this method is called on a closed result set 5223 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5224 * this method 5225 * @since 1.6 5226 */ 5227 public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { 5228 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5229 } 5230 5231 /** 5232 * Updates the designated column using the given input stream. 5233 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 5234 * parameter, it may be more practical to send it via a 5235 * <code>java.io.InputStream</code>. Data will be read from the stream 5236 * as needed until end-of-file is reached. The JDBC driver will 5237 * do any necessary conversion from ASCII to the database char format. 5238 * 5239 * <P><B>Note:</B> This stream object can either be a standard 5240 * Java stream object or your own subclass that implements the 5241 * standard interface. 5242 * 5243 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5244 * it might be more efficient to use a version of 5245 * <code>updateBlob</code> which takes a length parameter. 5246 * <p> 5247 * The updater methods are used to update column values in the 5248 * current row or the insert row. The updater methods do not 5249 * update the underlying database; instead the <code>updateRow</code> or 5250 * <code>insertRow</code> methods are called to update the database. 5251 * 5252 * @param columnIndex the first column is 1, the second is 2, ... 5253 * @param inputStream An object that contains the data to set the parameter 5254 * value to. 5255 * @exception SQLException if a database access error occurs, 5256 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5257 * or this method is called on a closed result set 5258 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5259 * this method 5260 * @since 1.6 5261 */ 5262 public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { 5263 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5264 } 5265 5266 /** 5267 * Updates the designated column using the given input stream. 5268 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 5269 * parameter, it may be more practical to send it via a 5270 * <code>java.io.InputStream</code>. Data will be read from the stream 5271 * as needed until end-of-file is reached. The JDBC driver will 5272 * do any necessary conversion from ASCII to the database char format. 5273 * 5274 * <P><B>Note:</B> This stream object can either be a standard 5275 * Java stream object or your own subclass that implements the 5276 * standard interface. 5277 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5278 * it might be more efficient to use a version of 5279 * <code>updateBlob</code> which takes a length parameter. 5280 * <p> 5281 * The updater methods are used to update column values in the 5282 * current row or the insert row. The updater methods do not 5283 * update the underlying database; instead the <code>updateRow</code> or 5284 * <code>insertRow</code> methods are called to update the database. 5285 * 5286 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5287 bel is the name of the column 5288 * @param inputStream An object that contains the data to set the parameter 5289 * value to. 5290 * @exception SQLException if a database access error occurs, 5291 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5292 * or this method is called on a closed result set 5293 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5294 * this method 5295 * @since 1.6 5296 */ 5297 public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { 5298 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5299 } 5300 5301 /** 5302 * Updates the designated column using the given <code>Reader</code> 5303 * object, which is the given number of characters long. 5304 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5305 * parameter, it may be more practical to send it via a 5306 * <code>java.io.Reader</code> object. The data will be read from the stream 5307 * as needed until end-of-file is reached. The JDBC driver will 5308 * do any necessary conversion from UNICODE to the database char format. 5309 * 5310 * <P><B>Note:</B> This stream object can either be a standard 5311 * Java stream object or your own subclass that implements the 5312 * standard interface. 5313 * <p> 5314 * The updater methods are used to update column values in the 5315 * current row or the insert row. The updater methods do not 5316 * update the underlying database; instead the <code>updateRow</code> or 5317 * <code>insertRow</code> methods are called to update the database. 5318 * 5319 * @param columnIndex the first column is 1, the second is 2, ... 5320 * @param reader An object that contains the data to set the parameter value to. 5321 * @param length the number of characters in the parameter data. 5322 * @exception SQLException if a database access error occurs, 5323 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5324 * or this method is called on a closed result set 5325 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5326 * this method 5327 * @since 1.6 5328 */ 5329 public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { 5330 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5331 } 5332 5333 /** 5334 * Updates the designated column using the given <code>Reader</code> 5335 * object, which is the given number of characters long. 5336 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5337 * parameter, it may be more practical to send it via a 5338 * <code>java.io.Reader</code> object. The data will be read from the stream 5339 * as needed until end-of-file is reached. The JDBC driver will 5340 * do any necessary conversion from UNICODE to the database char format. 5341 * 5342 * <P><B>Note:</B> This stream object can either be a standard 5343 * Java stream object or your own subclass that implements the 5344 * standard interface. 5345 * <p> 5346 * The updater methods are used to update column values in the 5347 * current row or the insert row. The updater methods do not 5348 * update the underlying database; instead the <code>updateRow</code> or 5349 * <code>insertRow</code> methods are called to update the database. 5350 * 5351 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 5352 * @param reader An object that contains the data to set the parameter value to. 5353 * @param length the number of characters in the parameter data. 5354 * @exception SQLException if a database access error occurs, 5355 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5356 * or this method is called on a closed result set 5357 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5358 * this method 5359 * @since 1.6 5360 */ 5361 public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { 5362 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5363 } 5364 5365 /** 5366 * Updates the designated column using the given <code>Reader</code> 5367 * object. 5368 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5369 * parameter, it may be more practical to send it via a 5370 * <code>java.io.Reader</code> object. The data will be read from the stream 5371 * as needed until end-of-file is reached. The JDBC driver will 5372 * do any necessary conversion from UNICODE to the database char format. 5373 * 5374 * <P><B>Note:</B> This stream object can either be a standard 5375 * Java stream object or your own subclass that implements the 5376 * standard interface. 5377 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5378 * it might be more efficient to use a version of 5379 * <code>updateClob</code> which takes a length parameter. 5380 * <p> 5381 * The updater methods are used to update column values in the 5382 * current row or the insert row. The updater methods do not 5383 * update the underlying database; instead the <code>updateRow</code> or 5384 * <code>insertRow</code> methods are called to update the database. 5385 * 5386 * @param columnIndex the first column is 1, the second is 2, ... 5387 * @param reader An object that contains the data to set the parameter value to. 5388 * @exception SQLException if a database access error occurs, 5389 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5390 * or this method is called on a closed result set 5391 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5392 * this method 5393 * @since 1.6 5394 */ 5395 public void updateClob(int columnIndex, Reader reader) throws SQLException { 5396 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5397 } 5398 5399 /** 5400 * Updates the designated column using the given <code>Reader</code> 5401 * object. 5402 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5403 * parameter, it may be more practical to send it via a 5404 * <code>java.io.Reader</code> object. The data will be read from the stream 5405 * as needed until end-of-file is reached. The JDBC driver will 5406 * do any necessary conversion from UNICODE to the database char format. 5407 * 5408 * <P><B>Note:</B> This stream object can either be a standard 5409 * Java stream object or your own subclass that implements the 5410 * standard interface. 5411 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5412 * it might be more efficient to use a version of 5413 * <code>updateClob</code> which takes a length parameter. 5414 * <p> 5415 * The updater methods are used to update column values in the 5416 * current row or the insert row. The updater methods do not 5417 * update the underlying database; instead the <code>updateRow</code> or 5418 * <code>insertRow</code> methods are called to update the database. 5419 * 5420 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5421 bel is the name of the column 5422 * @param reader An object that contains the data to set the parameter value to. 5423 * @exception SQLException if a database access error occurs, 5424 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5425 * or this method is called on a closed result set 5426 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5427 * this method 5428 * @since 1.6 5429 */ 5430 public void updateClob(String columnLabel, Reader reader) throws SQLException { 5431 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5432 } 5433 5434 /** 5435 * Updates the designated column using the given <code>Reader</code> 5436 * object, which is the given number of characters long. 5437 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5438 * parameter, it may be more practical to send it via a 5439 * <code>java.io.Reader</code> object. The data will be read from the stream 5440 * as needed until end-of-file is reached. The JDBC driver will 5441 * do any necessary conversion from UNICODE to the database char format. 5442 * 5443 * <P><B>Note:</B> This stream object can either be a standard 5444 * Java stream object or your own subclass that implements the 5445 * standard interface. 5446 * <p> 5447 * The updater methods are used to update column values in the 5448 * current row or the insert row. The updater methods do not 5449 * update the underlying database; instead the <code>updateRow</code> or 5450 * <code>insertRow</code> methods are called to update the database. 5451 * 5452 * @param columnIndex the first column is 1, the second 2, ... 5453 * @param reader An object that contains the data to set the parameter value to. 5454 * @param length the number of characters in the parameter data. 5455 * @throws SQLException if the driver does not support national 5456 * character sets; if the driver can detect that a data conversion 5457 * error could occur; this method is called on a closed result set, 5458 * if a database access error occurs or 5459 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5460 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5461 * this method 5462 * @since 1.6 5463 */ 5464 public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { 5465 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5466 } 5467 5468 /** 5469 * Updates the designated column using the given <code>Reader</code> 5470 * object, which is the given number of characters long. 5471 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5472 * parameter, it may be more practical to send it via a 5473 * <code>java.io.Reader</code> object. The data will be read from the stream 5474 * as needed until end-of-file is reached. The JDBC driver will 5475 * do any necessary conversion from UNICODE to the database char format. 5476 * 5477 * <P><B>Note:</B> This stream object can either be a standard 5478 * Java stream object or your own subclass that implements the 5479 * standard interface. 5480 * <p> 5481 * The updater methods are used to update column values in the 5482 * current row or the insert row. The updater methods do not 5483 * update the underlying database; instead the <code>updateRow</code> or 5484 * <code>insertRow</code> methods are called to update the database. 5485 * 5486 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 5487 * @param reader An object that contains the data to set the parameter value to. 5488 * @param length the number of characters in the parameter data. 5489 * @throws SQLException if the driver does not support national 5490 * character sets; if the driver can detect that a data conversion 5491 * error could occur; this method is called on a closed result set; 5492 * if a database access error occurs or 5493 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5494 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5495 * this method 5496 * @since 1.6 5497 */ 5498 public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { 5499 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5500 } 5501 5502 /** 5503 * Updates the designated column using the given <code>Reader</code> 5504 * object. 5505 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5506 * parameter, it may be more practical to send it via a 5507 * <code>java.io.Reader</code> object. The data will be read from the stream 5508 * as needed until end-of-file is reached. The JDBC driver will 5509 * do any necessary conversion from UNICODE to the database char format. 5510 * 5511 * <P><B>Note:</B> This stream object can either be a standard 5512 * Java stream object or your own subclass that implements the 5513 * standard interface. 5514 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5515 * it might be more efficient to use a version of 5516 * <code>updateNClob</code> which takes a length parameter. 5517 * <p> 5518 * The updater methods are used to update column values in the 5519 * current row or the insert row. The updater methods do not 5520 * update the underlying database; instead the <code>updateRow</code> or 5521 * <code>insertRow</code> methods are called to update the database. 5522 * 5523 * @param columnIndex the first column is 1, the second 2, ... 5524 * @param reader An object that contains the data to set the parameter value to. 5525 * @throws SQLException if the driver does not support national 5526 * character sets; if the driver can detect that a data conversion 5527 * error could occur; this method is called on a closed result set, 5528 * if a database access error occurs or 5529 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5530 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5531 * this method 5532 * @since 1.6 5533 */ 5534 public void updateNClob(int columnIndex, Reader reader) throws SQLException { 5535 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5536 } 5537 5538 /** 5539 * Updates the designated column using the given <code>Reader</code> 5540 * object. 5541 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 5542 * parameter, it may be more practical to send it via a 5543 * <code>java.io.Reader</code> object. The data will be read from the stream 5544 * as needed until end-of-file is reached. The JDBC driver will 5545 * do any necessary conversion from UNICODE to the database char format. 5546 * 5547 * <P><B>Note:</B> This stream object can either be a standard 5548 * Java stream object or your own subclass that implements the 5549 * standard interface. 5550 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5551 * it might be more efficient to use a version of 5552 * <code>updateNClob</code> which takes a length parameter. 5553 * <p> 5554 * The updater methods are used to update column values in the 5555 * current row or the insert row. The updater methods do not 5556 * update the underlying database; instead the <code>updateRow</code> or 5557 * <code>insertRow</code> methods are called to update the database. 5558 * 5559 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5560 bel is the name of the column 5561 * @param reader An object that contains the data to set the parameter value to. 5562 * @throws SQLException if the driver does not support national 5563 * character sets; if the driver can detect that a data conversion 5564 * error could occur; this method is called on a closed result set; 5565 * if a database access error occurs or 5566 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5567 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5568 * this method 5569 * @since 1.6 5570 */ 5571 public void updateNClob(String columnLabel, Reader reader) throws SQLException { 5572 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5573 } 5574 5575 5576 /** 5577 * Updates the designated column with an ascii stream value, which will have 5578 * the specified number of bytes. 5579 * The updater methods are used to update column values in the 5580 * current row or the insert row. The updater methods do not 5581 * update the underlying database; instead the <code>updateRow</code> or 5582 * <code>insertRow</code> methods are called to update the database. 5583 * 5584 * @param columnIndex the first column is 1, the second is 2, ... 5585 * @param x the new column value 5586 * @param length the length of the stream 5587 * @exception SQLException if a database access error occurs, 5588 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5589 * or this method is called on a closed result set 5590 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5591 * this method 5592 * @since 1.6 5593 */ 5594 public void updateAsciiStream(int columnIndex, 5595 java.io.InputStream x, 5596 long length) throws SQLException { 5597 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5598 } 5599 5600 /** 5601 * Updates the designated column with a binary stream value, which will have 5602 * the specified number of bytes. 5603 * The updater methods are used to update column values in the 5604 * current row or the insert row. The updater methods do not 5605 * update the underlying database; instead the <code>updateRow</code> or 5606 * <code>insertRow</code> methods are called to update the database. 5607 * 5608 * @param columnIndex the first column is 1, the second is 2, ... 5609 * @param x the new column value 5610 * @param length the length of the stream 5611 * @exception SQLException if a database access error occurs, 5612 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5613 * or this method is called on a closed result set 5614 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5615 * this method 5616 * @since 1.6 5617 */ 5618 public void updateBinaryStream(int columnIndex, 5619 java.io.InputStream x, 5620 long length) throws SQLException { 5621 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5622 } 5623 5624 /** 5625 * Updates the designated column with a character stream value, which will have 5626 * the specified number of bytes. 5627 * The updater methods are used to update column values in the 5628 * current row or the insert row. The updater methods do not 5629 * update the underlying database; instead the <code>updateRow</code> or 5630 * <code>insertRow</code> methods are called to update the database. 5631 * 5632 * @param columnIndex the first column is 1, the second is 2, ... 5633 * @param x the new column value 5634 * @param length the length of the stream 5635 * @exception SQLException if a database access error occurs, 5636 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5637 * or this method is called on a closed result set 5638 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5639 * this method 5640 * @since 1.6 5641 */ 5642 public void updateCharacterStream(int columnIndex, 5643 java.io.Reader x, 5644 long length) throws SQLException { 5645 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5646 } 5647 5648 /** 5649 * Updates the designated column with an ascii stream value, which will have 5650 * the specified number of bytes.. 5651 * The updater methods are used to update column values in the 5652 * current row or the insert row. The updater methods do not 5653 * update the underlying database; instead the <code>updateRow</code> or 5654 * <code>insertRow</code> methods are called to update the database. 5655 * 5656 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 5657 * @param x the new column value 5658 * @param length the length of the stream 5659 * @exception SQLException if a database access error occurs, 5660 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5661 * or this method is called on a closed result set 5662 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5663 * this method 5664 * @since 1.6 5665 */ 5666 public void updateAsciiStream(String columnLabel, 5667 java.io.InputStream x, 5668 long length) throws SQLException { 5669 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5670 } 5671 5672 /** 5673 * Updates the designated column with an ascii stream value. 5674 * The updater methods are used to update column values in the 5675 * current row or the insert row. The updater methods do not 5676 * update the underlying database; instead the <code>updateRow</code> or 5677 * <code>insertRow</code> methods are called to update the database. 5678 * 5679 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5680 * it might be more efficient to use a version of 5681 * <code>updateAsciiStream</code> which takes a length parameter. 5682 * 5683 * @param columnIndex the first column is 1, the second is 2, ... 5684 * @param x the new column value 5685 * @exception SQLException if a database access error occurs, 5686 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5687 * or this method is called on a closed result set 5688 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5689 * this method 5690 * @since 1.6 5691 */ 5692 public void updateAsciiStream(int columnIndex, 5693 java.io.InputStream x) throws SQLException { 5694 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5695 } 5696 5697 /** 5698 * Updates the designated column with an ascii stream value. 5699 * The updater methods are used to update column values in the 5700 * current row or the insert row. The updater methods do not 5701 * update the underlying database; instead the <code>updateRow</code> or 5702 * <code>insertRow</code> methods are called to update the database. 5703 * 5704 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5705 * it might be more efficient to use a version of 5706 * <code>updateAsciiStream</code> which takes a length parameter. 5707 * 5708 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5709 bel is the name of the column 5710 * @param x the new column value 5711 * @exception SQLException if a database access error occurs, 5712 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5713 * or this method is called on a closed result set 5714 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5715 * this method 5716 * @since 1.6 5717 */ 5718 public void updateAsciiStream(String columnLabel, 5719 java.io.InputStream x) throws SQLException { 5720 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5721 } 5722 5723 5724 /** 5725 * Updates the designated column with a binary stream value, which will have 5726 * the specified number of bytes. 5727 * The updater methods are used to update column values in the 5728 * current row or the insert row. The updater methods do not 5729 * update the underlying database; instead the <code>updateRow</code> or 5730 * <code>insertRow</code> methods are called to update the database. 5731 * 5732 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 5733 * @param x the new column value 5734 * @param length the length of the stream 5735 * @exception SQLException if a database access error occurs, 5736 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5737 * or this method is called on a closed result set 5738 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5739 * this method 5740 * @since 1.6 5741 */ 5742 public void updateBinaryStream(String columnLabel, 5743 java.io.InputStream x, 5744 long length) throws SQLException { 5745 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5746 } 5747 5748 /** 5749 * Updates the designated column with a binary stream value. 5750 * The updater methods are used to update column values in the 5751 * current row or the insert row. The updater methods do not 5752 * update the underlying database; instead the <code>updateRow</code> or 5753 * <code>insertRow</code> methods are called to update the database. 5754 * 5755 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5756 * it might be more efficient to use a version of 5757 * <code>updateBinaryStream</code> which takes a length parameter. 5758 * 5759 * @param columnIndex the first column is 1, the second is 2, ... 5760 * @param x the new column value 5761 * @exception SQLException if a database access error occurs, 5762 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5763 * or this method is called on a closed result set 5764 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5765 * this method 5766 * @since 1.6 5767 */ 5768 public void updateBinaryStream(int columnIndex, 5769 java.io.InputStream x) throws SQLException { 5770 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5771 } 5772 5773 5774 /** 5775 * Updates the designated column with a binary stream value. 5776 * The updater methods are used to update column values in the 5777 * current row or the insert row. The updater methods do not 5778 * update the underlying database; instead the <code>updateRow</code> or 5779 * <code>insertRow</code> methods are called to update the database. 5780 * 5781 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5782 * it might be more efficient to use a version of 5783 * <code>updateBinaryStream</code> which takes a length parameter. 5784 * 5785 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5786 bel is the name of the column 5787 * @param x the new column value 5788 * @exception SQLException if a database access error occurs, 5789 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5790 * or this method is called on a closed result set 5791 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5792 * this method 5793 * @since 1.6 5794 */ 5795 public void updateBinaryStream(String columnLabel, 5796 java.io.InputStream x) throws SQLException { 5797 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5798 } 5799 5800 5801 /** 5802 * Updates the designated column with a character stream value, which will have 5803 * the specified number of bytes. 5804 * The updater methods are used to update column values in the 5805 * current row or the insert row. The updater methods do not 5806 * update the underlying database; instead the <code>updateRow</code> or 5807 * <code>insertRow</code> methods are called to update the database. 5808 * 5809 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 5810 * @param reader the <code>java.io.Reader</code> object containing 5811 * the new column value 5812 * @param length the length of the stream 5813 * @exception SQLException if a database access error occurs, 5814 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5815 * or this method is called on a closed result set 5816 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5817 * this method 5818 * @since 1.6 5819 */ 5820 public void updateCharacterStream(String columnLabel, 5821 java.io.Reader reader, 5822 long length) throws SQLException { 5823 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5824 } 5825 5826 /** 5827 * Updates the designated column with a character stream value. 5828 * The updater methods are used to update column values in the 5829 * current row or the insert row. The updater methods do not 5830 * update the underlying database; instead the <code>updateRow</code> or 5831 * <code>insertRow</code> methods are called to update the database. 5832 * 5833 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5834 * it might be more efficient to use a version of 5835 * <code>updateCharacterStream</code> which takes a length parameter. 5836 * 5837 * @param columnIndex the first column is 1, the second is 2, ... 5838 * @param x the new column value 5839 * @exception SQLException if a database access error occurs, 5840 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5841 * or this method is called on a closed result set 5842 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5843 * this method 5844 * @since 1.6 5845 */ 5846 public void updateCharacterStream(int columnIndex, 5847 java.io.Reader x) throws SQLException { 5848 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5849 } 5850 5851 /** 5852 * Updates the designated column with a character stream value. 5853 * The updater methods are used to update column values in the 5854 * current row or the insert row. The updater methods do not 5855 * update the underlying database; instead the <code>updateRow</code> or 5856 * <code>insertRow</code> methods are called to update the database. 5857 * 5858 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5859 * it might be more efficient to use a version of 5860 * <code>updateCharacterStream</code> which takes a length parameter. 5861 * 5862 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the la 5863 bel is the name of the column 5864 * @param reader the <code>java.io.Reader</code> object containing 5865 * the new column value 5866 * @exception SQLException if a database access error occurs, 5867 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 5868 * or this method is called on a closed result set 5869 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5870 * this method 5871 * @since 1.6 5872 */ 5873 public void updateCharacterStream(String columnLabel, 5874 java.io.Reader reader) throws SQLException { 5875 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5876 } 5877 5878 5879 /** 5880 * Sets the designated parameter to the given <code>java.net.URL</code> value. 5881 * The driver converts this to an SQL <code>DATALINK</code> value 5882 * when it sends it to the database. 5883 * 5884 * @param parameterIndex the first parameter is 1, the second is 2, ... 5885 * @param x the <code>java.net.URL</code> object to be set 5886 * @exception SQLException if a database access error occurs or 5887 * this method is called on a closed <code>PreparedStatement</code> 5888 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 5889 * @since 1.4 5890 */ 5891 public void setURL(int parameterIndex, java.net.URL x) throws SQLException{ 5892 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5893 } 5894 5895 5896 /** 5897 * Sets the designated parameter to a <code>Reader</code> object. 5898 * This method differs from the <code>setCharacterStream (int, Reader)</code> method 5899 * because it informs the driver that the parameter value should be sent to 5900 * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the 5901 * driver may have to do extra work to determine whether the parameter 5902 * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code> 5903 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5904 * it might be more efficient to use a version of 5905 * <code>setNClob</code> which takes a length parameter. 5906 * 5907 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 5908 * @param reader An object that contains the data to set the parameter value to. 5909 * @throws SQLException if parameterIndex does not correspond to a parameter 5910 * marker in the SQL statement; 5911 * if the driver does not support national character sets; 5912 * if the driver can detect that a data conversion 5913 * error could occur; if a database access error occurs or 5914 * this method is called on a closed <code>PreparedStatement</code> 5915 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 5916 * 5917 * @since 1.6 5918 */ 5919 public void setNClob(int parameterIndex, Reader reader) 5920 throws SQLException{ 5921 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5922 } 5923 5924 /** 5925 * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number 5926 * of characters specified by length otherwise a <code>SQLException</code> will be 5927 * generated when the <code>CallableStatement</code> is executed. 5928 * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method 5929 * because it informs the driver that the parameter value should be sent to 5930 * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the 5931 * driver may have to do extra work to determine whether the parameter 5932 * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code> 5933 * 5934 * @param parameterName the name of the parameter to be set 5935 * @param reader An object that contains the data to set the parameter value to. 5936 * @param length the number of characters in the parameter data. 5937 * @throws SQLException if parameterIndex does not correspond to a parameter 5938 * marker in the SQL statement; if the length specified is less than zero; 5939 * if the driver does not support national 5940 * character sets; if the driver can detect that a data conversion 5941 * error could occur; if a database access error occurs or 5942 * this method is called on a closed <code>CallableStatement</code> 5943 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 5944 * this method 5945 * @since 1.6 5946 */ 5947 public void setNClob(String parameterName, Reader reader, long length) 5948 throws SQLException{ 5949 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5950 } 5951 5952 5953 /** 5954 * Sets the designated parameter to a <code>Reader</code> object. 5955 * This method differs from the <code>setCharacterStream (int, Reader)</code> method 5956 * because it informs the driver that the parameter value should be sent to 5957 * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the 5958 * driver may have to do extra work to determine whether the parameter 5959 * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code> 5960 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 5961 * it might be more efficient to use a version of 5962 * <code>setNClob</code> which takes a length parameter. 5963 * 5964 * @param parameterName the name of the parameter 5965 * @param reader An object that contains the data to set the parameter value to. 5966 * @throws SQLException if the driver does not support national character sets; 5967 * if the driver can detect that a data conversion 5968 * error could occur; if a database access error occurs or 5969 * this method is called on a closed <code>CallableStatement</code> 5970 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 5971 * 5972 * @since 1.6 5973 */ 5974 public void setNClob(String parameterName, Reader reader) 5975 throws SQLException{ 5976 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 5977 } 5978 5979 5980 /** 5981 ** of characters specified by length otherwise a <code>SQLException</code> will becontain the number 5982 * generated when the <code>PreparedStatement</code> is executed. 5983 * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method 5984 * because it informs the driver that the parameter value should be sent to 5985 * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the 5986 * driver may have to do extra work to determine whether the parameter 5987 * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code> 5988 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 5989 * @param reader An object that contains the data to set the parameter value to. 5990 * @param length the number of characters in the parameter data. 5991 * @throws SQLException if parameterIndex does not correspond to a parameter 5992 * marker in the SQL statement; if the length specified is less than zero; 5993 * if the driver does not support national character sets; 5994 * if the driver can detect that a data conversion 5995 * error could occur; if a database access error occurs or 5996 * this method is called on a closed <code>PreparedStatement</code> 5997 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 5998 * 5999 * @since 1.6 6000 */ 6001 public void setNClob(int parameterIndex, Reader reader, long length) 6002 throws SQLException{ 6003 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6004 } 6005 6006 6007 /** 6008 * Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this to 6009 a 6010 * SQL <code>NCLOB</code> value when it sends it to the database. 6011 * @param parameterIndex of the first parameter is 1, the second is 2, ... 6012 * @param value the parameter value 6013 * @throws SQLException if the driver does not support national 6014 * character sets; if the driver can detect that a data conversion 6015 * error could occur ; or if a database access error occurs 6016 * @since 1.6 6017 */ 6018 public void setNClob(int parameterIndex, NClob value) throws SQLException{ 6019 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6020 } 6021 6022 6023 /** 6024 * Sets the designated paramter to the given <code>String</code> object. 6025 * The driver converts this to a SQL <code>NCHAR</code> or 6026 * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> 6027 * @param parameterName the name of the column to be set 6028 * @param value the parameter value 6029 * @throws SQLException if the driver does not support national 6030 * character sets; if the driver can detect that a data conversion 6031 * error could occur; or if a database access error occurs 6032 * @since 1.6 6033 */ 6034 public void setNString(String parameterName, String value) 6035 throws SQLException{ 6036 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6037 } 6038 6039 /** 6040 * Sets the designated parameter to a <code>Reader</code> object. The 6041 * <code>Reader</code> reads the data till end-of-file is reached. The 6042 * driver does the necessary conversion from Java character format to 6043 * the national character set in the database. 6044 * @param parameterIndex of the first parameter is 1, the second is 2, ... 6045 * @param value the parameter value 6046 * @param length the number of characters in the parameter data. 6047 * @throws SQLException if the driver does not support national 6048 * character sets; if the driver can detect that a data conversion 6049 * error could occur ; or if a database access error occurs 6050 * @since 1.6 6051 */ 6052 public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException{ 6053 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6054 } 6055 6056 6057 6058 /** 6059 * Sets the designated parameter to a <code>Reader</code> object. The 6060 * <code>Reader</code> reads the data till end-of-file is reached. The 6061 * driver does the necessary conversion from Java character format to 6062 * the national character set in the database. 6063 * @param parameterName the name of the column to be set 6064 * @param value the parameter value 6065 * @param length the number of characters in the parameter data. 6066 * @throws SQLException if the driver does not support national 6067 * character sets; if the driver can detect that a data conversion 6068 * error could occur; or if a database access error occurs 6069 * @since 1.6 6070 */ 6071 public void setNCharacterStream(String parameterName, Reader value, long length) 6072 throws SQLException{ 6073 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6074 } 6075 6076 /** 6077 * Sets the designated parameter to a <code>Reader</code> object. The 6078 * <code>Reader</code> reads the data till end-of-file is reached. The 6079 * driver does the necessary conversion from Java character format to 6080 * the national character set in the database. 6081 6082 * <P><B>Note:</B> This stream object can either be a standard 6083 * Java stream object or your own subclass that implements the 6084 * standard interface. 6085 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6086 * it might be more efficient to use a version of 6087 * <code>setNCharacterStream</code> which takes a length parameter. 6088 * 6089 * @param parameterName the name of the parameter 6090 * @param value the parameter value 6091 * @throws SQLException if the driver does not support national 6092 * character sets; if the driver can detect that a data conversion 6093 * error could occur ; if a database access error occurs; or 6094 * this method is called on a closed <code>CallableStatement</code> 6095 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6096 * @since 1.6 6097 */ 6098 public void setNCharacterStream(String parameterName, Reader value) throws SQLException{ 6099 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6100 } 6101 6102 /** 6103 * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value, 6104 * using the given <code>Calendar</code> object. The driver uses 6105 * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value, 6106 * which the driver then sends to the database. With a 6107 * a <code>Calendar</code> object, the driver can calculate the timestamp 6108 * taking into account a custom timezone. If no 6109 * <code>Calendar</code> object is specified, the driver uses the default 6110 * timezone, which is that of the virtual machine running the application. 6111 * 6112 * @param parameterName the name of the parameter 6113 * @param x the parameter value 6114 * @param cal the <code>Calendar</code> object the driver will use 6115 * to construct the timestamp 6116 * @exception SQLException if a database access error occurs or 6117 * this method is called on a closed <code>CallableStatement</code> 6118 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6119 * this method 6120 * @see #getTimestamp 6121 * @since 1.4 6122 */ 6123 public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal) 6124 throws SQLException{ 6125 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6126 } 6127 6128 /** 6129 * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number 6130 * of characters specified by length otherwise a <code>SQLException</code> will be 6131 * generated when the <code>CallableStatement</code> is executed. 6132 * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method 6133 * because it informs the driver that the parameter value should be sent to 6134 * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the 6135 * driver may have to do extra work to determine whether the parameter 6136 * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code> 6137 * @param parameterName the name of the parameter to be set 6138 * @param reader An object that contains the data to set the parameter value to. 6139 * @param length the number of characters in the parameter data. 6140 * @throws SQLException if parameterIndex does not correspond to a parameter 6141 * marker in the SQL statement; if the length specified is less than zero; 6142 * a database access error occurs or 6143 * this method is called on a closed <code>CallableStatement</code> 6144 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6145 * this method 6146 * 6147 * @since 1.6 6148 */ 6149 public void setClob(String parameterName, Reader reader, long length) 6150 throws SQLException{ 6151 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6152 } 6153 6154 6155 6156 /** 6157 * Sets the designated parameter to the given <code>java.sql.Clob</code> object. 6158 * The driver converts this to an SQL <code>CLOB</code> value when it 6159 * sends it to the database. 6160 * 6161 * @param parameterName the name of the parameter 6162 * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value 6163 * @exception SQLException if a database access error occurs or 6164 * this method is called on a closed <code>CallableStatement</code> 6165 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6166 * this method 6167 * @since 1.6 6168 */ 6169 public void setClob (String parameterName, Clob x) throws SQLException{ 6170 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6171 } 6172 6173 /** 6174 * Sets the designated parameter to a <code>Reader</code> object. 6175 * This method differs from the <code>setCharacterStream (int, Reader)</code> method 6176 * because it informs the driver that the parameter value should be sent to 6177 * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the 6178 * driver may have to do extra work to determine whether the parameter 6179 * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code> 6180 * 6181 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6182 * it might be more efficient to use a version of 6183 * <code>setClob</code> which takes a length parameter. 6184 * 6185 * @param parameterName the name of the parameter 6186 * @param reader An object that contains the data to set the parameter value to. 6187 * @throws SQLException if a database access error occurs or this method is called on 6188 * a closed <code>CallableStatement</code> 6189 * 6190 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6191 * @since 1.6 6192 */ 6193 public void setClob(String parameterName, Reader reader) 6194 throws SQLException{ 6195 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6196 } 6197 6198 6199 /** 6200 * Sets the designated parameter to the given <code>java.sql.Date</code> value 6201 * using the default time zone of the virtual machine that is running 6202 * the application. 6203 * The driver converts this 6204 * to an SQL <code>DATE</code> value when it sends it to the database. 6205 * 6206 * @param parameterName the name of the parameter 6207 * @param x the parameter value 6208 * @exception SQLException if a database access error occurs or 6209 * this method is called on a closed <code>CallableStatement</code> 6210 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6211 * this method 6212 * @see #getDate 6213 * @since 1.4 6214 */ 6215 public void setDate(String parameterName, java.sql.Date x) 6216 throws SQLException{ 6217 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6218 } 6219 6220 /** 6221 * Sets the designated parameter to the given <code>java.sql.Date</code> value, 6222 * using the given <code>Calendar</code> object. The driver uses 6223 * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value, 6224 * which the driver then sends to the database. With a 6225 * a <code>Calendar</code> object, the driver can calculate the date 6226 * taking into account a custom timezone. If no 6227 * <code>Calendar</code> object is specified, the driver uses the default 6228 * timezone, which is that of the virtual machine running the application. 6229 * 6230 * @param parameterName the name of the parameter 6231 * @param x the parameter value 6232 * @param cal the <code>Calendar</code> object the driver will use 6233 * to construct the date 6234 * @exception SQLException if a database access error occurs or 6235 * this method is called on a closed <code>CallableStatement</code> 6236 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6237 * this method 6238 * @see #getDate 6239 * @since 1.4 6240 */ 6241 public void setDate(String parameterName, java.sql.Date x, Calendar cal) 6242 throws SQLException{ 6243 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6244 } 6245 6246 6247 /** 6248 * Sets the designated parameter to the given <code>java.sql.Time</code> value. 6249 * The driver converts this 6250 * to an SQL <code>TIME</code> value when it sends it to the database. 6251 * 6252 * @param parameterName the name of the parameter 6253 * @param x the parameter value 6254 * @exception SQLException if a database access error occurs or 6255 * this method is called on a closed <code>CallableStatement</code> 6256 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6257 * this method 6258 * @see #getTime 6259 * @since 1.4 6260 */ 6261 public void setTime(String parameterName, java.sql.Time x) 6262 throws SQLException{ 6263 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6264 } 6265 6266 /** 6267 * Sets the designated parameter to the given <code>java.sql.Time</code> value, 6268 * using the given <code>Calendar</code> object. The driver uses 6269 * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value, 6270 * which the driver then sends to the database. With a 6271 * a <code>Calendar</code> object, the driver can calculate the time 6272 * taking into account a custom timezone. If no 6273 * <code>Calendar</code> object is specified, the driver uses the default 6274 * timezone, which is that of the virtual machine running the application. 6275 * 6276 * @param parameterName the name of the parameter 6277 * @param x the parameter value 6278 * @param cal the <code>Calendar</code> object the driver will use 6279 * to construct the time 6280 * @exception SQLException if a database access error occurs or 6281 * this method is called on a closed <code>CallableStatement</code> 6282 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6283 * this method 6284 * @see #getTime 6285 * @since 1.4 6286 */ 6287 public void setTime(String parameterName, java.sql.Time x, Calendar cal) 6288 throws SQLException{ 6289 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6290 } 6291 6292 /** 6293 * Sets the designated parameter to a <code>Reader</code> object. 6294 * This method differs from the <code>setCharacterStream (int, Reader)</code> method 6295 * because it informs the driver that the parameter value should be sent to 6296 * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the 6297 * driver may have to do extra work to determine whether the parameter 6298 * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code> 6299 * 6300 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6301 * it might be more efficient to use a version of 6302 * <code>setClob</code> which takes a length parameter. 6303 * 6304 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 6305 * @param reader An object that contains the data to set the parameter value to. 6306 * @throws SQLException if a database access error occurs, this method is called on 6307 * a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter 6308 * marker in the SQL statement 6309 * 6310 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6311 * @since 1.6 6312 */ 6313 public void setClob(int parameterIndex, Reader reader) 6314 throws SQLException{ 6315 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6316 } 6317 6318 6319 /** 6320 * Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number 6321 * of characters specified by length otherwise a <code>SQLException</code> will be 6322 * generated when the <code>PreparedStatement</code> is executed. 6323 *This method differs from the <code>setCharacterStream (int, Reader, int)</code> method 6324 * because it informs the driver that the parameter value should be sent to 6325 * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the 6326 * driver may have to do extra work to determine whether the parameter 6327 * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code> 6328 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 6329 * @param reader An object that contains the data to set the parameter value to. 6330 * @param length the number of characters in the parameter data. 6331 * @throws SQLException if a database access error occurs, this method is called on 6332 * a closed <code>PreparedStatement</code>, if parameterIndex does not correspond to a parameter 6333 * marker in the SQL statement, or if the length specified is less than zero. 6334 * 6335 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6336 * @since 1.6 6337 */ 6338 public void setClob(int parameterIndex, Reader reader, long length) 6339 throws SQLException{ 6340 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6341 } 6342 6343 6344 /** 6345 * Sets the designated parameter to a <code>InputStream</code> object. The inputstream must contain the number 6346 * of characters specified by length otherwise a <code>SQLException</code> will be 6347 * generated when the <code>PreparedStatement</code> is executed. 6348 * This method differs from the <code>setBinaryStream (int, InputStream, int)</code> 6349 * method because it informs the driver that the parameter value should be 6350 * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, 6351 * the driver may have to do extra work to determine whether the parameter 6352 * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code> 6353 * @param parameterIndex index of the first parameter is 1, 6354 * the second is 2, ... 6355 * @param inputStream An object that contains the data to set the parameter 6356 * value to. 6357 * @param length the number of bytes in the parameter data. 6358 * @throws SQLException if a database access error occurs, 6359 * this method is called on a closed <code>PreparedStatement</code>, 6360 * if parameterIndex does not correspond 6361 * to a parameter marker in the SQL statement, if the length specified 6362 * is less than zero or if the number of bytes in the inputstream does not match 6363 * the specfied length. 6364 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6365 * 6366 * @since 1.6 6367 */ 6368 public void setBlob(int parameterIndex, InputStream inputStream, long length) 6369 throws SQLException{ 6370 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6371 } 6372 6373 /** 6374 * Sets the designated parameter to a <code>InputStream</code> object. 6375 * This method differs from the <code>setBinaryStream (int, InputStream)</code> 6376 * This method differs from the <code>setBinaryStream (int, InputStream)</code> 6377 * method because it informs the driver that the parameter value should be 6378 * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, 6379 * the driver may have to do extra work to determine whether the parameter 6380 * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code> 6381 * 6382 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6383 * it might be more efficient to use a version of 6384 * <code>setBlob</code> which takes a length parameter. 6385 * 6386 * @param parameterIndex index of the first parameter is 1, 6387 * the second is 2, ... 6388 6389 6390 * @param inputStream An object that contains the data to set the parameter 6391 * value to. 6392 * @throws SQLException if a database access error occurs, 6393 * this method is called on a closed <code>PreparedStatement</code> or 6394 * if parameterIndex does not correspond 6395 * to a parameter marker in the SQL statement, 6396 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6397 * 6398 * @since 1.6 6399 */ 6400 public void setBlob(int parameterIndex, InputStream inputStream) 6401 throws SQLException{ 6402 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6403 } 6404 6405 /** 6406 * Sets the designated parameter to a <code>InputStream</code> object. The <code>inputstream</code> must contain the number 6407 * of characters specified by length, otherwise a <code>SQLException</code> will be 6408 * generated when the <code>CallableStatement</code> is executed. 6409 * This method differs from the <code>setBinaryStream (int, InputStream, int)</code> 6410 * method because it informs the driver that the parameter value should be 6411 * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, 6412 * the driver may have to do extra work to determine whether the parameter 6413 * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code> 6414 * 6415 * @param parameterName the name of the parameter to be set 6416 * the second is 2, ... 6417 * 6418 * @param inputStream An object that contains the data to set the parameter 6419 * value to. 6420 * @param length the number of bytes in the parameter data. 6421 * @throws SQLException if parameterIndex does not correspond 6422 * to a parameter marker in the SQL statement, or if the length specified 6423 * is less than zero; if the number of bytes in the inputstream does not match 6424 * the specfied length; if a database access error occurs or 6425 * this method is called on a closed <code>CallableStatement</code> 6426 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6427 * this method 6428 * 6429 * @since 1.6 6430 */ 6431 public void setBlob(String parameterName, InputStream inputStream, long length) 6432 throws SQLException{ 6433 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6434 } 6435 6436 6437 /** 6438 * Sets the designated parameter to the given <code>java.sql.Blob</code> object. 6439 * The driver converts this to an SQL <code>BLOB</code> value when it 6440 * sends it to the database. 6441 * 6442 * @param parameterName the name of the parameter 6443 * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value 6444 * @exception SQLException if a database access error occurs or 6445 * this method is called on a closed <code>CallableStatement</code> 6446 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6447 * this method 6448 * @since 1.6 6449 */ 6450 public void setBlob (String parameterName, Blob x) throws SQLException{ 6451 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6452 } 6453 6454 /** 6455 * Sets the designated parameter to a <code>InputStream</code> object. 6456 * This method differs from the <code>setBinaryStream (int, InputStream)</code> 6457 * method because it informs the driver that the parameter value should be 6458 * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, 6459 * the driver may have to do extra work to determine whether the parameter 6460 * data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code> 6461 * 6462 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6463 * it might be more efficient to use a version of 6464 * <code>setBlob</code> which takes a length parameter. 6465 * 6466 * @param parameterName the name of the parameter 6467 * @param inputStream An object that contains the data to set the parameter 6468 * value to. 6469 * @throws SQLException if a database access error occurs or 6470 * this method is called on a closed <code>CallableStatement</code> 6471 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6472 * 6473 * @since 1.6 6474 */ 6475 public void setBlob(String parameterName, InputStream inputStream) 6476 throws SQLException{ 6477 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6478 } 6479 6480 /** 6481 * Sets the value of the designated parameter with the given object. The second 6482 * argument must be an object type; for integral values, the 6483 * <code>java.lang</code> equivalent objects should be used. 6484 * 6485 * <p>The given Java object will be converted to the given targetSqlType 6486 * before being sent to the database. 6487 * 6488 * If the object has a custom mapping (is of a class implementing the 6489 * interface <code>SQLData</code>), 6490 * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it 6491 * to the SQL data stream. 6492 * If, on the other hand, the object is of a class implementing 6493 * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>, 6494 * <code>Struct</code>, <code>java.net.URL</code>, 6495 * or <code>Array</code>, the driver should pass it to the database as a 6496 * value of the corresponding SQL type. 6497 * <P> 6498 * Note that this method may be used to pass datatabase- 6499 * specific abstract data types. 6500 * 6501 * @param parameterName the name of the parameter 6502 * @param x the object containing the input parameter value 6503 * @param targetSqlType the SQL type (as defined in java.sql.Types) to be 6504 * sent to the database. The scale argument may further qualify this type. 6505 * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, 6506 * this is the number of digits after the decimal point. For all other 6507 * types, this value will be ignored. 6508 * @exception SQLException if a database access error occurs or 6509 * this method is called on a closed <code>CallableStatement</code> 6510 * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is 6511 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 6512 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 6513 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 6514 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 6515 * or <code>STRUCT</code> data type and the JDBC driver does not support 6516 * this data type 6517 * @see Types 6518 * @see #getObject 6519 * @since 1.4 6520 */ 6521 public void setObject(String parameterName, Object x, int targetSqlType, int scale) 6522 throws SQLException{ 6523 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6524 } 6525 6526 /** 6527 * Sets the value of the designated parameter with the given object. 6528 * This method is like the method <code>setObject</code> 6529 * above, except that it assumes a scale of zero. 6530 * 6531 * @param parameterName the name of the parameter 6532 * @param x the object containing the input parameter value 6533 * @param targetSqlType the SQL type (as defined in java.sql.Types) to be 6534 * sent to the database 6535 * @exception SQLException if a database access error occurs or 6536 * this method is called on a closed <code>CallableStatement</code> 6537 * @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is 6538 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 6539 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 6540 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 6541 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 6542 * or <code>STRUCT</code> data type and the JDBC driver does not support 6543 * this data type 6544 * @see #getObject 6545 * @since 1.4 6546 */ 6547 public void setObject(String parameterName, Object x, int targetSqlType) 6548 throws SQLException{ 6549 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6550 } 6551 6552 /** 6553 * Sets the value of the designated parameter with the given object. 6554 * The second parameter must be of type <code>Object</code>; therefore, the 6555 * <code>java.lang</code> equivalent objects should be used for built-in types. 6556 * 6557 * <p>The JDBC specification specifies a standard mapping from 6558 * Java <code>Object</code> types to SQL types. The given argument 6559 * will be converted to the corresponding SQL type before being 6560 * sent to the database. 6561 * 6562 * <p>Note that this method may be used to pass datatabase- 6563 * specific abstract data types, by using a driver-specific Java 6564 * type. 6565 * 6566 * If the object is of a class implementing the interface <code>SQLData</code>, 6567 * the JDBC driver should call the method <code>SQLData.writeSQL</code> 6568 * to write it to the SQL data stream. 6569 * If, on the other hand, the object is of a class implementing 6570 * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>, 6571 * <code>Struct</code>, <code>java.net.URL</code>, 6572 * or <code>Array</code>, the driver should pass it to the database as a 6573 * value of the corresponding SQL type. 6574 * <P> 6575 * This method throws an exception if there is an ambiguity, for example, if the 6576 * object is of a class implementing more than one of the interfaces named above. 6577 * 6578 * @param parameterName the name of the parameter 6579 * @param x the object containing the input parameter value 6580 * @exception SQLException if a database access error occurs, 6581 * this method is called on a closed <code>CallableStatement</code> or if the given 6582 * <code>Object</code> parameter is ambiguous 6583 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6584 * this method 6585 * @see #getObject 6586 * @since 1.4 6587 */ 6588 public void setObject(String parameterName, Object x) throws SQLException{ 6589 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6590 } 6591 6592 /** 6593 * Sets the designated parameter to the given input stream, which will have 6594 * the specified number of bytes. 6595 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 6596 * parameter, it may be more practical to send it via a 6597 * <code>java.io.InputStream</code>. Data will be read from the stream 6598 * as needed until end-of-file is reached. The JDBC driver will 6599 * do any necessary conversion from ASCII to the database char format. 6600 * 6601 * <P><B>Note:</B> This stream object can either be a standard 6602 * Java stream object or your own subclass that implements the 6603 * standard interface. 6604 * 6605 * @param parameterName the name of the parameter 6606 * @param x the Java input stream that contains the ASCII parameter value 6607 * @param length the number of bytes in the stream 6608 * @exception SQLException if a database access error occurs or 6609 * this method is called on a closed <code>CallableStatement</code> 6610 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6611 * this method 6612 * @since 1.4 6613 */ 6614 public void setAsciiStream(String parameterName, java.io.InputStream x, int length) 6615 throws SQLException{ 6616 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6617 } 6618 6619 6620 /** 6621 * Sets the designated parameter to the given input stream, which will have 6622 * the specified number of bytes. 6623 * When a very large binary value is input to a <code>LONGVARBINARY</code> 6624 * parameter, it may be more practical to send it via a 6625 * <code>java.io.InputStream</code> object. The data will be read from the stream 6626 * as needed until end-of-file is reached. 6627 * 6628 * <P><B>Note:</B> This stream object can either be a standard 6629 * Java stream object or your own subclass that implements the 6630 * standard interface. 6631 * 6632 * @param parameterName the name of the parameter 6633 * @param x the java input stream which contains the binary parameter value 6634 * @param length the number of bytes in the stream 6635 * @exception SQLException if a database access error occurs or 6636 * this method is called on a closed <code>CallableStatement</code> 6637 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6638 * this method 6639 * @since 1.4 6640 */ 6641 public void setBinaryStream(String parameterName, java.io.InputStream x, 6642 int length) throws SQLException{ 6643 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6644 } 6645 6646 /** 6647 * Sets the designated parameter to the given <code>Reader</code> 6648 * object, which is the given number of characters long. 6649 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 6650 * parameter, it may be more practical to send it via a 6651 * <code>java.io.Reader</code> object. The data will be read from the stream 6652 * as needed until end-of-file is reached. The JDBC driver will 6653 * do any necessary conversion from UNICODE to the database char format. 6654 * 6655 * <P><B>Note:</B> This stream object can either be a standard 6656 * Java stream object or your own subclass that implements the 6657 * standard interface. 6658 * 6659 * @param parameterName the name of the parameter 6660 * @param reader the <code>java.io.Reader</code> object that 6661 * contains the UNICODE data used as the designated parameter 6662 * @param length the number of characters in the stream 6663 * @exception SQLException if a database access error occurs or 6664 * this method is called on a closed <code>CallableStatement</code> 6665 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6666 * this method 6667 * @since 1.4 6668 */ 6669 public void setCharacterStream(String parameterName, 6670 java.io.Reader reader, 6671 int length) throws SQLException{ 6672 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6673 } 6674 6675 /** 6676 * Sets the designated parameter to the given input stream. 6677 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 6678 * parameter, it may be more practical to send it via a 6679 * <code>java.io.InputStream</code>. Data will be read from the stream 6680 * as needed until end-of-file is reached. The JDBC driver will 6681 * do any necessary conversion from ASCII to the database char format. 6682 * 6683 * <P><B>Note:</B> This stream object can either be a standard 6684 * Java stream object or your own subclass that implements the 6685 * standard interface. 6686 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6687 * it might be more efficient to use a version of 6688 * <code>setAsciiStream</code> which takes a length parameter. 6689 * 6690 * @param parameterName the name of the parameter 6691 * @param x the Java input stream that contains the ASCII parameter value 6692 * @exception SQLException if a database access error occurs or 6693 * this method is called on a closed <code>CallableStatement</code> 6694 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6695 * @since 1.6 6696 */ 6697 public void setAsciiStream(String parameterName, java.io.InputStream x) 6698 throws SQLException{ 6699 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6700 } 6701 6702 6703 /** 6704 * Sets the designated parameter to the given input stream. 6705 * When a very large binary value is input to a <code>LONGVARBINARY</code> 6706 * parameter, it may be more practical to send it via a 6707 * <code>java.io.InputStream</code> object. The data will be read from the 6708 * stream as needed until end-of-file is reached. 6709 * 6710 * <P><B>Note:</B> This stream object can either be a standard 6711 * Java stream object or your own subclass that implements the 6712 * standard interface. 6713 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6714 * it might be more efficient to use a version of 6715 * <code>setBinaryStream</code> which takes a length parameter. 6716 * 6717 * @param parameterName the name of the parameter 6718 * @param x the java input stream which contains the binary parameter value 6719 * @exception SQLException if a database access error occurs or 6720 * this method is called on a closed <code>CallableStatement</code> 6721 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6722 * @since 1.6 6723 */ 6724 public void setBinaryStream(String parameterName, java.io.InputStream x) 6725 throws SQLException{ 6726 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6727 } 6728 6729 /** 6730 * Sets the designated parameter to the given <code>Reader</code> 6731 * object. 6732 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 6733 * parameter, it may be more practical to send it via a 6734 * <code>java.io.Reader</code> object. The data will be read from the stream 6735 * as needed until end-of-file is reached. The JDBC driver will 6736 * do any necessary conversion from UNICODE to the database char format. 6737 * 6738 * <P><B>Note:</B> This stream object can either be a standard 6739 * Java stream object or your own subclass that implements the 6740 * standard interface. 6741 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 6742 * it might be more efficient to use a version of 6743 * <code>setCharacterStream</code> which takes a length parameter. 6744 * 6745 * @param parameterName the name of the parameter 6746 * @param reader the <code>java.io.Reader</code> object that contains the 6747 * Unicode data 6748 * @exception SQLException if a database access error occurs or 6749 * this method is called on a closed <code>CallableStatement</code> 6750 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 6751 * @since 1.6 6752 */ 6753 public void setCharacterStream(String parameterName, 6754 java.io.Reader reader) throws SQLException{ 6755 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6756 } 6757 6758 /** 6759 * Sets the designated parameter to the given 6760 * <code>java.math.BigDecimal</code> value. 6761 * The driver converts this to an SQL <code>NUMERIC</code> value when 6762 * it sends it to the database. 6763 * 6764 * @param parameterName the name of the parameter 6765 * @param x the parameter value 6766 * @exception SQLException if a database access error occurs or 6767 * this method is called on a closed <code>CallableStatement</code> 6768 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6769 * this method 6770 * @see #getBigDecimal 6771 * @since 1.4 6772 */ 6773 public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException{ 6774 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6775 } 6776 6777 /** 6778 * Sets the designated parameter to the given Java <code>String</code> value. 6779 * The driver converts this 6780 * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value 6781 * (depending on the argument's 6782 * size relative to the driver's limits on <code>VARCHAR</code> values) 6783 * when it sends it to the database. 6784 * 6785 * @param parameterName the name of the parameter 6786 * @param x the parameter value 6787 * @exception SQLException if a database access error occurs or 6788 * this method is called on a closed <code>CallableStatement</code> 6789 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6790 * this method 6791 * @see #getString 6792 * @since 1.4 6793 */ 6794 public void setString(String parameterName, String x) throws SQLException{ 6795 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6796 } 6797 6798 6799 6800 /** 6801 * Sets the designated parameter to the given Java array of bytes. 6802 * The driver converts this to an SQL <code>VARBINARY</code> or 6803 * <code>LONGVARBINARY</code> (depending on the argument's size relative 6804 * to the driver's limits on <code>VARBINARY</code> values) when it sends 6805 * it to the database. 6806 * 6807 * @param parameterName the name of the parameter 6808 * @param x the parameter value 6809 * @exception SQLException if a database access error occurs or 6810 * this method is called on a closed <code>CallableStatement</code> 6811 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6812 * this method 6813 * @see #getBytes 6814 * @since 1.4 6815 */ 6816 public void setBytes(String parameterName, byte x[]) throws SQLException{ 6817 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6818 } 6819 6820 /** 6821 * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. 6822 * The driver 6823 * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the 6824 * database. 6825 * 6826 * @param parameterName the name of the parameter 6827 * @param x the parameter value 6828 * @exception SQLException if a database access error occurs or 6829 * this method is called on a closed <code>CallableStatement</code> 6830 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6831 * this method 6832 * @see #getTimestamp 6833 * @since 1.4 6834 */ 6835 public void setTimestamp(String parameterName, java.sql.Timestamp x) 6836 throws SQLException{ 6837 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6838 } 6839 6840 /** 6841 * Sets the designated parameter to SQL <code>NULL</code>. 6842 * 6843 * <P><B>Note:</B> You must specify the parameter's SQL type. 6844 * 6845 * @param parameterName the name of the parameter 6846 * @param sqlType the SQL type code defined in <code>java.sql.Types</code> 6847 * @exception SQLException if a database access error occurs or 6848 * this method is called on a closed <code>CallableStatement</code> 6849 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6850 * this method 6851 * @since 1.4 6852 */ 6853 public void setNull(String parameterName, int sqlType) throws SQLException { 6854 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6855 } 6856 6857 /** 6858 * Sets the designated parameter to SQL <code>NULL</code>. 6859 * This version of the method <code>setNull</code> should 6860 * be used for user-defined types and REF type parameters. Examples 6861 * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and 6862 * named array types. 6863 * 6864 * <P><B>Note:</B> To be portable, applications must give the 6865 * SQL type code and the fully-qualified SQL type name when specifying 6866 * a NULL user-defined or REF parameter. In the case of a user-defined type 6867 * the name is the type name of the parameter itself. For a REF 6868 * parameter, the name is the type name of the referenced type. If 6869 * a JDBC driver does not need the type code or type name information, 6870 * it may ignore it. 6871 * 6872 * Although it is intended for user-defined and Ref parameters, 6873 * this method may be used to set a null parameter of any JDBC type. 6874 * If the parameter does not have a user-defined or REF type, the given 6875 * typeName is ignored. 6876 * 6877 * 6878 * @param parameterName the name of the parameter 6879 * @param sqlType a value from <code>java.sql.Types</code> 6880 * @param typeName the fully-qualified name of an SQL user-defined type; 6881 * ignored if the parameter is not a user-defined type or 6882 * SQL <code>REF</code> value 6883 * @exception SQLException if a database access error occurs or 6884 * this method is called on a closed <code>CallableStatement</code> 6885 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6886 * this method 6887 * @since 1.4 6888 */ 6889 public void setNull (String parameterName, int sqlType, String typeName) 6890 throws SQLException{ 6891 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6892 } 6893 6894 /** 6895 * Sets the designated parameter to the given Java <code>boolean</code> value. 6896 * The driver converts this 6897 * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database. 6898 * 6899 * @param parameterName the name of the parameter 6900 * @param x the parameter value 6901 * @exception SQLException if a database access error occurs or 6902 * this method is called on a closed <code>CallableStatement</code> 6903 * @see #getBoolean 6904 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6905 * this method 6906 * @since 1.4 6907 */ 6908 public void setBoolean(String parameterName, boolean x) throws SQLException{ 6909 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6910 } 6911 6912 6913 6914 /** 6915 * Sets the designated parameter to the given Java <code>byte</code> value. 6916 * The driver converts this 6917 * to an SQL <code>TINYINT</code> value when it sends it to the database. 6918 * 6919 * @param parameterName the name of the parameter 6920 * @param x the parameter value 6921 * @exception SQLException if a database access error occurs or 6922 * this method is called on a closed <code>CallableStatement</code> 6923 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6924 * this method 6925 * @see #getByte 6926 * @since 1.4 6927 */ 6928 public void setByte(String parameterName, byte x) throws SQLException{ 6929 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6930 } 6931 6932 6933 /** 6934 * Sets the designated parameter to the given Java <code>short</code> value. 6935 * The driver converts this 6936 * to an SQL <code>SMALLINT</code> value when it sends it to the database. 6937 * 6938 * @param parameterName the name of the parameter 6939 * @param x the parameter value 6940 * @exception SQLException if a database access error occurs or 6941 * this method is called on a closed <code>CallableStatement</code> 6942 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6943 * this method 6944 * @see #getShort 6945 * @since 1.4 6946 */ 6947 public void setShort(String parameterName, short x) throws SQLException{ 6948 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6949 } 6950 6951 6952 /** 6953 * Sets the designated parameter to the given Java <code>int</code> value. 6954 * The driver converts this 6955 * to an SQL <code>INTEGER</code> value when it sends it to the database. 6956 * 6957 * @param parameterName the name of the parameter 6958 * @param x the parameter value 6959 * @exception SQLException if a database access error occurs or 6960 * this method is called on a closed <code>CallableStatement</code> 6961 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6962 * this method 6963 * @see #getInt 6964 * @since 1.4 6965 */ 6966 public void setInt(String parameterName, int x) throws SQLException{ 6967 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6968 } 6969 6970 /** 6971 * Sets the designated parameter to the given Java <code>long</code> value. 6972 * The driver converts this 6973 * to an SQL <code>BIGINT</code> value when it sends it to the database. 6974 * 6975 * @param parameterName the name of the parameter 6976 * @param x the parameter value 6977 * @exception SQLException if a database access error occurs or 6978 * this method is called on a closed <code>CallableStatement</code> 6979 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6980 * this method 6981 * @see #getLong 6982 * @since 1.4 6983 */ 6984 public void setLong(String parameterName, long x) throws SQLException{ 6985 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 6986 } 6987 6988 6989 /** 6990 * Sets the designated parameter to the given Java <code>float</code> value. 6991 * The driver converts this 6992 * to an SQL <code>FLOAT</code> value when it sends it to the database. 6993 * 6994 * @param parameterName the name of the parameter 6995 * @param x the parameter value 6996 * @exception SQLException if a database access error occurs or 6997 * this method is called on a closed <code>CallableStatement</code> 6998 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 6999 * this method 7000 * @see #getFloat 7001 * @since 1.4 7002 */ 7003 public void setFloat(String parameterName, float x) throws SQLException{ 7004 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 7005 } 7006 7007 /** 7008 * Sets the designated parameter to the given Java <code>double</code> value. 7009 * The driver converts this 7010 * to an SQL <code>DOUBLE</code> value when it sends it to the database. 7011 * 7012 * @param parameterName the name of the parameter 7013 * @param x the parameter value 7014 * @exception SQLException if a database access error occurs or 7015 * this method is called on a closed <code>CallableStatement</code> 7016 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 7017 * this method 7018 * @see #getDouble 7019 * @since 1.4 7020 */ 7021 public void setDouble(String parameterName, double x) throws SQLException{ 7022 throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString()); 7023 } 7024 7025 /** 7026 * This method re populates the resBundle 7027 * during the deserialization process 7028 * 7029 */ 7030 private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { 7031 // Default state initialization happens here 7032 ois.defaultReadObject(); 7033 // Initialization of transient Res Bundle happens here . 7034 try { 7035 resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle(); 7036 } catch(IOException ioe) {} 7037 7038 } 7039 7040 static final long serialVersionUID = -3591946023893483003L; 7041 7042 //------------------------- JDBC 4.1 ----------------------------------- 7043 7044 public <T> T getObject(int columnIndex, Class<T> type) throws SQLException { 7045 throw new SQLFeatureNotSupportedException("Not supported yet."); 7046 } 7047 7048 public <T> T getObject(String columnLabel, Class<T> type) throws SQLException { 7049 throw new SQLFeatureNotSupportedException("Not supported yet."); 7050 } 7051 }