1 /* 2 * Copyright (c) 1996, 2014, 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 java.sql; 27 28 import java.math.BigDecimal; 29 import java.util.Calendar; 30 import java.io.Reader; 31 import java.io.InputStream; 32 33 /** 34 * The interface used to execute SQL stored procedures. The JDBC API 35 * provides a stored procedure SQL escape syntax that allows stored procedures 36 * to be called in a standard way for all RDBMSs. This escape syntax has one 37 * form that includes a result parameter and one that does not. If used, the result 38 * parameter must be registered as an OUT parameter. The other parameters 39 * can be used for input, output or both. Parameters are referred to 40 * sequentially, by number, with the first parameter being 1. 41 * <PRE> 42 * {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} 43 * {call <procedure-name>[(<arg1>,<arg2>, ...)]} 44 * </PRE> 45 * <P> 46 * IN parameter values are set using the <code>set</code> methods inherited from 47 * {@link PreparedStatement}. The type of all OUT parameters must be 48 * registered prior to executing the stored procedure; their values 49 * are retrieved after execution via the <code>get</code> methods provided here. 50 * <P> 51 * A <code>CallableStatement</code> can return one {@link ResultSet} object or 52 * multiple <code>ResultSet</code> objects. Multiple 53 * <code>ResultSet</code> objects are handled using operations 54 * inherited from {@link Statement}. 55 * <P> 56 * For maximum portability, a call's <code>ResultSet</code> objects and 57 * update counts should be processed prior to getting the values of output 58 * parameters. 59 * 60 * 61 * @see Connection#prepareCall 62 * @see ResultSet 63 */ 64 65 public interface CallableStatement extends PreparedStatement { 66 67 /** 68 * Registers the OUT parameter in ordinal position 69 * <code>parameterIndex</code> to the JDBC type 70 * <code>sqlType</code>. All OUT parameters must be registered 71 * before a stored procedure is executed. 72 * <p> 73 * The JDBC type specified by <code>sqlType</code> for an OUT 74 * parameter determines the Java type that must be used 75 * in the <code>get</code> method to read the value of that parameter. 76 * <p> 77 * If the JDBC type expected to be returned to this output parameter 78 * is specific to this particular database, <code>sqlType</code> 79 * should be <code>java.sql.Types.OTHER</code>. The method 80 * {@link #getObject} retrieves the value. 81 * 82 * @param parameterIndex the first parameter is 1, the second is 2, 83 * and so on 84 * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>. 85 * If the parameter is of JDBC type <code>NUMERIC</code> 86 * or <code>DECIMAL</code>, the version of 87 * <code>registerOutParameter</code> that accepts a scale value 88 * should be used. 89 * 90 * @exception SQLException if the parameterIndex is not valid; 91 * if a database access error occurs or 92 * this method is called on a closed <code>CallableStatement</code> 93 * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is 94 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 95 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 96 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 97 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 98 * or <code>STRUCT</code> data type and the JDBC driver does not support 99 * this data type 100 * @see Types 101 */ 102 void registerOutParameter(int parameterIndex, int sqlType) 103 throws SQLException; 104 105 /** 106 * Registers the parameter in ordinal position 107 * <code>parameterIndex</code> to be of JDBC type 108 * <code>sqlType</code>. All OUT parameters must be registered 109 * before a stored procedure is executed. 110 * <p> 111 * The JDBC type specified by <code>sqlType</code> for an OUT 112 * parameter determines the Java type that must be used 113 * in the <code>get</code> method to read the value of that parameter. 114 * <p> 115 * This version of <code>registerOutParameter</code> should be 116 * used when the parameter is of JDBC type <code>NUMERIC</code> 117 * or <code>DECIMAL</code>. 118 * 119 * @param parameterIndex the first parameter is 1, the second is 2, 120 * and so on 121 * @param sqlType the SQL type code defined by <code>java.sql.Types</code>. 122 * @param scale the desired number of digits to the right of the 123 * decimal point. It must be greater than or equal to zero. 124 * @exception SQLException if the parameterIndex is not valid; 125 * if a database access error occurs or 126 * this method is called on a closed <code>CallableStatement</code> 127 * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is 128 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 129 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 130 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 131 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 132 * or <code>STRUCT</code> data type and the JDBC driver does not support 133 * this data type 134 * @see Types 135 */ 136 void registerOutParameter(int parameterIndex, int sqlType, int scale) 137 throws SQLException; 138 139 /** 140 * Retrieves whether the last OUT parameter read had the value of 141 * SQL <code>NULL</code>. Note that this method should be called only after 142 * calling a getter method; otherwise, there is no value to use in 143 * determining whether it is <code>null</code> or not. 144 * 145 * @return <code>true</code> if the last parameter read was SQL 146 * <code>NULL</code>; <code>false</code> otherwise 147 * @exception SQLException if a database access error occurs or 148 * this method is called on a closed <code>CallableStatement</code> 149 */ 150 boolean wasNull() throws SQLException; 151 152 /** 153 * Retrieves the value of the designated JDBC <code>CHAR</code>, 154 * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> parameter as a 155 * <code>String</code> in the Java programming language. 156 * <p> 157 * For the fixed-length type JDBC <code>CHAR</code>, 158 * the <code>String</code> object 159 * returned has exactly the same value the SQL 160 * <code>CHAR</code> value had in the 161 * database, including any padding added by the database. 162 * 163 * @param parameterIndex the first parameter is 1, the second is 2, 164 * and so on 165 * @return the parameter value. If the value is SQL <code>NULL</code>, 166 * the result 167 * is <code>null</code>. 168 * @exception SQLException if the parameterIndex is not valid; 169 * if a database access error occurs or 170 * this method is called on a closed <code>CallableStatement</code> 171 * @see #setString 172 */ 173 String getString(int parameterIndex) throws SQLException; 174 175 /** 176 * Retrieves the value of the designated JDBC <code>BIT</code> 177 * or <code>BOOLEAN</code> parameter as a 178 * <code>boolean</code> in the Java programming language. 179 * 180 * @param parameterIndex the first parameter is 1, the second is 2, 181 * and so on 182 * @return the parameter value. If the value is SQL <code>NULL</code>, 183 * the result is <code>false</code>. 184 * @exception SQLException if the parameterIndex is not valid; 185 * if a database access error occurs or 186 * this method is called on a closed <code>CallableStatement</code> 187 * @see #setBoolean 188 */ 189 boolean getBoolean(int parameterIndex) throws SQLException; 190 191 /** 192 * Retrieves the value of the designated JDBC <code>TINYINT</code> parameter 193 * as a <code>byte</code> in the Java programming language. 194 * 195 * @param parameterIndex the first parameter is 1, the second is 2, 196 * and so on 197 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 198 * is <code>0</code>. 199 * @exception SQLException if the parameterIndex is not valid; 200 * if a database access error occurs or 201 * this method is called on a closed <code>CallableStatement</code> 202 * @see #setByte 203 */ 204 byte getByte(int parameterIndex) throws SQLException; 205 206 /** 207 * Retrieves the value of the designated JDBC <code>SMALLINT</code> parameter 208 * as a <code>short</code> in the Java programming language. 209 * 210 * @param parameterIndex the first parameter is 1, the second is 2, 211 * and so on 212 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 213 * is <code>0</code>. 214 * @exception SQLException if the parameterIndex is not valid; 215 * if a database access error occurs or 216 * this method is called on a closed <code>CallableStatement</code> 217 * @see #setShort 218 */ 219 short getShort(int parameterIndex) throws SQLException; 220 221 /** 222 * Retrieves the value of the designated JDBC <code>INTEGER</code> parameter 223 * as an <code>int</code> in the Java programming language. 224 * 225 * @param parameterIndex the first parameter is 1, the second is 2, 226 * and so on 227 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 228 * is <code>0</code>. 229 * @exception SQLException if the parameterIndex is not valid; 230 * if a database access error occurs or 231 * this method is called on a closed <code>CallableStatement</code> 232 * @see #setInt 233 */ 234 int getInt(int parameterIndex) throws SQLException; 235 236 /** 237 * Retrieves the value of the designated JDBC <code>BIGINT</code> parameter 238 * as a <code>long</code> in the Java programming language. 239 * 240 * @param parameterIndex the first parameter is 1, the second is 2, 241 * and so on 242 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 243 * is <code>0</code>. 244 * @exception SQLException if the parameterIndex is not valid; 245 * if a database access error occurs or 246 * this method is called on a closed <code>CallableStatement</code> 247 * @see #setLong 248 */ 249 long getLong(int parameterIndex) throws SQLException; 250 251 /** 252 * Retrieves the value of the designated JDBC <code>FLOAT</code> parameter 253 * as a <code>float</code> in the Java programming language. 254 * 255 * @param parameterIndex the first parameter is 1, the second is 2, 256 * and so on 257 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 258 * is <code>0</code>. 259 * @exception SQLException if the parameterIndex is not valid; 260 * if a database access error occurs or 261 * this method is called on a closed <code>CallableStatement</code> 262 * @see #setFloat 263 */ 264 float getFloat(int parameterIndex) throws SQLException; 265 266 /** 267 * Retrieves the value of the designated JDBC <code>DOUBLE</code> parameter as a <code>double</code> 268 * in the Java programming language. 269 * @param parameterIndex the first parameter is 1, the second is 2, 270 * and so on 271 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 272 * is <code>0</code>. 273 * @exception SQLException if the parameterIndex is not valid; 274 * if a database access error occurs or 275 * this method is called on a closed <code>CallableStatement</code> 276 * @see #setDouble 277 */ 278 double getDouble(int parameterIndex) throws SQLException; 279 280 /** 281 * Retrieves the value of the designated JDBC <code>NUMERIC</code> parameter as a 282 * <code>java.math.BigDecimal</code> object with <i>scale</i> digits to 283 * the right of the decimal point. 284 * @param parameterIndex the first parameter is 1, the second is 2, 285 * and so on 286 * @param scale the number of digits to the right of the decimal point 287 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 288 * is <code>null</code>. 289 * @exception SQLException if the parameterIndex is not valid; 290 * if a database access error occurs or 291 * this method is called on a closed <code>CallableStatement</code> 292 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 293 * this method 294 * @deprecated use <code>getBigDecimal(int parameterIndex)</code> 295 * or <code>getBigDecimal(String parameterName)</code> 296 * @see #setBigDecimal 297 */ 298 @Deprecated 299 BigDecimal getBigDecimal(int parameterIndex, int scale) 300 throws SQLException; 301 302 /** 303 * Retrieves the value of the designated JDBC <code>BINARY</code> or 304 * <code>VARBINARY</code> parameter as an array of <code>byte</code> 305 * values in the Java programming language. 306 * @param parameterIndex the first parameter is 1, the second is 2, 307 * and so on 308 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 309 * is <code>null</code>. 310 * @exception SQLException if the parameterIndex is not valid; 311 * if a database access error occurs or 312 * this method is called on a closed <code>CallableStatement</code> 313 * @see #setBytes 314 */ 315 byte[] getBytes(int parameterIndex) throws SQLException; 316 317 /** 318 * Retrieves the value of the designated JDBC <code>DATE</code> parameter as a 319 * <code>java.sql.Date</code> object. 320 * @param parameterIndex the first parameter is 1, the second is 2, 321 * and so on 322 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 323 * is <code>null</code>. 324 * @exception SQLException if the parameterIndex is not valid; 325 * if a database access error occurs or 326 * this method is called on a closed <code>CallableStatement</code> 327 * @see #setDate 328 */ 329 java.sql.Date getDate(int parameterIndex) throws SQLException; 330 331 /** 332 * Retrieves the value of the designated JDBC <code>TIME</code> parameter as a 333 * <code>java.sql.Time</code> object. 334 * 335 * @param parameterIndex the first parameter is 1, the second is 2, 336 * and so on 337 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 338 * is <code>null</code>. 339 * @exception SQLException if the parameterIndex is not valid; 340 * if a database access error occurs or 341 * this method is called on a closed <code>CallableStatement</code> 342 * @see #setTime 343 */ 344 java.sql.Time getTime(int parameterIndex) throws SQLException; 345 346 /** 347 * Retrieves the value of the designated JDBC <code>TIMESTAMP</code> parameter as a 348 * <code>java.sql.Timestamp</code> object. 349 * 350 * @param parameterIndex the first parameter is 1, the second is 2, 351 * and so on 352 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 353 * is <code>null</code>. 354 * @exception SQLException if the parameterIndex is not valid; 355 * if a database access error occurs or 356 * this method is called on a closed <code>CallableStatement</code> 357 * @see #setTimestamp 358 */ 359 java.sql.Timestamp getTimestamp(int parameterIndex) 360 throws SQLException; 361 362 //---------------------------------------------------------------------- 363 // Advanced features: 364 365 366 /** 367 * Retrieves the value of the designated parameter as an <code>Object</code> 368 * in the Java programming language. If the value is an SQL <code>NULL</code>, 369 * the driver returns a Java <code>null</code>. 370 * <p> 371 * This method returns a Java object whose type corresponds to the JDBC 372 * type that was registered for this parameter using the method 373 * <code>registerOutParameter</code>. By registering the target JDBC 374 * type as <code>java.sql.Types.OTHER</code>, this method can be used 375 * to read database-specific abstract data types. 376 * 377 * @param parameterIndex the first parameter is 1, the second is 2, 378 * and so on 379 * @return A <code>java.lang.Object</code> holding the OUT parameter value 380 * @exception SQLException if the parameterIndex is not valid; 381 * if a database access error occurs or 382 * this method is called on a closed <code>CallableStatement</code> 383 * @see Types 384 * @see #setObject 385 */ 386 Object getObject(int parameterIndex) throws SQLException; 387 388 389 //--------------------------JDBC 2.0----------------------------- 390 391 /** 392 * Retrieves the value of the designated JDBC <code>NUMERIC</code> parameter as a 393 * <code>java.math.BigDecimal</code> object with as many digits to the 394 * right of the decimal point as the value contains. 395 * @param parameterIndex the first parameter is 1, the second is 2, 396 * and so on 397 * @return the parameter value in full precision. If the value is 398 * SQL <code>NULL</code>, the result is <code>null</code>. 399 * @exception SQLException if the parameterIndex is not valid; 400 * if a database access error occurs or 401 * this method is called on a closed <code>CallableStatement</code> 402 * @see #setBigDecimal 403 * @since 1.2 404 */ 405 BigDecimal getBigDecimal(int parameterIndex) throws SQLException; 406 407 /** 408 * Returns an object representing the value of OUT parameter 409 * <code>parameterIndex</code> and uses <code>map</code> for the custom 410 * mapping of the parameter value. 411 * <p> 412 * This method returns a Java object whose type corresponds to the 413 * JDBC type that was registered for this parameter using the method 414 * <code>registerOutParameter</code>. By registering the target 415 * JDBC type as <code>java.sql.Types.OTHER</code>, this method can 416 * be used to read database-specific abstract data types. 417 * @param parameterIndex the first parameter is 1, the second is 2, and so on 418 * @param map the mapping from SQL type names to Java classes 419 * @return a <code>java.lang.Object</code> holding the OUT parameter value 420 * @exception SQLException if the parameterIndex is not valid; 421 * if a database access error occurs or 422 * this method is called on a closed <code>CallableStatement</code> 423 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 424 * this method 425 * @see #setObject 426 * @since 1.2 427 */ 428 Object getObject(int parameterIndex, java.util.Map<String,Class<?>> map) 429 throws SQLException; 430 431 /** 432 * Retrieves the value of the designated JDBC <code>REF(<structured-type>)</code> 433 * parameter as a {@link java.sql.Ref} object in the Java programming language. 434 * @param parameterIndex the first parameter is 1, the second is 2, 435 * and so on 436 * @return the parameter value as a <code>Ref</code> object in the 437 * Java programming language. If the value was SQL <code>NULL</code>, the value 438 * <code>null</code> is returned. 439 * @exception SQLException if the parameterIndex is not valid; 440 * if a database access error occurs or 441 * this method is called on a closed <code>CallableStatement</code> 442 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 443 * this method 444 * @since 1.2 445 */ 446 Ref getRef (int parameterIndex) throws SQLException; 447 448 /** 449 * Retrieves the value of the designated JDBC <code>BLOB</code> parameter as a 450 * {@link java.sql.Blob} object in the Java programming language. 451 * @param parameterIndex the first parameter is 1, the second is 2, and so on 452 * @return the parameter value as a <code>Blob</code> object in the 453 * Java programming language. If the value was SQL <code>NULL</code>, the value 454 * <code>null</code> is returned. 455 * @exception SQLException if the parameterIndex is not valid; 456 * if a database access error occurs or 457 * this method is called on a closed <code>CallableStatement</code> 458 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 459 * this method 460 * @since 1.2 461 */ 462 Blob getBlob (int parameterIndex) throws SQLException; 463 464 /** 465 * Retrieves the value of the designated JDBC <code>CLOB</code> parameter as a 466 * <code>java.sql.Clob</code> object in the Java programming language. 467 * @param parameterIndex the first parameter is 1, the second is 2, and 468 * so on 469 * @return the parameter value as a <code>Clob</code> object in the 470 * Java programming language. If the value was SQL <code>NULL</code>, the 471 * value <code>null</code> is returned. 472 * @exception SQLException if the parameterIndex is not valid; 473 * if a database access error occurs or 474 * this method is called on a closed <code>CallableStatement</code> 475 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 476 * this method 477 * @since 1.2 478 */ 479 Clob getClob (int parameterIndex) throws SQLException; 480 481 /** 482 * 483 * Retrieves the value of the designated JDBC <code>ARRAY</code> parameter as an 484 * {@link java.sql.Array} object in the Java programming language. 485 * @param parameterIndex the first parameter is 1, the second is 2, and 486 * so on 487 * @return the parameter value as an <code>Array</code> object in 488 * the Java programming language. If the value was SQL <code>NULL</code>, the 489 * value <code>null</code> is returned. 490 * @exception SQLException if the parameterIndex is not valid; 491 * if a database access error occurs or 492 * this method is called on a closed <code>CallableStatement</code> 493 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 494 * this method 495 * @since 1.2 496 */ 497 Array getArray (int parameterIndex) throws SQLException; 498 499 /** 500 * Retrieves the value of the designated JDBC <code>DATE</code> parameter as a 501 * <code>java.sql.Date</code> object, using 502 * the given <code>Calendar</code> object 503 * to construct the date. 504 * With a <code>Calendar</code> object, the driver 505 * can calculate the date taking into account a custom timezone and locale. 506 * If no <code>Calendar</code> object is specified, the driver uses the 507 * default timezone and locale. 508 * 509 * @param parameterIndex the first parameter is 1, the second is 2, 510 * and so on 511 * @param cal the <code>Calendar</code> object the driver will use 512 * to construct the date 513 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 514 * is <code>null</code>. 515 * @exception SQLException if the parameterIndex is not valid; 516 * if a database access error occurs or 517 * this method is called on a closed <code>CallableStatement</code> 518 * @see #setDate 519 * @since 1.2 520 */ 521 java.sql.Date getDate(int parameterIndex, Calendar cal) 522 throws SQLException; 523 524 /** 525 * Retrieves the value of the designated JDBC <code>TIME</code> parameter as a 526 * <code>java.sql.Time</code> object, using 527 * the given <code>Calendar</code> object 528 * to construct the time. 529 * With a <code>Calendar</code> object, the driver 530 * can calculate the time taking into account a custom timezone and locale. 531 * If no <code>Calendar</code> object is specified, the driver uses the 532 * default timezone and locale. 533 * 534 * @param parameterIndex the first parameter is 1, the second is 2, 535 * and so on 536 * @param cal the <code>Calendar</code> object the driver will use 537 * to construct the time 538 * @return the parameter value; if the value is SQL <code>NULL</code>, the result 539 * is <code>null</code>. 540 * @exception SQLException if the parameterIndex is not valid; 541 * if a database access error occurs or 542 * this method is called on a closed <code>CallableStatement</code> 543 * @see #setTime 544 * @since 1.2 545 */ 546 java.sql.Time getTime(int parameterIndex, Calendar cal) 547 throws SQLException; 548 549 /** 550 * Retrieves the value of the designated JDBC <code>TIMESTAMP</code> parameter as a 551 * <code>java.sql.Timestamp</code> object, using 552 * the given <code>Calendar</code> object to construct 553 * the <code>Timestamp</code> object. 554 * With a <code>Calendar</code> object, the driver 555 * can calculate the timestamp taking into account a custom timezone and locale. 556 * If no <code>Calendar</code> object is specified, the driver uses the 557 * default timezone and locale. 558 * 559 * 560 * @param parameterIndex the first parameter is 1, the second is 2, 561 * and so on 562 * @param cal the <code>Calendar</code> object the driver will use 563 * to construct the timestamp 564 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 565 * is <code>null</code>. 566 * @exception SQLException if the parameterIndex is not valid; 567 * if a database access error occurs or 568 * this method is called on a closed <code>CallableStatement</code> 569 * @see #setTimestamp 570 * @since 1.2 571 */ 572 java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal) 573 throws SQLException; 574 575 576 /** 577 * Registers the designated output parameter. 578 * This version of 579 * the method <code>registerOutParameter</code> 580 * should be used for a user-defined or <code>REF</code> output parameter. Examples 581 * of user-defined types include: <code>STRUCT</code>, <code>DISTINCT</code>, 582 * <code>JAVA_OBJECT</code>, and named array types. 583 *<p> 584 * All OUT parameters must be registered 585 * before a stored procedure is executed. 586 * <p> For a user-defined parameter, the fully-qualified SQL 587 * type name of the parameter should also be given, while a <code>REF</code> 588 * parameter requires that the fully-qualified type name of the 589 * referenced type be given. A JDBC driver that does not need the 590 * type code and type name information may ignore it. To be portable, 591 * however, applications should always provide these values for 592 * user-defined and <code>REF</code> parameters. 593 * 594 * Although it is intended for user-defined and <code>REF</code> parameters, 595 * this method may be used to register a parameter of any JDBC type. 596 * If the parameter does not have a user-defined or <code>REF</code> type, the 597 * <i>typeName</i> parameter is ignored. 598 * 599 * <P><B>Note:</B> When reading the value of an out parameter, you 600 * must use the getter method whose Java type corresponds to the 601 * parameter's registered SQL type. 602 * 603 * @param parameterIndex the first parameter is 1, the second is 2,... 604 * @param sqlType a value from {@link java.sql.Types} 605 * @param typeName the fully-qualified name of an SQL structured type 606 * @exception SQLException if the parameterIndex is not valid; 607 * if a database access error occurs or 608 * this method is called on a closed <code>CallableStatement</code> 609 * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is 610 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 611 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 612 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 613 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 614 * or <code>STRUCT</code> data type and the JDBC driver does not support 615 * this data type 616 * @see Types 617 * @since 1.2 618 */ 619 void registerOutParameter (int parameterIndex, int sqlType, String typeName) 620 throws SQLException; 621 622 //--------------------------JDBC 3.0----------------------------- 623 624 /** 625 * Registers the OUT parameter named 626 * <code>parameterName</code> to the JDBC type 627 * <code>sqlType</code>. All OUT parameters must be registered 628 * before a stored procedure is executed. 629 * <p> 630 * The JDBC type specified by <code>sqlType</code> for an OUT 631 * parameter determines the Java type that must be used 632 * in the <code>get</code> method to read the value of that parameter. 633 * <p> 634 * If the JDBC type expected to be returned to this output parameter 635 * is specific to this particular database, <code>sqlType</code> 636 * should be <code>java.sql.Types.OTHER</code>. The method 637 * {@link #getObject} retrieves the value. 638 * @param parameterName the name of the parameter 639 * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>. 640 * If the parameter is of JDBC type <code>NUMERIC</code> 641 * or <code>DECIMAL</code>, the version of 642 * <code>registerOutParameter</code> that accepts a scale value 643 * should be used. 644 * @exception SQLException if parameterName does not correspond to a named 645 * parameter; if a database access error occurs or 646 * this method is called on a closed <code>CallableStatement</code> 647 * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is 648 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 649 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 650 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 651 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 652 * or <code>STRUCT</code> data type and the JDBC driver does not support 653 * this data type or if the JDBC driver does not support 654 * this method 655 * @since 1.4 656 * @see Types 657 */ 658 void registerOutParameter(String parameterName, int sqlType) 659 throws SQLException; 660 661 /** 662 * Registers the parameter named 663 * <code>parameterName</code> to be of JDBC type 664 * <code>sqlType</code>. All OUT parameters must be registered 665 * before a stored procedure is executed. 666 * <p> 667 * The JDBC type specified by <code>sqlType</code> for an OUT 668 * parameter determines the Java type that must be used 669 * in the <code>get</code> method to read the value of that parameter. 670 * <p> 671 * This version of <code>registerOutParameter</code> should be 672 * used when the parameter is of JDBC type <code>NUMERIC</code> 673 * or <code>DECIMAL</code>. 674 * 675 * @param parameterName the name of the parameter 676 * @param sqlType SQL type code defined by <code>java.sql.Types</code>. 677 * @param scale the desired number of digits to the right of the 678 * decimal point. It must be greater than or equal to zero. 679 * @exception SQLException if parameterName does not correspond to a named 680 * parameter; if a database access error occurs or 681 * this method is called on a closed <code>CallableStatement</code> 682 * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is 683 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 684 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 685 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 686 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 687 * or <code>STRUCT</code> data type and the JDBC driver does not support 688 * this data type or if the JDBC driver does not support 689 * this method 690 * @since 1.4 691 * @see Types 692 */ 693 void registerOutParameter(String parameterName, int sqlType, int scale) 694 throws SQLException; 695 696 /** 697 * Registers the designated output parameter. This version of 698 * the method <code>registerOutParameter</code> 699 * should be used for a user-named or REF output parameter. Examples 700 * of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and 701 * named array types. 702 *<p> 703 * All OUT parameters must be registered 704 * before a stored procedure is executed. 705 * <p> 706 * For a user-named parameter the fully-qualified SQL 707 * type name of the parameter should also be given, while a REF 708 * parameter requires that the fully-qualified type name of the 709 * referenced type be given. A JDBC driver that does not need the 710 * type code and type name information may ignore it. To be portable, 711 * however, applications should always provide these values for 712 * user-named and REF parameters. 713 * 714 * Although it is intended for user-named and REF parameters, 715 * this method may be used to register a parameter of any JDBC type. 716 * If the parameter does not have a user-named or REF type, the 717 * typeName parameter is ignored. 718 * 719 * <P><B>Note:</B> When reading the value of an out parameter, you 720 * must use the <code>getXXX</code> method whose Java type XXX corresponds to the 721 * parameter's registered SQL type. 722 * 723 * @param parameterName the name of the parameter 724 * @param sqlType a value from {@link java.sql.Types} 725 * @param typeName the fully-qualified name of an SQL structured type 726 * @exception SQLException if parameterName does not correspond to a named 727 * parameter; if a database access error occurs or 728 * this method is called on a closed <code>CallableStatement</code> 729 * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is 730 * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>, 731 * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>, 732 * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>, 733 * <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code> 734 * or <code>STRUCT</code> data type and the JDBC driver does not support 735 * this data type or if the JDBC driver does not support 736 * this method 737 * @see Types 738 * @since 1.4 739 */ 740 void registerOutParameter (String parameterName, int sqlType, String typeName) 741 throws SQLException; 742 743 /** 744 * Retrieves the value of the designated JDBC <code>DATALINK</code> parameter as a 745 * <code>java.net.URL</code> object. 746 * 747 * @param parameterIndex the first parameter is 1, the second is 2,... 748 * @return a <code>java.net.URL</code> object that represents the 749 * JDBC <code>DATALINK</code> value used as the designated 750 * parameter 751 * @exception SQLException if the parameterIndex is not valid; 752 * if a database access error occurs, 753 * this method is called on a closed <code>CallableStatement</code>, 754 * or if the URL being returned is 755 * not a valid URL on the Java platform 756 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 757 * this method 758 * @see #setURL 759 * @since 1.4 760 */ 761 java.net.URL getURL(int parameterIndex) throws SQLException; 762 763 /** 764 * Sets the designated parameter to the given <code>java.net.URL</code> object. 765 * The driver converts this to an SQL <code>DATALINK</code> value when 766 * it sends it to the database. 767 * 768 * @param parameterName the name of the parameter 769 * @param val the parameter value 770 * @exception SQLException if parameterName does not correspond to a named 771 * parameter; if a database access error occurs; 772 * this method is called on a closed <code>CallableStatement</code> 773 * or if a URL is malformed 774 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 775 * this method 776 * @see #getURL 777 * @since 1.4 778 */ 779 void setURL(String parameterName, java.net.URL val) throws SQLException; 780 781 /** 782 * Sets the designated parameter to SQL <code>NULL</code>. 783 * 784 * <P><B>Note:</B> You must specify the parameter's SQL type. 785 * 786 * @param parameterName the name of the parameter 787 * @param sqlType the SQL type code defined in <code>java.sql.Types</code> 788 * @exception SQLException if parameterName does not correspond to a named 789 * parameter; if a database access error occurs or 790 * this method is called on a closed <code>CallableStatement</code> 791 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 792 * this method 793 * @since 1.4 794 */ 795 void setNull(String parameterName, int sqlType) throws SQLException; 796 797 /** 798 * Sets the designated parameter to the given Java <code>boolean</code> value. 799 * The driver converts this 800 * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database. 801 * 802 * @param parameterName the name of the parameter 803 * @param x the parameter value 804 * @exception SQLException if parameterName does not correspond to a named 805 * parameter; if a database access error occurs or 806 * this method is called on a closed <code>CallableStatement</code> 807 * @see #getBoolean 808 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 809 * this method 810 * @since 1.4 811 */ 812 void setBoolean(String parameterName, boolean x) throws SQLException; 813 814 /** 815 * Sets the designated parameter to the given Java <code>byte</code> value. 816 * The driver converts this 817 * to an SQL <code>TINYINT</code> value when it sends it to the database. 818 * 819 * @param parameterName the name of the parameter 820 * @param x the parameter value 821 * @exception SQLException if parameterName does not correspond to a named 822 * parameter; if a database access error occurs or 823 * this method is called on a closed <code>CallableStatement</code> 824 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 825 * this method 826 * @see #getByte 827 * @since 1.4 828 */ 829 void setByte(String parameterName, byte x) throws SQLException; 830 831 /** 832 * Sets the designated parameter to the given Java <code>short</code> value. 833 * The driver converts this 834 * to an SQL <code>SMALLINT</code> value when it sends it to the database. 835 * 836 * @param parameterName the name of the parameter 837 * @param x the parameter value 838 * @exception SQLException if parameterName does not correspond to a named 839 * parameter; if a database access error occurs or 840 * this method is called on a closed <code>CallableStatement</code> 841 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 842 * this method 843 * @see #getShort 844 * @since 1.4 845 */ 846 void setShort(String parameterName, short x) throws SQLException; 847 848 /** 849 * Sets the designated parameter to the given Java <code>int</code> value. 850 * The driver converts this 851 * to an SQL <code>INTEGER</code> value when it sends it to the database. 852 * 853 * @param parameterName the name of the parameter 854 * @param x the parameter value 855 * @exception SQLException if parameterName does not correspond to a named 856 * parameter; if a database access error occurs or 857 * this method is called on a closed <code>CallableStatement</code> 858 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 859 * this method 860 * @see #getInt 861 * @since 1.4 862 */ 863 void setInt(String parameterName, int x) throws SQLException; 864 865 /** 866 * Sets the designated parameter to the given Java <code>long</code> value. 867 * The driver converts this 868 * to an SQL <code>BIGINT</code> value when it sends it to the database. 869 * 870 * @param parameterName the name of the parameter 871 * @param x the parameter value 872 * @exception SQLException if parameterName does not correspond to a named 873 * parameter; if a database access error occurs or 874 * this method is called on a closed <code>CallableStatement</code> 875 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 876 * this method 877 * @see #getLong 878 * @since 1.4 879 */ 880 void setLong(String parameterName, long x) throws SQLException; 881 882 /** 883 * Sets the designated parameter to the given Java <code>float</code> value. 884 * The driver converts this 885 * to an SQL <code>FLOAT</code> value when it sends it to the database. 886 * 887 * @param parameterName the name of the parameter 888 * @param x the parameter value 889 * @exception SQLException if parameterName does not correspond to a named 890 * parameter; if a database access error occurs or 891 * this method is called on a closed <code>CallableStatement</code> 892 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 893 * this method 894 * @see #getFloat 895 * @since 1.4 896 */ 897 void setFloat(String parameterName, float x) throws SQLException; 898 899 /** 900 * Sets the designated parameter to the given Java <code>double</code> value. 901 * The driver converts this 902 * to an SQL <code>DOUBLE</code> value when it sends it to the database. 903 * 904 * @param parameterName the name of the parameter 905 * @param x the parameter value 906 * @exception SQLException if parameterName does not correspond to a named 907 * parameter; if a database access error occurs or 908 * this method is called on a closed <code>CallableStatement</code> 909 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 910 * this method 911 * @see #getDouble 912 * @since 1.4 913 */ 914 void setDouble(String parameterName, double x) throws SQLException; 915 916 /** 917 * Sets the designated parameter to the given 918 * <code>java.math.BigDecimal</code> value. 919 * The driver converts this to an SQL <code>NUMERIC</code> value when 920 * it sends it to the database. 921 * 922 * @param parameterName the name of the parameter 923 * @param x the parameter value 924 * @exception SQLException if parameterName does not correspond to a named 925 * parameter; if a database access error occurs or 926 * this method is called on a closed <code>CallableStatement</code> 927 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 928 * this method 929 * @see #getBigDecimal 930 * @since 1.4 931 */ 932 void setBigDecimal(String parameterName, BigDecimal x) throws SQLException; 933 934 /** 935 * Sets the designated parameter to the given Java <code>String</code> value. 936 * The driver converts this 937 * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value 938 * (depending on the argument's 939 * size relative to the driver's limits on <code>VARCHAR</code> values) 940 * when it sends it to the database. 941 * 942 * @param parameterName the name of the parameter 943 * @param x the parameter value 944 * @exception SQLException if parameterName does not correspond to a named 945 * parameter; if a database access error occurs or 946 * this method is called on a closed <code>CallableStatement</code> 947 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 948 * this method 949 * @see #getString 950 * @since 1.4 951 */ 952 void setString(String parameterName, String x) throws SQLException; 953 954 /** 955 * Sets the designated parameter to the given Java array of bytes. 956 * The driver converts this to an SQL <code>VARBINARY</code> or 957 * <code>LONGVARBINARY</code> (depending on the argument's size relative 958 * to the driver's limits on <code>VARBINARY</code> values) when it sends 959 * it to the database. 960 * 961 * @param parameterName the name of the parameter 962 * @param x the parameter value 963 * @exception SQLException if parameterName does not correspond to a named 964 * parameter; if a database access error occurs or 965 * this method is called on a closed <code>CallableStatement</code> 966 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 967 * this method 968 * @see #getBytes 969 * @since 1.4 970 */ 971 void setBytes(String parameterName, byte x[]) throws SQLException; 972 973 /** 974 * Sets the designated parameter to the given <code>java.sql.Date</code> value 975 * using the default time zone of the virtual machine that is running 976 * the application. 977 * The driver converts this 978 * to an SQL <code>DATE</code> value when it sends it to the database. 979 * 980 * @param parameterName the name of the parameter 981 * @param x the parameter value 982 * @exception SQLException if parameterName does not correspond to a named 983 * parameter; if a database access error occurs or 984 * this method is called on a closed <code>CallableStatement</code> 985 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 986 * this method 987 * @see #getDate 988 * @since 1.4 989 */ 990 void setDate(String parameterName, java.sql.Date x) 991 throws SQLException; 992 993 /** 994 * Sets the designated parameter to the given <code>java.sql.Time</code> value. 995 * The driver converts this 996 * to an SQL <code>TIME</code> value when it sends it to the database. 997 * 998 * @param parameterName the name of the parameter 999 * @param x the parameter value 1000 * @exception SQLException if parameterName does not correspond to a named 1001 * parameter; if a database access error occurs or 1002 * this method is called on a closed <code>CallableStatement</code> 1003 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1004 * this method 1005 * @see #getTime 1006 * @since 1.4 1007 */ 1008 void setTime(String parameterName, java.sql.Time x) 1009 throws SQLException; 1010 1011 /** 1012 * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. 1013 * The driver 1014 * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the 1015 * database. 1016 * 1017 * @param parameterName the name of the parameter 1018 * @param x the parameter value 1019 * @exception SQLException if parameterName does not correspond to a named 1020 * parameter; if a database access error occurs or 1021 * this method is called on a closed <code>CallableStatement</code> 1022 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1023 * this method 1024 * @see #getTimestamp 1025 * @since 1.4 1026 */ 1027 void setTimestamp(String parameterName, java.sql.Timestamp x) 1028 throws SQLException; 1029 1030 /** 1031 * Sets the designated parameter to the given input stream, which will have 1032 * the specified number of bytes. 1033 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 1034 * parameter, it may be more practical to send it via a 1035 * <code>java.io.InputStream</code>. Data will be read from the stream 1036 * as needed until end-of-file is reached. The JDBC driver will 1037 * do any necessary conversion from ASCII to the database char format. 1038 * 1039 * <P><B>Note:</B> This stream object can either be a standard 1040 * Java stream object or your own subclass that implements the 1041 * standard interface. 1042 * 1043 * @param parameterName the name of the parameter 1044 * @param x the Java input stream that contains the ASCII parameter value 1045 * @param length the number of bytes in the stream 1046 * @exception SQLException if parameterName does not correspond to a named 1047 * parameter; if a database access error occurs or 1048 * this method is called on a closed <code>CallableStatement</code> 1049 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1050 * this method 1051 * @since 1.4 1052 */ 1053 void setAsciiStream(String parameterName, java.io.InputStream x, int length) 1054 throws SQLException; 1055 1056 /** 1057 * Sets the designated parameter to the given input stream, which will have 1058 * the specified number of bytes. 1059 * When a very large binary value is input to a <code>LONGVARBINARY</code> 1060 * parameter, it may be more practical to send it via a 1061 * <code>java.io.InputStream</code> object. The data will be read from the stream 1062 * as needed until end-of-file is reached. 1063 * 1064 * <P><B>Note:</B> This stream object can either be a standard 1065 * Java stream object or your own subclass that implements the 1066 * standard interface. 1067 * 1068 * @param parameterName the name of the parameter 1069 * @param x the java input stream which contains the binary parameter value 1070 * @param length the number of bytes in the stream 1071 * @exception SQLException if parameterName does not correspond to a named 1072 * parameter; if a database access error occurs or 1073 * this method is called on a closed <code>CallableStatement</code> 1074 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1075 * this method 1076 * @since 1.4 1077 */ 1078 void setBinaryStream(String parameterName, java.io.InputStream x, 1079 int length) throws SQLException; 1080 1081 /** 1082 * Sets the value of the designated parameter with the given object. 1083 * 1084 * <p>The given Java object will be converted to the given targetSqlType 1085 * before being sent to the database. 1086 * 1087 * If the object has a custom mapping (is of a class implementing the 1088 * interface <code>SQLData</code>), 1089 * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it 1090 * to the SQL data stream. 1091 * If, on the other hand, the object is of a class implementing 1092 * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>, 1093 * <code>Struct</code>, <code>java.net.URL</code>, 1094 * or <code>Array</code>, the driver should pass it to the database as a 1095 * value of the corresponding SQL type. 1096 * <P> 1097 * Note that this method may be used to pass datatabase- 1098 * specific abstract data types. 1099 * 1100 * @param parameterName the name of the parameter 1101 * @param x the object containing the input parameter value 1102 * @param targetSqlType the SQL type (as defined in java.sql.Types) to be 1103 * sent to the database. The scale argument may further qualify this type. 1104 * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, 1105 * this is the number of digits after the decimal point. For all other 1106 * types, this value will be ignored. 1107 * @exception SQLException if parameterName does not correspond to a named 1108 * parameter; if a database access error occurs or 1109 * this method is called on a closed <code>CallableStatement</code> 1110 * @exception SQLFeatureNotSupportedException if 1111 * the JDBC driver does not support the specified targetSqlType 1112 * @see Types 1113 * @see #getObject 1114 * @since 1.4 1115 */ 1116 void setObject(String parameterName, Object x, int targetSqlType, int scale) 1117 throws SQLException; 1118 1119 /** 1120 * Sets the value of the designated parameter with the given object. 1121 * 1122 * This method is similar to {@link #setObject(String parameterName, 1123 * Object x, int targetSqlType, int scaleOrLength)}, 1124 * except that it assumes a scale of zero. 1125 * 1126 * @param parameterName the name of the parameter 1127 * @param x the object containing the input parameter value 1128 * @param targetSqlType the SQL type (as defined in java.sql.Types) to be 1129 * sent to the database 1130 * @exception SQLException if parameterName does not correspond to a named 1131 * parameter; if a database access error occurs or 1132 * this method is called on a closed <code>CallableStatement</code> 1133 * @exception SQLFeatureNotSupportedException if 1134 * the JDBC driver does not support the specified targetSqlType 1135 * @see #getObject 1136 * @since 1.4 1137 */ 1138 void setObject(String parameterName, Object x, int targetSqlType) 1139 throws SQLException; 1140 1141 /** 1142 * Sets the value of the designated parameter with the given object. 1143 * 1144 * <p>The JDBC specification specifies a standard mapping from 1145 * Java <code>Object</code> types to SQL types. The given argument 1146 * will be converted to the corresponding SQL type before being 1147 * sent to the database. 1148 * <p>Note that this method may be used to pass database- 1149 * specific abstract data types, by using a driver-specific Java 1150 * type. 1151 * 1152 * If the object is of a class implementing the interface <code>SQLData</code>, 1153 * the JDBC driver should call the method <code>SQLData.writeSQL</code> 1154 * to write it to the SQL data stream. 1155 * If, on the other hand, the object is of a class implementing 1156 * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>, 1157 * <code>Struct</code>, <code>java.net.URL</code>, 1158 * or <code>Array</code>, the driver should pass it to the database as a 1159 * value of the corresponding SQL type. 1160 * <P> 1161 * This method throws an exception if there is an ambiguity, for example, if the 1162 * object is of a class implementing more than one of the interfaces named above. 1163 * <p> 1164 *<b>Note:</b> Not all databases allow for a non-typed Null to be sent to 1165 * the backend. For maximum portability, the <code>setNull</code> or the 1166 * <code>setObject(String parameterName, Object x, int sqlType)</code> 1167 * method should be used 1168 * instead of <code>setObject(String parameterName, Object x)</code>. 1169 * 1170 * @param parameterName the name of the parameter 1171 * @param x the object containing the input parameter value 1172 * @exception SQLException if parameterName does not correspond to a named 1173 * parameter; if a database access error occurs, 1174 * this method is called on a closed <code>CallableStatement</code> or if the given 1175 * <code>Object</code> parameter is ambiguous 1176 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1177 * this method 1178 * @see #getObject 1179 * @since 1.4 1180 */ 1181 void setObject(String parameterName, Object x) throws SQLException; 1182 1183 1184 /** 1185 * Sets the designated parameter to the given <code>Reader</code> 1186 * object, which is the given number of characters long. 1187 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 1188 * parameter, it may be more practical to send it via a 1189 * <code>java.io.Reader</code> object. The data will be read from the stream 1190 * as needed until end-of-file is reached. The JDBC driver will 1191 * do any necessary conversion from UNICODE to the database char format. 1192 * 1193 * <P><B>Note:</B> This stream object can either be a standard 1194 * Java stream object or your own subclass that implements the 1195 * standard interface. 1196 * 1197 * @param parameterName the name of the parameter 1198 * @param reader the <code>java.io.Reader</code> object that 1199 * contains the UNICODE data used as the designated parameter 1200 * @param length the number of characters in the stream 1201 * @exception SQLException if parameterName does not correspond to a named 1202 * parameter; if a database access error occurs or 1203 * this method is called on a closed <code>CallableStatement</code> 1204 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1205 * this method 1206 * @since 1.4 1207 */ 1208 void setCharacterStream(String parameterName, 1209 java.io.Reader reader, 1210 int length) throws SQLException; 1211 1212 /** 1213 * Sets the designated parameter to the given <code>java.sql.Date</code> value, 1214 * using the given <code>Calendar</code> object. The driver uses 1215 * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value, 1216 * which the driver then sends to the database. With a 1217 * a <code>Calendar</code> object, the driver can calculate the date 1218 * taking into account a custom timezone. If no 1219 * <code>Calendar</code> object is specified, the driver uses the default 1220 * timezone, which is that of the virtual machine running the application. 1221 * 1222 * @param parameterName the name of the parameter 1223 * @param x the parameter value 1224 * @param cal the <code>Calendar</code> object the driver will use 1225 * to construct the date 1226 * @exception SQLException if parameterName does not correspond to a named 1227 * parameter; if a database access error occurs or 1228 * this method is called on a closed <code>CallableStatement</code> 1229 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1230 * this method 1231 * @see #getDate 1232 * @since 1.4 1233 */ 1234 void setDate(String parameterName, java.sql.Date x, Calendar cal) 1235 throws SQLException; 1236 1237 /** 1238 * Sets the designated parameter to the given <code>java.sql.Time</code> value, 1239 * using the given <code>Calendar</code> object. The driver uses 1240 * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value, 1241 * which the driver then sends to the database. With a 1242 * a <code>Calendar</code> object, the driver can calculate the time 1243 * taking into account a custom timezone. If no 1244 * <code>Calendar</code> object is specified, the driver uses the default 1245 * timezone, which is that of the virtual machine running the application. 1246 * 1247 * @param parameterName the name of the parameter 1248 * @param x the parameter value 1249 * @param cal the <code>Calendar</code> object the driver will use 1250 * to construct the time 1251 * @exception SQLException if parameterName does not correspond to a named 1252 * parameter; if a database access error occurs or 1253 * this method is called on a closed <code>CallableStatement</code> 1254 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1255 * this method 1256 * @see #getTime 1257 * @since 1.4 1258 */ 1259 void setTime(String parameterName, java.sql.Time x, Calendar cal) 1260 throws SQLException; 1261 1262 /** 1263 * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value, 1264 * using the given <code>Calendar</code> object. The driver uses 1265 * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value, 1266 * which the driver then sends to the database. With a 1267 * a <code>Calendar</code> object, the driver can calculate the timestamp 1268 * taking into account a custom timezone. If no 1269 * <code>Calendar</code> object is specified, the driver uses the default 1270 * timezone, which is that of the virtual machine running the application. 1271 * 1272 * @param parameterName the name of the parameter 1273 * @param x the parameter value 1274 * @param cal the <code>Calendar</code> object the driver will use 1275 * to construct the timestamp 1276 * @exception SQLException if parameterName does not correspond to a named 1277 * parameter; if a database access error occurs or 1278 * this method is called on a closed <code>CallableStatement</code> 1279 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1280 * this method 1281 * @see #getTimestamp 1282 * @since 1.4 1283 */ 1284 void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal) 1285 throws SQLException; 1286 1287 /** 1288 * Sets the designated parameter to SQL <code>NULL</code>. 1289 * This version of the method <code>setNull</code> should 1290 * be used for user-defined types and REF type parameters. Examples 1291 * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and 1292 * named array types. 1293 * 1294 * <P><B>Note:</B> To be portable, applications must give the 1295 * SQL type code and the fully-qualified SQL type name when specifying 1296 * a NULL user-defined or REF parameter. In the case of a user-defined type 1297 * the name is the type name of the parameter itself. For a REF 1298 * parameter, the name is the type name of the referenced type. 1299 * <p> 1300 * Although it is intended for user-defined and Ref parameters, 1301 * this method may be used to set a null parameter of any JDBC type. 1302 * If the parameter does not have a user-defined or REF type, the given 1303 * typeName is ignored. 1304 * 1305 * 1306 * @param parameterName the name of the parameter 1307 * @param sqlType a value from <code>java.sql.Types</code> 1308 * @param typeName the fully-qualified name of an SQL user-defined type; 1309 * ignored if the parameter is not a user-defined type or 1310 * SQL <code>REF</code> value 1311 * @exception SQLException if parameterName does not correspond to a named 1312 * parameter; if a database access error occurs or 1313 * this method is called on a closed <code>CallableStatement</code> 1314 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1315 * this method 1316 * @since 1.4 1317 */ 1318 void setNull (String parameterName, int sqlType, String typeName) 1319 throws SQLException; 1320 1321 /** 1322 * Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>, 1323 * or <code>LONGVARCHAR</code> parameter as a <code>String</code> in 1324 * the Java programming language. 1325 * <p> 1326 * For the fixed-length type JDBC <code>CHAR</code>, 1327 * the <code>String</code> object 1328 * returned has exactly the same value the SQL 1329 * <code>CHAR</code> value had in the 1330 * database, including any padding added by the database. 1331 * @param parameterName the name of the parameter 1332 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1333 * is <code>null</code>. 1334 * @exception SQLException if parameterName does not correspond to a named 1335 * parameter; if a database access error occurs or 1336 * this method is called on a closed <code>CallableStatement</code> 1337 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1338 * this method 1339 * @see #setString 1340 * @since 1.4 1341 */ 1342 String getString(String parameterName) throws SQLException; 1343 1344 /** 1345 * Retrieves the value of a JDBC <code>BIT</code> or <code>BOOLEAN</code> 1346 * parameter as a 1347 * <code>boolean</code> in the Java programming language. 1348 * @param parameterName the name of the parameter 1349 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1350 * is <code>false</code>. 1351 * @exception SQLException if parameterName does not correspond to a named 1352 * parameter; if a database access error occurs or 1353 * this method is called on a closed <code>CallableStatement</code> 1354 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1355 * this method 1356 * @see #setBoolean 1357 * @since 1.4 1358 */ 1359 boolean getBoolean(String parameterName) throws SQLException; 1360 1361 /** 1362 * Retrieves the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code> 1363 * in the Java programming language. 1364 * @param parameterName the name of the parameter 1365 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1366 * is <code>0</code>. 1367 * @exception SQLException if parameterName does not correspond to a named 1368 * parameter; if a database access error occurs or 1369 * this method is called on a closed <code>CallableStatement</code> 1370 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1371 * this method 1372 * @see #setByte 1373 * @since 1.4 1374 */ 1375 byte getByte(String parameterName) throws SQLException; 1376 1377 /** 1378 * Retrieves the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code> 1379 * in the Java programming language. 1380 * @param parameterName the name of the parameter 1381 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1382 * is <code>0</code>. 1383 * @exception SQLException if parameterName does not correspond to a named 1384 * parameter; if a database access error occurs or 1385 * this method is called on a closed <code>CallableStatement</code> 1386 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1387 * this method 1388 * @see #setShort 1389 * @since 1.4 1390 */ 1391 short getShort(String parameterName) throws SQLException; 1392 1393 /** 1394 * Retrieves the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code> 1395 * in the Java programming language. 1396 * 1397 * @param parameterName the name of the parameter 1398 * @return the parameter value. If the value is SQL <code>NULL</code>, 1399 * the result is <code>0</code>. 1400 * @exception SQLException if parameterName does not correspond to a named 1401 * parameter; if a database access error occurs or 1402 * this method is called on a closed <code>CallableStatement</code> 1403 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1404 * this method 1405 * @see #setInt 1406 * @since 1.4 1407 */ 1408 int getInt(String parameterName) throws SQLException; 1409 1410 /** 1411 * Retrieves the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code> 1412 * in the Java programming language. 1413 * 1414 * @param parameterName the name of the parameter 1415 * @return the parameter value. If the value is SQL <code>NULL</code>, 1416 * the result is <code>0</code>. 1417 * @exception SQLException if parameterName does not correspond to a named 1418 * parameter; if a database access error occurs or 1419 * this method is called on a closed <code>CallableStatement</code> 1420 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1421 * this method 1422 * @see #setLong 1423 * @since 1.4 1424 */ 1425 long getLong(String parameterName) throws SQLException; 1426 1427 /** 1428 * Retrieves the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code> 1429 * in the Java programming language. 1430 * @param parameterName the name of the parameter 1431 * @return the parameter value. If the value is SQL <code>NULL</code>, 1432 * the result is <code>0</code>. 1433 * @exception SQLException if parameterName does not correspond to a named 1434 * parameter; if a database access error occurs or 1435 * this method is called on a closed <code>CallableStatement</code> 1436 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1437 * this method 1438 * @see #setFloat 1439 * @since 1.4 1440 */ 1441 float getFloat(String parameterName) throws SQLException; 1442 1443 /** 1444 * Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code> 1445 * in the Java programming language. 1446 * @param parameterName the name of the parameter 1447 * @return the parameter value. If the value is SQL <code>NULL</code>, 1448 * the result is <code>0</code>. 1449 * @exception SQLException if parameterName does not correspond to a named 1450 * parameter; if a database access error occurs or 1451 * this method is called on a closed <code>CallableStatement</code> 1452 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1453 * this method 1454 * @see #setDouble 1455 * @since 1.4 1456 */ 1457 double getDouble(String parameterName) throws SQLException; 1458 1459 /** 1460 * Retrieves the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code> 1461 * parameter as an array of <code>byte</code> values in the Java 1462 * programming language. 1463 * @param parameterName the name of the parameter 1464 * @return the parameter value. If the value is SQL <code>NULL</code>, the result is 1465 * <code>null</code>. 1466 * @exception SQLException if parameterName does not correspond to a named 1467 * parameter; if a database access error occurs or 1468 * this method is called on a closed <code>CallableStatement</code> 1469 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1470 * this method 1471 * @see #setBytes 1472 * @since 1.4 1473 */ 1474 byte[] getBytes(String parameterName) throws SQLException; 1475 1476 /** 1477 * Retrieves the value of a JDBC <code>DATE</code> parameter as a 1478 * <code>java.sql.Date</code> object. 1479 * @param parameterName the name of the parameter 1480 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1481 * is <code>null</code>. 1482 * @exception SQLException if parameterName does not correspond to a named 1483 * parameter; if a database access error occurs or 1484 * this method is called on a closed <code>CallableStatement</code> 1485 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1486 * this method 1487 * @see #setDate 1488 * @since 1.4 1489 */ 1490 java.sql.Date getDate(String parameterName) throws SQLException; 1491 1492 /** 1493 * Retrieves the value of a JDBC <code>TIME</code> parameter as a 1494 * <code>java.sql.Time</code> object. 1495 * @param parameterName the name of the parameter 1496 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1497 * is <code>null</code>. 1498 * @exception SQLException if parameterName does not correspond to a named 1499 * parameter; if a database access error occurs or 1500 * this method is called on a closed <code>CallableStatement</code> 1501 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1502 * this method 1503 * @see #setTime 1504 * @since 1.4 1505 */ 1506 java.sql.Time getTime(String parameterName) throws SQLException; 1507 1508 /** 1509 * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a 1510 * <code>java.sql.Timestamp</code> object. 1511 * @param parameterName the name of the parameter 1512 * @return the parameter value. If the value is SQL <code>NULL</code>, the result 1513 * is <code>null</code>. 1514 * @exception SQLException if parameterName does not correspond to a named 1515 * parameter; if a database access error occurs or 1516 * this method is called on a closed <code>CallableStatement</code> 1517 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1518 * this method 1519 * @see #setTimestamp 1520 * @since 1.4 1521 */ 1522 java.sql.Timestamp getTimestamp(String parameterName) throws SQLException; 1523 1524 /** 1525 * Retrieves the value of a parameter as an <code>Object</code> in the Java 1526 * programming language. If the value is an SQL <code>NULL</code>, the 1527 * driver returns a Java <code>null</code>. 1528 * <p> 1529 * This method returns a Java object whose type corresponds to the JDBC 1530 * type that was registered for this parameter using the method 1531 * <code>registerOutParameter</code>. By registering the target JDBC 1532 * type as <code>java.sql.Types.OTHER</code>, this method can be used 1533 * to read database-specific abstract data types. 1534 * @param parameterName the name of the parameter 1535 * @return A <code>java.lang.Object</code> holding the OUT parameter value. 1536 * @exception SQLException if parameterName does not correspond to a named 1537 * parameter; if a database access error occurs or 1538 * this method is called on a closed <code>CallableStatement</code> 1539 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1540 * this method 1541 * @see Types 1542 * @see #setObject 1543 * @since 1.4 1544 */ 1545 Object getObject(String parameterName) throws SQLException; 1546 1547 /** 1548 * Retrieves the value of a JDBC <code>NUMERIC</code> parameter as a 1549 * <code>java.math.BigDecimal</code> object with as many digits to the 1550 * right of the decimal point as the value contains. 1551 * @param parameterName the name of the parameter 1552 * @return the parameter value in full precision. If the value is 1553 * SQL <code>NULL</code>, the result is <code>null</code>. 1554 * @exception SQLException if parameterName does not correspond to a named 1555 * parameter; if a database access error occurs or 1556 * this method is called on a closed <code>CallableStatement</code> 1557 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1558 * this method 1559 * @see #setBigDecimal 1560 * @since 1.4 1561 */ 1562 BigDecimal getBigDecimal(String parameterName) throws SQLException; 1563 1564 /** 1565 * Returns an object representing the value of OUT parameter 1566 * <code>parameterName</code> and uses <code>map</code> for the custom 1567 * mapping of the parameter value. 1568 * <p> 1569 * This method returns a Java object whose type corresponds to the 1570 * JDBC type that was registered for this parameter using the method 1571 * <code>registerOutParameter</code>. By registering the target 1572 * JDBC type as <code>java.sql.Types.OTHER</code>, this method can 1573 * be used to read database-specific abstract data types. 1574 * @param parameterName the name of the parameter 1575 * @param map the mapping from SQL type names to Java classes 1576 * @return a <code>java.lang.Object</code> holding the OUT parameter value 1577 * @exception SQLException if parameterName does not correspond to a named 1578 * parameter; if a database access error occurs or 1579 * this method is called on a closed <code>CallableStatement</code> 1580 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1581 * this method 1582 * @see #setObject 1583 * @since 1.4 1584 */ 1585 Object getObject(String parameterName, java.util.Map<String,Class<?>> map) 1586 throws SQLException; 1587 1588 /** 1589 * Retrieves the value of a JDBC <code>REF(<structured-type>)</code> 1590 * parameter as a {@link java.sql.Ref} object in the Java programming language. 1591 * 1592 * @param parameterName the name of the parameter 1593 * @return the parameter value as a <code>Ref</code> object in the 1594 * Java programming language. If the value was SQL <code>NULL</code>, 1595 * the value <code>null</code> is returned. 1596 * @exception SQLException if parameterName does not correspond to a named 1597 * parameter; if a database access error occurs or 1598 * this method is called on a closed <code>CallableStatement</code> 1599 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1600 * this method 1601 * @since 1.4 1602 */ 1603 Ref getRef (String parameterName) throws SQLException; 1604 1605 /** 1606 * Retrieves the value of a JDBC <code>BLOB</code> parameter as a 1607 * {@link java.sql.Blob} object in the Java programming language. 1608 * 1609 * @param parameterName the name of the parameter 1610 * @return the parameter value as a <code>Blob</code> object in the 1611 * Java programming language. If the value was SQL <code>NULL</code>, 1612 * the value <code>null</code> is returned. 1613 * @exception SQLException if parameterName does not correspond to a named 1614 * parameter; if a database access error occurs or 1615 * this method is called on a closed <code>CallableStatement</code> 1616 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1617 * this method 1618 * @since 1.4 1619 */ 1620 Blob getBlob (String parameterName) throws SQLException; 1621 1622 /** 1623 * Retrieves the value of a JDBC <code>CLOB</code> parameter as a 1624 * <code>java.sql.Clob</code> object in the Java programming language. 1625 * @param parameterName the name of the parameter 1626 * @return the parameter value as a <code>Clob</code> object in the 1627 * Java programming language. If the value was SQL <code>NULL</code>, 1628 * the value <code>null</code> is returned. 1629 * @exception SQLException if parameterName does not correspond to a named 1630 * parameter; if a database access error occurs or 1631 * this method is called on a closed <code>CallableStatement</code> 1632 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1633 * this method 1634 * @since 1.4 1635 */ 1636 Clob getClob (String parameterName) throws SQLException; 1637 1638 /** 1639 * Retrieves the value of a JDBC <code>ARRAY</code> parameter as an 1640 * {@link java.sql.Array} object in the Java programming language. 1641 * 1642 * @param parameterName the name of the parameter 1643 * @return the parameter value as an <code>Array</code> object in 1644 * Java programming language. If the value was SQL <code>NULL</code>, 1645 * the value <code>null</code> is returned. 1646 * @exception SQLException if parameterName does not correspond to a named 1647 * parameter; if a database access error occurs or 1648 * this method is called on a closed <code>CallableStatement</code> 1649 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1650 * this method 1651 * @since 1.4 1652 */ 1653 Array getArray (String parameterName) throws SQLException; 1654 1655 /** 1656 * Retrieves the value of a JDBC <code>DATE</code> parameter as a 1657 * <code>java.sql.Date</code> object, using 1658 * the given <code>Calendar</code> object 1659 * to construct the date. 1660 * With a <code>Calendar</code> object, the driver 1661 * can calculate the date taking into account a custom timezone and locale. 1662 * If no <code>Calendar</code> object is specified, the driver uses the 1663 * default timezone and locale. 1664 * 1665 * @param parameterName the name of the parameter 1666 * @param cal the <code>Calendar</code> object the driver will use 1667 * to construct the date 1668 * @return the parameter value. If the value is SQL <code>NULL</code>, 1669 * the result is <code>null</code>. 1670 * @exception SQLException if parameterName does not correspond to a named 1671 * parameter; if a database access error occurs or 1672 * this method is called on a closed <code>CallableStatement</code> 1673 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1674 * this method 1675 * @see #setDate 1676 * @since 1.4 1677 */ 1678 java.sql.Date getDate(String parameterName, Calendar cal) 1679 throws SQLException; 1680 1681 /** 1682 * Retrieves the value of a JDBC <code>TIME</code> parameter as a 1683 * <code>java.sql.Time</code> object, using 1684 * the given <code>Calendar</code> object 1685 * to construct the time. 1686 * With a <code>Calendar</code> object, the driver 1687 * can calculate the time taking into account a custom timezone and locale. 1688 * If no <code>Calendar</code> object is specified, the driver uses the 1689 * default timezone and locale. 1690 * 1691 * @param parameterName the name of the parameter 1692 * @param cal the <code>Calendar</code> object the driver will use 1693 * to construct the time 1694 * @return the parameter value; if the value is SQL <code>NULL</code>, the result is 1695 * <code>null</code>. 1696 * @exception SQLException if parameterName does not correspond to a named 1697 * parameter; if a database access error occurs or 1698 * this method is called on a closed <code>CallableStatement</code> 1699 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1700 * this method 1701 * @see #setTime 1702 * @since 1.4 1703 */ 1704 java.sql.Time getTime(String parameterName, Calendar cal) 1705 throws SQLException; 1706 1707 /** 1708 * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a 1709 * <code>java.sql.Timestamp</code> object, using 1710 * the given <code>Calendar</code> object to construct 1711 * the <code>Timestamp</code> object. 1712 * With a <code>Calendar</code> object, the driver 1713 * can calculate the timestamp taking into account a custom timezone and locale. 1714 * If no <code>Calendar</code> object is specified, the driver uses the 1715 * default timezone and locale. 1716 * 1717 * 1718 * @param parameterName the name of the parameter 1719 * @param cal the <code>Calendar</code> object the driver will use 1720 * to construct the timestamp 1721 * @return the parameter value. If the value is SQL <code>NULL</code>, the result is 1722 * <code>null</code>. 1723 * @exception SQLException if parameterName does not correspond to a named 1724 * parameter; if a database access error occurs or 1725 * this method is called on a closed <code>CallableStatement</code> 1726 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1727 * this method 1728 * @see #setTimestamp 1729 * @since 1.4 1730 */ 1731 java.sql.Timestamp getTimestamp(String parameterName, Calendar cal) 1732 throws SQLException; 1733 1734 /** 1735 * Retrieves the value of a JDBC <code>DATALINK</code> parameter as a 1736 * <code>java.net.URL</code> object. 1737 * 1738 * @param parameterName the name of the parameter 1739 * @return the parameter value as a <code>java.net.URL</code> object in the 1740 * Java programming language. If the value was SQL <code>NULL</code>, the 1741 * value <code>null</code> is returned. 1742 * @exception SQLException if parameterName does not correspond to a named 1743 * parameter; if a database access error occurs, 1744 * this method is called on a closed <code>CallableStatement</code>, 1745 * or if there is a problem with the URL 1746 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1747 * this method 1748 * @see #setURL 1749 * @since 1.4 1750 */ 1751 java.net.URL getURL(String parameterName) throws SQLException; 1752 1753 //------------------------- JDBC 4.0 ----------------------------------- 1754 1755 /** 1756 * Retrieves the value of the designated JDBC <code>ROWID</code> parameter as a 1757 * <code>java.sql.RowId</code> object. 1758 * 1759 * @param parameterIndex the first parameter is 1, the second is 2,... 1760 * @return a <code>RowId</code> object that represents the JDBC <code>ROWID</code> 1761 * value is used as the designated parameter. If the parameter contains 1762 * a SQL <code>NULL</code>, then a <code>null</code> value is returned. 1763 * @throws SQLException if the parameterIndex is not valid; 1764 * if a database access error occurs or 1765 * this method is called on a closed <code>CallableStatement</code> 1766 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1767 * this method 1768 * @since 1.6 1769 */ 1770 RowId getRowId(int parameterIndex) throws SQLException; 1771 1772 /** 1773 * Retrieves the value of the designated JDBC <code>ROWID</code> parameter as a 1774 * <code>java.sql.RowId</code> object. 1775 * 1776 * @param parameterName the name of the parameter 1777 * @return a <code>RowId</code> object that represents the JDBC <code>ROWID</code> 1778 * value is used as the designated parameter. If the parameter contains 1779 * a SQL <code>NULL</code>, then a <code>null</code> value is returned. 1780 * @throws SQLException if parameterName does not correspond to a named 1781 * parameter; if a database access error occurs or 1782 * this method is called on a closed <code>CallableStatement</code> 1783 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1784 * this method 1785 * @since 1.6 1786 */ 1787 RowId getRowId(String parameterName) throws SQLException; 1788 1789 /** 1790 * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The 1791 * driver converts this to a SQL <code>ROWID</code> when it sends it to the 1792 * database. 1793 * 1794 * @param parameterName the name of the parameter 1795 * @param x the parameter value 1796 * @throws SQLException if parameterName does not correspond to a named 1797 * parameter; if a database access error occurs or 1798 * this method is called on a closed <code>CallableStatement</code> 1799 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1800 * this method 1801 * @since 1.6 1802 */ 1803 void setRowId(String parameterName, RowId x) throws SQLException; 1804 1805 /** 1806 * Sets the designated parameter to the given <code>String</code> object. 1807 * The driver converts this to a SQL <code>NCHAR</code> or 1808 * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> 1809 * @param parameterName the name of the parameter to be set 1810 * @param value the parameter value 1811 * @throws SQLException if parameterName does not correspond to a named 1812 * parameter; if the driver does not support national 1813 * character sets; if the driver can detect that a data conversion 1814 * error could occur; if a database access error occurs or 1815 * this method is called on a closed <code>CallableStatement</code> 1816 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1817 * this method 1818 * @since 1.6 1819 */ 1820 void setNString(String parameterName, String value) 1821 throws SQLException; 1822 1823 /** 1824 * Sets the designated parameter to a <code>Reader</code> object. The 1825 * <code>Reader</code> reads the data till end-of-file is reached. The 1826 * driver does the necessary conversion from Java character format to 1827 * the national character set in the database. 1828 * @param parameterName the name of the parameter to be set 1829 * @param value the parameter value 1830 * @param length the number of characters in the parameter data. 1831 * @throws SQLException if parameterName does not correspond to a named 1832 * parameter; if the driver does not support national 1833 * character sets; if the driver can detect that a data conversion 1834 * error could occur; if a database access error occurs or 1835 * this method is called on a closed <code>CallableStatement</code> 1836 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1837 * this method 1838 * @since 1.6 1839 */ 1840 void setNCharacterStream(String parameterName, Reader value, long length) 1841 throws SQLException; 1842 1843 /** 1844 * Sets the designated parameter to a <code>java.sql.NClob</code> object. The object 1845 * implements the <code>java.sql.NClob</code> interface. This <code>NClob</code> 1846 * object maps to a SQL <code>NCLOB</code>. 1847 * @param parameterName the name of the parameter to be set 1848 * @param value the parameter value 1849 * @throws SQLException if parameterName does not correspond to a named 1850 * parameter; if the driver does not support national 1851 * character sets; if the driver can detect that a data conversion 1852 * error could occur; if a database access error occurs or 1853 * this method is called on a closed <code>CallableStatement</code> 1854 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1855 * this method 1856 * @since 1.6 1857 */ 1858 void setNClob(String parameterName, NClob value) throws SQLException; 1859 1860 /** 1861 * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number 1862 * of characters specified by length otherwise a <code>SQLException</code> will be 1863 * generated when the <code>CallableStatement</code> is executed. 1864 * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method 1865 * because it informs the driver that the parameter value should be sent to 1866 * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the 1867 * driver may have to do extra work to determine whether the parameter 1868 * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code> 1869 * @param parameterName the name of the parameter to be set 1870 * @param reader An object that contains the data to set the parameter value to. 1871 * @param length the number of characters in the parameter data. 1872 * @throws SQLException if parameterName does not correspond to a named 1873 * parameter; if the length specified is less than zero; 1874 * a database access error occurs or 1875 * this method is called on a closed <code>CallableStatement</code> 1876 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1877 * this method 1878 * 1879 * @since 1.6 1880 */ 1881 void setClob(String parameterName, Reader reader, long length) 1882 throws SQLException; 1883 1884 /** 1885 * Sets the designated parameter to a {@code InputStream} object. 1886 * The <code>Inputstream</code> must contain the number 1887 * of characters specified by length, otherwise a <code>SQLException</code> will be 1888 * generated when the <code>CallableStatement</code> is executed. 1889 * This method differs from the <code>setBinaryStream (int, InputStream, int)</code> 1890 * method because it informs the driver that the parameter value should be 1891 * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, 1892 * the driver may have to do extra work to determine whether the parameter 1893 * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code> 1894 * 1895 * @param parameterName the name of the parameter to be set 1896 * the second is 2, ... 1897 * 1898 * @param inputStream An object that contains the data to set the parameter 1899 * value to. 1900 * @param length the number of bytes in the parameter data. 1901 * @throws SQLException if parameterName does not correspond to a named 1902 * parameter; if the length specified 1903 * is less than zero; if the number of bytes in the Inputstream does not match 1904 * the specified length; if a database access error occurs or 1905 * this method is called on a closed <code>CallableStatement</code> 1906 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1907 * this method 1908 * 1909 * @since 1.6 1910 */ 1911 void setBlob(String parameterName, InputStream inputStream, long length) 1912 throws SQLException; 1913 /** 1914 * Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number 1915 * of characters specified by length otherwise a <code>SQLException</code> will be 1916 * generated when the <code>CallableStatement</code> is executed. 1917 * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method 1918 * because it informs the driver that the parameter value should be sent to 1919 * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the 1920 * driver may have to do extra work to determine whether the parameter 1921 * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code> 1922 * 1923 * @param parameterName the name of the parameter to be set 1924 * @param reader An object that contains the data to set the parameter value to. 1925 * @param length the number of characters in the parameter data. 1926 * @throws SQLException if parameterName does not correspond to a named 1927 * parameter; if the length specified is less than zero; 1928 * if the driver does not support national 1929 * character sets; if the driver can detect that a data conversion 1930 * error could occur; if a database access error occurs or 1931 * this method is called on a closed <code>CallableStatement</code> 1932 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1933 * this method 1934 * @since 1.6 1935 */ 1936 void setNClob(String parameterName, Reader reader, long length) 1937 throws SQLException; 1938 1939 /** 1940 * Retrieves the value of the designated JDBC <code>NCLOB</code> parameter as a 1941 * <code>java.sql.NClob</code> object in the Java programming language. 1942 * 1943 * @param parameterIndex the first parameter is 1, the second is 2, and 1944 * so on 1945 * @return the parameter value as a <code>NClob</code> object in the 1946 * Java programming language. If the value was SQL <code>NULL</code>, the 1947 * value <code>null</code> is returned. 1948 * @exception SQLException if the parameterIndex is not valid; 1949 * if the driver does not support national 1950 * character sets; if the driver can detect that a data conversion 1951 * error could occur; if a database access error occurs or 1952 * this method is called on a closed <code>CallableStatement</code> 1953 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1954 * this method 1955 * @since 1.6 1956 */ 1957 NClob getNClob (int parameterIndex) throws SQLException; 1958 1959 1960 /** 1961 * Retrieves the value of a JDBC <code>NCLOB</code> parameter as a 1962 * <code>java.sql.NClob</code> object in the Java programming language. 1963 * @param parameterName the name of the parameter 1964 * @return the parameter value as a <code>NClob</code> object in the 1965 * Java programming language. If the value was SQL <code>NULL</code>, 1966 * the value <code>null</code> is returned. 1967 * @exception SQLException if parameterName does not correspond to a named 1968 * parameter; if the driver does not support national 1969 * character sets; if the driver can detect that a data conversion 1970 * error could occur; if a database access error occurs or 1971 * this method is called on a closed <code>CallableStatement</code> 1972 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1973 * this method 1974 * @since 1.6 1975 */ 1976 NClob getNClob (String parameterName) throws SQLException; 1977 1978 /** 1979 * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an 1980 * <code>SQL XML</code> value when it sends it to the database. 1981 * 1982 * @param parameterName the name of the parameter 1983 * @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value 1984 * @throws SQLException if parameterName does not correspond to a named 1985 * parameter; if a database access error occurs; 1986 * this method is called on a closed <code>CallableStatement</code> or 1987 * the <code>java.xml.transform.Result</code>, 1988 * <code>Writer</code> or <code>OutputStream</code> has not been closed for the <code>SQLXML</code> object 1989 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1990 * this method 1991 * 1992 * @since 1.6 1993 */ 1994 void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException; 1995 1996 /** 1997 * Retrieves the value of the designated <code>SQL XML</code> parameter as a 1998 * <code>java.sql.SQLXML</code> object in the Java programming language. 1999 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 2000 * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value 2001 * @throws SQLException if the parameterIndex is not valid; 2002 * if a database access error occurs or 2003 * this method is called on a closed <code>CallableStatement</code> 2004 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2005 * this method 2006 * @since 1.6 2007 */ 2008 SQLXML getSQLXML(int parameterIndex) throws SQLException; 2009 2010 /** 2011 * Retrieves the value of the designated <code>SQL XML</code> parameter as a 2012 * <code>java.sql.SQLXML</code> object in the Java programming language. 2013 * @param parameterName the name of the parameter 2014 * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value 2015 * @throws SQLException if parameterName does not correspond to a named 2016 * parameter; if a database access error occurs or 2017 * this method is called on a closed <code>CallableStatement</code> 2018 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2019 * this method 2020 * @since 1.6 2021 */ 2022 SQLXML getSQLXML(String parameterName) throws SQLException; 2023 2024 /** 2025 * Retrieves the value of the designated <code>NCHAR</code>, 2026 * <code>NVARCHAR</code> 2027 * or <code>LONGNVARCHAR</code> parameter as 2028 * a <code>String</code> in the Java programming language. 2029 * <p> 2030 * For the fixed-length type JDBC <code>NCHAR</code>, 2031 * the <code>String</code> object 2032 * returned has exactly the same value the SQL 2033 * <code>NCHAR</code> value had in the 2034 * database, including any padding added by the database. 2035 * 2036 * @param parameterIndex index of the first parameter is 1, the second is 2, ... 2037 * @return a <code>String</code> object that maps an 2038 * <code>NCHAR</code>, <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value 2039 * @exception SQLException if the parameterIndex is not valid; 2040 * if a database access error occurs or 2041 * this method is called on a closed <code>CallableStatement</code> 2042 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2043 * this method 2044 * @since 1.6 2045 * @see #setNString 2046 */ 2047 String getNString(int parameterIndex) throws SQLException; 2048 2049 2050 /** 2051 * Retrieves the value of the designated <code>NCHAR</code>, 2052 * <code>NVARCHAR</code> 2053 * or <code>LONGNVARCHAR</code> parameter as 2054 * a <code>String</code> in the Java programming language. 2055 * <p> 2056 * For the fixed-length type JDBC <code>NCHAR</code>, 2057 * the <code>String</code> object 2058 * returned has exactly the same value the SQL 2059 * <code>NCHAR</code> value had in the 2060 * database, including any padding added by the database. 2061 * 2062 * @param parameterName the name of the parameter 2063 * @return a <code>String</code> object that maps an 2064 * <code>NCHAR</code>, <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value 2065 * @exception SQLException if parameterName does not correspond to a named 2066 * parameter; 2067 * if a database access error occurs or 2068 * this method is called on a closed <code>CallableStatement</code> 2069 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2070 * this method 2071 * @since 1.6 2072 * @see #setNString 2073 */ 2074 String getNString(String parameterName) throws SQLException; 2075 2076 /** 2077 * Retrieves the value of the designated parameter as a 2078 * <code>java.io.Reader</code> object in the Java programming language. 2079 * It is intended for use when 2080 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 2081 * and <code>LONGNVARCHAR</code> parameters. 2082 * 2083 * @return a <code>java.io.Reader</code> object that contains the parameter 2084 * value; if the value is SQL <code>NULL</code>, the value returned is 2085 * <code>null</code> in the Java programming language. 2086 * @param parameterIndex the first parameter is 1, the second is 2, ... 2087 * @exception SQLException if the parameterIndex is not valid; 2088 * if a database access error occurs or 2089 * this method is called on a closed <code>CallableStatement</code> 2090 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2091 * this method 2092 * @since 1.6 2093 */ 2094 java.io.Reader getNCharacterStream(int parameterIndex) throws SQLException; 2095 2096 /** 2097 * Retrieves the value of the designated parameter as a 2098 * <code>java.io.Reader</code> object in the Java programming language. 2099 * It is intended for use when 2100 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 2101 * and <code>LONGNVARCHAR</code> parameters. 2102 * 2103 * @param parameterName the name of the parameter 2104 * @return a <code>java.io.Reader</code> object that contains the parameter 2105 * value; if the value is SQL <code>NULL</code>, the value returned is 2106 * <code>null</code> in the Java programming language 2107 * @exception SQLException if parameterName does not correspond to a named 2108 * parameter; if a database access error occurs or 2109 * this method is called on a closed <code>CallableStatement</code> 2110 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2111 * this method 2112 * @since 1.6 2113 */ 2114 java.io.Reader getNCharacterStream(String parameterName) throws SQLException; 2115 2116 /** 2117 * Retrieves the value of the designated parameter as a 2118 * <code>java.io.Reader</code> object in the Java programming language. 2119 * 2120 * @return a <code>java.io.Reader</code> object that contains the parameter 2121 * value; if the value is SQL <code>NULL</code>, the value returned is 2122 * <code>null</code> in the Java programming language. 2123 * @param parameterIndex the first parameter is 1, the second is 2, ... 2124 * @exception SQLException if the parameterIndex is not valid; if a database access error occurs or 2125 * this method is called on a closed <code>CallableStatement</code> 2126 * @since 1.6 2127 */ 2128 java.io.Reader getCharacterStream(int parameterIndex) throws SQLException; 2129 2130 /** 2131 * Retrieves the value of the designated parameter as a 2132 * <code>java.io.Reader</code> object in the Java programming language. 2133 * 2134 * @param parameterName the name of the parameter 2135 * @return a <code>java.io.Reader</code> object that contains the parameter 2136 * value; if the value is SQL <code>NULL</code>, the value returned is 2137 * <code>null</code> in the Java programming language 2138 * @exception SQLException if parameterName does not correspond to a named 2139 * parameter; if a database access error occurs or 2140 * this method is called on a closed <code>CallableStatement</code> 2141 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2142 * this method 2143 * @since 1.6 2144 */ 2145 java.io.Reader getCharacterStream(String parameterName) throws SQLException; 2146 2147 /** 2148 * Sets the designated parameter to the given <code>java.sql.Blob</code> object. 2149 * The driver converts this to an SQL <code>BLOB</code> value when it 2150 * sends it to the database. 2151 * 2152 * @param parameterName the name of the parameter 2153 * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value 2154 * @exception SQLException if parameterName does not correspond to a named 2155 * parameter; if a database access error occurs or 2156 * this method is called on a closed <code>CallableStatement</code> 2157 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2158 * this method 2159 * @since 1.6 2160 */ 2161 void setBlob (String parameterName, Blob x) throws SQLException; 2162 2163 /** 2164 * Sets the designated parameter to the given <code>java.sql.Clob</code> object. 2165 * The driver converts this to an SQL <code>CLOB</code> value when it 2166 * sends it to the database. 2167 * 2168 * @param parameterName the name of the parameter 2169 * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value 2170 * @exception SQLException if parameterName does not correspond to a named 2171 * parameter; if a database access error occurs or 2172 * this method is called on a closed <code>CallableStatement</code> 2173 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2174 * this method 2175 * @since 1.6 2176 */ 2177 void setClob (String parameterName, Clob x) throws SQLException; 2178 /** 2179 * Sets the designated parameter to the given input stream, which will have 2180 * the specified number of bytes. 2181 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 2182 * parameter, it may be more practical to send it via a 2183 * <code>java.io.InputStream</code>. Data will be read from the stream 2184 * as needed until end-of-file is reached. The JDBC driver will 2185 * do any necessary conversion from ASCII to the database char format. 2186 * 2187 * <P><B>Note:</B> This stream object can either be a standard 2188 * Java stream object or your own subclass that implements the 2189 * standard interface. 2190 * 2191 * @param parameterName the name of the parameter 2192 * @param x the Java input stream that contains the ASCII parameter value 2193 * @param length the number of bytes in the stream 2194 * @exception SQLException if parameterName does not correspond to a named 2195 * parameter; if a database access error occurs or 2196 * this method is called on a closed <code>CallableStatement</code> 2197 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2198 * this method 2199 * @since 1.6 2200 */ 2201 void setAsciiStream(String parameterName, java.io.InputStream x, long length) 2202 throws SQLException; 2203 2204 /** 2205 * Sets the designated parameter to the given input stream, which will have 2206 * the specified number of bytes. 2207 * When a very large binary value is input to a <code>LONGVARBINARY</code> 2208 * parameter, it may be more practical to send it via a 2209 * <code>java.io.InputStream</code> object. The data will be read from the stream 2210 * as needed until end-of-file is reached. 2211 * 2212 * <P><B>Note:</B> This stream object can either be a standard 2213 * Java stream object or your own subclass that implements the 2214 * standard interface. 2215 * 2216 * @param parameterName the name of the parameter 2217 * @param x the java input stream which contains the binary parameter value 2218 * @param length the number of bytes in the stream 2219 * @exception SQLException if parameterName does not correspond to a named 2220 * parameter; if a database access error occurs or 2221 * this method is called on a closed <code>CallableStatement</code> 2222 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2223 * this method 2224 * @since 1.6 2225 */ 2226 void setBinaryStream(String parameterName, java.io.InputStream x, 2227 long length) throws SQLException; 2228 /** 2229 * Sets the designated parameter to the given <code>Reader</code> 2230 * object, which is the given number of characters long. 2231 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 2232 * parameter, it may be more practical to send it via a 2233 * <code>java.io.Reader</code> object. The data will be read from the stream 2234 * as needed until end-of-file is reached. The JDBC driver will 2235 * do any necessary conversion from UNICODE to the database char format. 2236 * 2237 * <P><B>Note:</B> This stream object can either be a standard 2238 * Java stream object or your own subclass that implements the 2239 * standard interface. 2240 * 2241 * @param parameterName the name of the parameter 2242 * @param reader the <code>java.io.Reader</code> object that 2243 * contains the UNICODE data used as the designated parameter 2244 * @param length the number of characters in the stream 2245 * @exception SQLException if parameterName does not correspond to a named 2246 * parameter; if a database access error occurs or 2247 * this method is called on a closed <code>CallableStatement</code> 2248 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2249 * this method 2250 * @since 1.6 2251 */ 2252 void setCharacterStream(String parameterName, 2253 java.io.Reader reader, 2254 long length) throws SQLException; 2255 //-- 2256 /** 2257 * Sets the designated parameter to the given input stream. 2258 * When a very large ASCII value is input to a <code>LONGVARCHAR</code> 2259 * parameter, it may be more practical to send it via a 2260 * <code>java.io.InputStream</code>. Data will be read from the stream 2261 * as needed until end-of-file is reached. The JDBC driver will 2262 * do any necessary conversion from ASCII to the database char format. 2263 * 2264 * <P><B>Note:</B> This stream object can either be a standard 2265 * Java stream object or your own subclass that implements the 2266 * standard interface. 2267 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2268 * it might be more efficient to use a version of 2269 * <code>setAsciiStream</code> which takes a length parameter. 2270 * 2271 * @param parameterName the name of the parameter 2272 * @param x the Java input stream that contains the ASCII parameter value 2273 * @exception SQLException if parameterName does not correspond to a named 2274 * parameter; if a database access error occurs or 2275 * this method is called on a closed <code>CallableStatement</code> 2276 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2277 * @since 1.6 2278 */ 2279 void setAsciiStream(String parameterName, java.io.InputStream x) 2280 throws SQLException; 2281 /** 2282 * Sets the designated parameter to the given input stream. 2283 * When a very large binary value is input to a <code>LONGVARBINARY</code> 2284 * parameter, it may be more practical to send it via a 2285 * <code>java.io.InputStream</code> object. The data will be read from the 2286 * stream as needed until end-of-file is reached. 2287 * 2288 * <P><B>Note:</B> This stream object can either be a standard 2289 * Java stream object or your own subclass that implements the 2290 * standard interface. 2291 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2292 * it might be more efficient to use a version of 2293 * <code>setBinaryStream</code> which takes a length parameter. 2294 * 2295 * @param parameterName the name of the parameter 2296 * @param x the java input stream which contains the binary parameter value 2297 * @exception SQLException if parameterName does not correspond to a named 2298 * parameter; if a database access error occurs or 2299 * this method is called on a closed <code>CallableStatement</code> 2300 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2301 * @since 1.6 2302 */ 2303 void setBinaryStream(String parameterName, java.io.InputStream x) 2304 throws SQLException; 2305 /** 2306 * Sets the designated parameter to the given <code>Reader</code> 2307 * object. 2308 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 2309 * parameter, it may be more practical to send it via a 2310 * <code>java.io.Reader</code> object. The data will be read from the stream 2311 * as needed until end-of-file is reached. The JDBC driver will 2312 * do any necessary conversion from UNICODE to the database char format. 2313 * 2314 * <P><B>Note:</B> This stream object can either be a standard 2315 * Java stream object or your own subclass that implements the 2316 * standard interface. 2317 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2318 * it might be more efficient to use a version of 2319 * <code>setCharacterStream</code> which takes a length parameter. 2320 * 2321 * @param parameterName the name of the parameter 2322 * @param reader the <code>java.io.Reader</code> object that contains the 2323 * Unicode data 2324 * @exception SQLException if parameterName does not correspond to a named 2325 * parameter; if a database access error occurs or 2326 * this method is called on a closed <code>CallableStatement</code> 2327 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2328 * @since 1.6 2329 */ 2330 void setCharacterStream(String parameterName, 2331 java.io.Reader reader) throws SQLException; 2332 /** 2333 * Sets the designated parameter to a <code>Reader</code> object. The 2334 * <code>Reader</code> reads the data till end-of-file is reached. The 2335 * driver does the necessary conversion from Java character format to 2336 * the national character set in the database. 2337 2338 * <P><B>Note:</B> This stream object can either be a standard 2339 * Java stream object or your own subclass that implements the 2340 * standard interface. 2341 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2342 * it might be more efficient to use a version of 2343 * <code>setNCharacterStream</code> which takes a length parameter. 2344 * 2345 * @param parameterName the name of the parameter 2346 * @param value the parameter value 2347 * @throws SQLException if parameterName does not correspond to a named 2348 * parameter; if the driver does not support national 2349 * character sets; if the driver can detect that a data conversion 2350 * error could occur; if a database access error occurs; or 2351 * this method is called on a closed <code>CallableStatement</code> 2352 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2353 * @since 1.6 2354 */ 2355 void setNCharacterStream(String parameterName, Reader value) throws SQLException; 2356 2357 /** 2358 * Sets the designated parameter to a <code>Reader</code> object. 2359 * This method differs from the <code>setCharacterStream (int, Reader)</code> method 2360 * because it informs the driver that the parameter value should be sent to 2361 * the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the 2362 * driver may have to do extra work to determine whether the parameter 2363 * data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code> 2364 * 2365 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2366 * it might be more efficient to use a version of 2367 * <code>setClob</code> which takes a length parameter. 2368 * 2369 * @param parameterName the name of the parameter 2370 * @param reader An object that contains the data to set the parameter value to. 2371 * @throws SQLException if parameterName does not correspond to a named 2372 * parameter; if a database access error occurs or this method is called on 2373 * a closed <code>CallableStatement</code> 2374 * 2375 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2376 * @since 1.6 2377 */ 2378 void setClob(String parameterName, Reader reader) 2379 throws SQLException; 2380 2381 /** 2382 * Sets the designated parameter to a {@code InputStream} object. 2383 * This method differs from the <code>setBinaryStream (int, InputStream)</code> 2384 * method because it informs the driver that the parameter value should be 2385 * sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, 2386 * the driver may have to do extra work to determine whether the parameter 2387 * data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code> 2388 * 2389 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2390 * it might be more efficient to use a version of 2391 * <code>setBlob</code> which takes a length parameter. 2392 * 2393 * @param parameterName the name of the parameter 2394 * @param inputStream An object that contains the data to set the parameter 2395 * value to. 2396 * @throws SQLException if parameterName does not correspond to a named 2397 * parameter; if a database access error occurs or 2398 * this method is called on a closed <code>CallableStatement</code> 2399 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2400 * 2401 * @since 1.6 2402 */ 2403 void setBlob(String parameterName, InputStream inputStream) 2404 throws SQLException; 2405 /** 2406 * Sets the designated parameter to a <code>Reader</code> object. 2407 * This method differs from the <code>setCharacterStream (int, Reader)</code> method 2408 * because it informs the driver that the parameter value should be sent to 2409 * the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the 2410 * driver may have to do extra work to determine whether the parameter 2411 * data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code> 2412 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 2413 * it might be more efficient to use a version of 2414 * <code>setNClob</code> which takes a length parameter. 2415 * 2416 * @param parameterName the name of the parameter 2417 * @param reader An object that contains the data to set the parameter value to. 2418 * @throws SQLException if parameterName does not correspond to a named 2419 * parameter; if the driver does not support national character sets; 2420 * if the driver can detect that a data conversion 2421 * error could occur; if a database access error occurs or 2422 * this method is called on a closed <code>CallableStatement</code> 2423 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method 2424 * 2425 * @since 1.6 2426 */ 2427 void setNClob(String parameterName, Reader reader) 2428 throws SQLException; 2429 2430 //------------------------- JDBC 4.1 ----------------------------------- 2431 2432 2433 /** 2434 * Returns an object representing the value of OUT parameter 2435 * {@code parameterIndex} and will convert from the 2436 * SQL type of the parameter to the requested Java data type, if the 2437 * conversion is supported. If the conversion is not 2438 * supported or null is specified for the type, a 2439 * <code>SQLException</code> is thrown. 2440 *<p> 2441 * At a minimum, an implementation must support the conversions defined in 2442 * Appendix B, Table B-3 and conversion of appropriate user defined SQL 2443 * types to a Java type which implements {@code SQLData}, or {@code Struct}. 2444 * Additional conversions may be supported and are vendor defined. 2445 * 2446 * @param parameterIndex the first parameter is 1, the second is 2, and so on 2447 * @param type Class representing the Java data type to convert the 2448 * designated parameter to. 2449 * @param <T> the type of the class modeled by this Class object 2450 * @return an instance of {@code type} holding the OUT parameter value 2451 * @throws SQLException if conversion is not supported, type is null or 2452 * another error occurs. The getCause() method of the 2453 * exception may provide a more detailed exception, for example, if 2454 * a conversion error occurs 2455 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support 2456 * this method 2457 * @since 1.7 2458 */ 2459 public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException; 2460 2461 2462 /** 2463 * Returns an object representing the value of OUT parameter 2464 * {@code parameterName} and will convert from the 2465 * SQL type of the parameter to the requested Java data type, if the 2466 * conversion is supported. If the conversion is not 2467 * supported or null is specified for the type, a 2468 * <code>SQLException</code> is thrown. 2469 *<p> 2470 * At a minimum, an implementation must support the conversions defined in 2471 * Appendix B, Table B-3 and conversion of appropriate user defined SQL 2472 * types to a Java type which implements {@code SQLData}, or {@code Struct}. 2473 * Additional conversions may be supported and are vendor defined. 2474 * 2475 * @param parameterName the name of the parameter 2476 * @param type Class representing the Java data type to convert 2477 * the designated parameter to. 2478 * @param <T> the type of the class modeled by this Class object 2479 * @return an instance of {@code type} holding the OUT parameter 2480 * value 2481 * @throws SQLException if conversion is not supported, type is null or 2482 * another error occurs. The getCause() method of the 2483 * exception may provide a more detailed exception, for example, if 2484 * a conversion error occurs 2485 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support 2486 * this method 2487 * @since 1.7 2488 */ 2489 public <T> T getObject(String parameterName, Class<T> type) throws SQLException; 2490 2491 //------------------------- JDBC 4.2 ----------------------------------- 2492 2493 /** 2494 * Sets the value of the designated parameter with the given object. 2495 * 2496 * If the second argument is an {@code InputStream} then the stream 2497 * must contain the number of bytes specified by scaleOrLength. 2498 * If the second argument is a {@code Reader} then the reader must 2499 * contain the number of characters specified 2500 * by scaleOrLength. If these conditions are not true the driver 2501 * will generate a 2502 * {@code SQLException} when the prepared statement is executed. 2503 * 2504 * <p>The given Java object will be converted to the given targetSqlType 2505 * before being sent to the database. 2506 * 2507 * If the object has a custom mapping (is of a class implementing the 2508 * interface {@code SQLData}), 2509 * the JDBC driver should call the method {@code SQLData.writeSQL} to 2510 * write it to the SQL data stream. 2511 * If, on the other hand, the object is of a class implementing 2512 * {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob}, 2513 * {@code Struct}, {@code java.net.URL}, 2514 * or {@code Array}, the driver should pass it to the database as a 2515 * value of the corresponding SQL type. 2516 * 2517 * <p>Note that this method may be used to pass database-specific 2518 * abstract data types. 2519 *<P> 2520 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2521 * 2522 * @param parameterName the name of the parameter 2523 * @param x the object containing the input parameter value 2524 * @param targetSqlType the SQL type to be 2525 * sent to the database. The scale argument may further qualify this type. 2526 * @param scaleOrLength for {@code java.sql.JDBCType.DECIMAL} 2527 * or {@code java.sql.JDBCType.NUMERIC types}, 2528 * this is the number of digits after the decimal point. For 2529 * Java Object types {@code InputStream} and {@code Reader}, 2530 * this is the length 2531 * of the data in the stream or reader. For all other types, 2532 * this value will be ignored. 2533 * @exception SQLException if parameterName does not correspond to a named 2534 * parameter; if a database access error occurs 2535 * or this method is called on a closed {@code CallableStatement} or 2536 * if the Java Object specified by x is an InputStream 2537 * or Reader object and the value of the scale parameter is less 2538 * than zero 2539 * @exception SQLFeatureNotSupportedException if 2540 * the JDBC driver does not support the specified targetSqlType 2541 * @see JDBCType 2542 * @see SQLType 2543 * 2544 * @since 1.8 2545 */ 2546 default void setObject(String parameterName, Object x, SQLType targetSqlType, 2547 int scaleOrLength) throws SQLException { 2548 throw new SQLFeatureNotSupportedException("setObject not implemented"); 2549 } 2550 /** 2551 * Sets the value of the designated parameter with the given object. 2552 * 2553 * This method is similar to {@link #setObject(String parameterName, 2554 * Object x, SQLType targetSqlType, int scaleOrLength)}, 2555 * except that it assumes a scale of zero. 2556 *<P> 2557 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2558 * 2559 * @param parameterName the name of the parameter 2560 * @param x the object containing the input parameter value 2561 * @param targetSqlType the SQL type to be sent to the database 2562 * @exception SQLException if parameterName does not correspond to a named 2563 * parameter; if a database access error occurs 2564 * or this method is called on a closed {@code CallableStatement} 2565 * @exception SQLFeatureNotSupportedException if 2566 * the JDBC driver does not support the specified targetSqlType 2567 * @see JDBCType 2568 * @see SQLType 2569 * @since 1.8 2570 */ 2571 default void setObject(String parameterName, Object x, SQLType targetSqlType) 2572 throws SQLException { 2573 throw new SQLFeatureNotSupportedException("setObject not implemented"); 2574 } 2575 2576 /** 2577 * Registers the OUT parameter in ordinal position 2578 * {@code parameterIndex} to the JDBC type 2579 * {@code sqlType}. All OUT parameters must be registered 2580 * before a stored procedure is executed. 2581 * <p> 2582 * The JDBC type specified by {@code sqlType} for an OUT 2583 * parameter determines the Java type that must be used 2584 * in the {@code get} method to read the value of that parameter. 2585 * <p> 2586 * If the JDBC type expected to be returned to this output parameter 2587 * is specific to this particular database, {@code sqlType} 2588 * may be {@code JDBCType.OTHER} or a {@code SQLType} that is supported by 2589 * the JDBC driver. The method 2590 * {@link #getObject} retrieves the value. 2591 *<P> 2592 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2593 * 2594 * @param parameterIndex the first parameter is 1, the second is 2, 2595 * and so on 2596 * @param sqlType the JDBC type code defined by {@code SQLType} to use to 2597 * register the OUT Parameter. 2598 * If the parameter is of JDBC type {@code JDBCType.NUMERIC} 2599 * or {@code JDBCType.DECIMAL}, the version of 2600 * {@code registerOutParameter} that accepts a scale value 2601 * should be used. 2602 * 2603 * @exception SQLException if the parameterIndex is not valid; 2604 * if a database access error occurs or 2605 * this method is called on a closed {@code CallableStatement} 2606 * @exception SQLFeatureNotSupportedException if 2607 * the JDBC driver does not support the specified sqlType 2608 * @see JDBCType 2609 * @see SQLType 2610 * @since 1.8 2611 */ 2612 default void registerOutParameter(int parameterIndex, SQLType sqlType) 2613 throws SQLException { 2614 throw new SQLFeatureNotSupportedException("registerOutParameter not implemented"); 2615 } 2616 2617 /** 2618 * Registers the parameter in ordinal position 2619 * {@code parameterIndex} to be of JDBC type 2620 * {@code sqlType}. All OUT parameters must be registered 2621 * before a stored procedure is executed. 2622 * <p> 2623 * The JDBC type specified by {@code sqlType} for an OUT 2624 * parameter determines the Java type that must be used 2625 * in the {@code get} method to read the value of that parameter. 2626 * <p> 2627 * This version of {@code registerOutParameter} should be 2628 * used when the parameter is of JDBC type {@code JDBCType.NUMERIC} 2629 * or {@code JDBCType.DECIMAL}. 2630 *<P> 2631 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2632 * 2633 * @param parameterIndex the first parameter is 1, the second is 2, 2634 * and so on 2635 * @param sqlType the JDBC type code defined by {@code SQLType} to use to 2636 * register the OUT Parameter. 2637 * @param scale the desired number of digits to the right of the 2638 * decimal point. It must be greater than or equal to zero. 2639 * @exception SQLException if the parameterIndex is not valid; 2640 * if a database access error occurs or 2641 * this method is called on a closed {@code CallableStatement} 2642 * @exception SQLFeatureNotSupportedException if 2643 * the JDBC driver does not support the specified sqlType 2644 * @see JDBCType 2645 * @see SQLType 2646 * @since 1.8 2647 */ 2648 default void registerOutParameter(int parameterIndex, SQLType sqlType, 2649 int scale) throws SQLException { 2650 throw new SQLFeatureNotSupportedException("registerOutParameter not implemented"); 2651 } 2652 /** 2653 * Registers the designated output parameter. 2654 * This version of 2655 * the method {@code registerOutParameter} 2656 * should be used for a user-defined or {@code REF} output parameter. 2657 * Examples 2658 * of user-defined types include: {@code STRUCT}, {@code DISTINCT}, 2659 * {@code JAVA_OBJECT}, and named array types. 2660 *<p> 2661 * All OUT parameters must be registered 2662 * before a stored procedure is executed. 2663 * <p> For a user-defined parameter, the fully-qualified SQL 2664 * type name of the parameter should also be given, while a {@code REF} 2665 * parameter requires that the fully-qualified type name of the 2666 * referenced type be given. A JDBC driver that does not need the 2667 * type code and type name information may ignore it. To be portable, 2668 * however, applications should always provide these values for 2669 * user-defined and {@code REF} parameters. 2670 * 2671 * Although it is intended for user-defined and {@code REF} parameters, 2672 * this method may be used to register a parameter of any JDBC type. 2673 * If the parameter does not have a user-defined or {@code REF} type, the 2674 * <i>typeName</i> parameter is ignored. 2675 * 2676 * <P><B>Note:</B> When reading the value of an out parameter, you 2677 * must use the getter method whose Java type corresponds to the 2678 * parameter's registered SQL type. 2679 *<P> 2680 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2681 * 2682 * @param parameterIndex the first parameter is 1, the second is 2,... 2683 * @param sqlType the JDBC type code defined by {@code SQLType} to use to 2684 * register the OUT Parameter. 2685 * @param typeName the fully-qualified name of an SQL structured type 2686 * @exception SQLException if the parameterIndex is not valid; 2687 * if a database access error occurs or 2688 * this method is called on a closed {@code CallableStatement} 2689 * @exception SQLFeatureNotSupportedException if 2690 * the JDBC driver does not support the specified sqlType 2691 * @see JDBCType 2692 * @see SQLType 2693 * @since 1.8 2694 */ 2695 default void registerOutParameter (int parameterIndex, SQLType sqlType, 2696 String typeName) throws SQLException { 2697 throw new SQLFeatureNotSupportedException("registerOutParameter not implemented"); 2698 } 2699 2700 /** 2701 * Registers the OUT parameter named 2702 * <code>parameterName</code> to the JDBC type 2703 * {@code sqlType}. All OUT parameters must be registered 2704 * before a stored procedure is executed. 2705 * <p> 2706 * The JDBC type specified by {@code sqlType} for an OUT 2707 * parameter determines the Java type that must be used 2708 * in the {@code get} method to read the value of that parameter. 2709 * <p> 2710 * If the JDBC type expected to be returned to this output parameter 2711 * is specific to this particular database, {@code sqlType} 2712 * should be {@code JDBCType.OTHER} or a {@code SQLType} that is supported 2713 * by the JDBC driver.. The method 2714 * {@link #getObject} retrieves the value. 2715 *<P> 2716 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2717 * 2718 * @param parameterName the name of the parameter 2719 * @param sqlType the JDBC type code defined by {@code SQLType} to use to 2720 * register the OUT Parameter. 2721 * If the parameter is of JDBC type {@code JDBCType.NUMERIC} 2722 * or {@code JDBCType.DECIMAL}, the version of 2723 * {@code registerOutParameter} that accepts a scale value 2724 * should be used. 2725 * @exception SQLException if parameterName does not correspond to a named 2726 * parameter; if a database access error occurs or 2727 * this method is called on a closed {@code CallableStatement} 2728 * @exception SQLFeatureNotSupportedException if 2729 * the JDBC driver does not support the specified sqlType 2730 * or if the JDBC driver does not support 2731 * this method 2732 * @since 1.8 2733 * @see JDBCType 2734 * @see SQLType 2735 */ 2736 default void registerOutParameter(String parameterName, SQLType sqlType) 2737 throws SQLException { 2738 throw new SQLFeatureNotSupportedException("registerOutParameter not implemented"); 2739 } 2740 2741 /** 2742 * Registers the parameter named 2743 * <code>parameterName</code> to be of JDBC type 2744 * {@code sqlType}. All OUT parameters must be registered 2745 * before a stored procedure is executed. 2746 * <p> 2747 * The JDBC type specified by {@code sqlType} for an OUT 2748 * parameter determines the Java type that must be used 2749 * in the {@code get} method to read the value of that parameter. 2750 * <p> 2751 * This version of {@code registerOutParameter} should be 2752 * used when the parameter is of JDBC type {@code JDBCType.NUMERIC} 2753 * or {@code JDBCType.DECIMAL}. 2754 *<P> 2755 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2756 * 2757 * @param parameterName the name of the parameter 2758 * @param sqlType the JDBC type code defined by {@code SQLType} to use to 2759 * register the OUT Parameter. 2760 * @param scale the desired number of digits to the right of the 2761 * decimal point. It must be greater than or equal to zero. 2762 * @exception SQLException if parameterName does not correspond to a named 2763 * parameter; if a database access error occurs or 2764 * this method is called on a closed {@code CallableStatement} 2765 * @exception SQLFeatureNotSupportedException if 2766 * the JDBC driver does not support the specified sqlType 2767 * or if the JDBC driver does not support 2768 * this method 2769 * @since 1.8 2770 * @see JDBCType 2771 * @see SQLType 2772 */ 2773 default void registerOutParameter(String parameterName, SQLType sqlType, 2774 int scale) throws SQLException { 2775 throw new SQLFeatureNotSupportedException("registerOutParameter not implemented"); 2776 } 2777 2778 /** 2779 * Registers the designated output parameter. This version of 2780 * the method {@code registerOutParameter} 2781 * should be used for a user-named or REF output parameter. Examples 2782 * of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and 2783 * named array types. 2784 *<p> 2785 * All OUT parameters must be registered 2786 * before a stored procedure is executed. 2787 * </p> 2788 * For a user-named parameter the fully-qualified SQL 2789 * type name of the parameter should also be given, while a REF 2790 * parameter requires that the fully-qualified type name of the 2791 * referenced type be given. A JDBC driver that does not need the 2792 * type code and type name information may ignore it. To be portable, 2793 * however, applications should always provide these values for 2794 * user-named and REF parameters. 2795 * 2796 * Although it is intended for user-named and REF parameters, 2797 * this method may be used to register a parameter of any JDBC type. 2798 * If the parameter does not have a user-named or REF type, the 2799 * typeName parameter is ignored. 2800 * 2801 * <P><B>Note:</B> When reading the value of an out parameter, you 2802 * must use the {@code getXXX} method whose Java type XXX corresponds to the 2803 * parameter's registered SQL type. 2804 *<P> 2805 * The default implementation will throw {@code SQLFeatureNotSupportedException} 2806 * 2807 * @param parameterName the name of the parameter 2808 * @param sqlType the JDBC type code defined by {@code SQLType} to use to 2809 * register the OUT Parameter. 2810 * @param typeName the fully-qualified name of an SQL structured type 2811 * @exception SQLException if parameterName does not correspond to a named 2812 * parameter; if a database access error occurs or 2813 * this method is called on a closed {@code CallableStatement} 2814 * @exception SQLFeatureNotSupportedException if 2815 * the JDBC driver does not support the specified sqlType 2816 * or if the JDBC driver does not support this method 2817 * @see JDBCType 2818 * @see SQLType 2819 * @since 1.8 2820 */ 2821 default void registerOutParameter (String parameterName, SQLType sqlType, 2822 String typeName) throws SQLException { 2823 throw new SQLFeatureNotSupportedException("registerOutParameter not implemented"); 2824 } 2825 }