|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| CallableStatementWrapper.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | /* | |
| 2 | * Copyright (c) 1998, 2005 Gargoyle Software Inc. All rights reserved. | |
| 3 | * | |
| 4 | * Redistribution and use in source and binary forms, with or without | |
| 5 | * modification, are permitted provided that the following conditions are met: | |
| 6 | * | |
| 7 | * 1. Redistributions of source code must retain the above copyright notice, | |
| 8 | * this list of conditions and the following disclaimer. | |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright notice, | |
| 10 | * this list of conditions and the following disclaimer in the documentation | |
| 11 | * and/or other materials provided with the distribution. | |
| 12 | * 3. The end-user documentation included with the redistribution, if any, must | |
| 13 | * include the following acknowledgment: | |
| 14 | * | |
| 15 | * "This product includes software developed by Gargoyle Software Inc. | |
| 16 | * (http://www.GargoyleSoftware.com/)." | |
| 17 | * | |
| 18 | * Alternately, this acknowledgment may appear in the software itself, if | |
| 19 | * and wherever such third-party acknowledgments normally appear. | |
| 20 | * 4. The name "Gargoyle Software" must not be used to endorse or promote | |
| 21 | * products derived from this software without prior written permission. | |
| 22 | * For written permission, please contact info@GargoyleSoftware.com. | |
| 23 | * 5. Products derived from this software may not be called "GSBase", nor may | |
| 24 | * "GSBase" appear in their name, without prior written permission of | |
| 25 | * Gargoyle Software Inc. | |
| 26 | * | |
| 27 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, | |
| 28 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 29 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARGOYLE | |
| 30 | * SOFTWARE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
| 31 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | |
| 33 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |
| 34 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | |
| 35 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | |
| 36 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 37 | */ | |
| 38 | package com.gargoylesoftware.base.resource.jdbc; | |
| 39 | ||
| 40 | import java.math.BigDecimal; | |
| 41 | import java.sql.Array; | |
| 42 | import java.sql.Blob; | |
| 43 | import java.sql.CallableStatement; | |
| 44 | import java.sql.Clob; | |
| 45 | import java.sql.Ref; | |
| 46 | import java.sql.SQLException; | |
| 47 | import java.util.Calendar; | |
| 48 | ||
| 49 | /** | |
| 50 | * The interface used to execute SQL stored procedures. JDBC provides a stored | |
| 51 | * procedure SQL escape syntax that allows stored procedures to be called in a | |
| 52 | * standard way for all RDBMSs. This escape syntax has one form that includes a | |
| 53 | * result parameter and one that does not. If used, the result parameter must | |
| 54 | * be registered as an OUT parameter. The other parameters can be used for | |
| 55 | * input, output or both. Parameters are referred to sequentially, by number, | |
| 56 | * with the first parameter being 1. <P> | |
| 57 | * | |
| 58 | * <blockquote><pre> | |
| 59 | * {?= call <procedure-name>[<arg1>,<arg2>, ...]} | |
| 60 | * {call <procedure-name>[<arg1>,<arg2>, ...]} | |
| 61 | * </pre></blockquote> <P> | |
| 62 | * | |
| 63 | * IN parameter values are set using the set methods inherited from | |
| 64 | * PreparedStatement. The type of all OUT parameters must be registered prior | |
| 65 | * to executing the stored procedure; their values are retrieved after | |
| 66 | * execution via the <code>get</code> methods provided here. <P> | |
| 67 | * | |
| 68 | * A <code>CallableStatement</code> can return one ResultSet or multiple <code>ResultSet</code> | |
| 69 | * objects. Multiple <code>ResultSet</code> objects are handled using | |
| 70 | * operations inherited from Statement. <P> | |
| 71 | * | |
| 72 | * For maximum portability, a call's <code>ResultSet</code> objects and update | |
| 73 | * counts should be processed prior to getting the values of output parameters. | |
| 74 | * <P> | |
| 75 | * | |
| 76 | * Methods that are new in the JDBC 2.0 API are marked "Since 1.2." | |
| 77 | * | |
| 78 | * @version $Revision: 1.5 $ | |
| 79 | * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a> | |
| 80 | */ | |
| 81 | public final class CallableStatementWrapper | |
| 82 | extends | |
| 83 | PreparedStatementWrapper | |
| 84 | implements | |
| 85 | CallableStatement { | |
| 86 | ||
| 87 | private CallableStatement delegate_; | |
| 88 | ||
| 89 | ||
| 90 | /** | |
| 91 | * Create a wrapper | |
| 92 | * | |
| 93 | * @param statement The statement that is being wrapped | |
| 94 | */ | |
| 95 | 156 | public CallableStatementWrapper( final CallableStatement statement ) { |
| 96 | 156 | super( statement ); |
| 97 | 156 | delegate_ = statement; |
| 98 | } | |
| 99 | ||
| 100 | ||
| 101 | /** | |
| 102 | * Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>, | |
| 103 | * or <code>LONGVARCHAR</code> parameter as a <code>String</code> in the | |
| 104 | * Java programming language. <p> | |
| 105 | * | |
| 106 | * For the fixed-length type JDBC <code>CHAR</code>, the <code>String</code> | |
| 107 | * object returned has exactly the same value the JDBC <code>CHAR</code> | |
| 108 | * value had in the database, including any padding added by the database. | |
| 109 | * | |
| 110 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 111 | * on | |
| 112 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 113 | * result is <code>null</code>. | |
| 114 | * @exception SQLException if a database access error occurs | |
| 115 | */ | |
| 116 | 2 | public final String getString( int parameterIndex ) |
| 117 | throws SQLException { | |
| 118 | 2 | checkIsOpen(); |
| 119 | 1 | return delegate_.getString( parameterIndex ); |
| 120 | } | |
| 121 | ||
| 122 | ||
| 123 | /** | |
| 124 | * Gets the value of a JDBC <code>BIT</code> parameter as a <code>boolean</code> | |
| 125 | * in the Java programming language. | |
| 126 | * | |
| 127 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 128 | * on | |
| 129 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 130 | * result is <code>false</code>. | |
| 131 | * @exception SQLException if a database access error occurs | |
| 132 | */ | |
| 133 | 2 | public final boolean getBoolean( int parameterIndex ) |
| 134 | throws SQLException { | |
| 135 | 2 | checkIsOpen(); |
| 136 | 1 | return delegate_.getBoolean( parameterIndex ); |
| 137 | } | |
| 138 | ||
| 139 | ||
| 140 | /** | |
| 141 | * Gets the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code> | |
| 142 | * in the Java programming language. | |
| 143 | * | |
| 144 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 145 | * on | |
| 146 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 147 | * result is 0. | |
| 148 | * @exception SQLException if a database access error occurs | |
| 149 | */ | |
| 150 | 2 | public final byte getByte( int parameterIndex ) |
| 151 | throws SQLException { | |
| 152 | 2 | checkIsOpen(); |
| 153 | 1 | return delegate_.getByte( parameterIndex ); |
| 154 | } | |
| 155 | ||
| 156 | ||
| 157 | /** | |
| 158 | * Gets the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code> | |
| 159 | * in the Java programming language. | |
| 160 | * | |
| 161 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 162 | * on | |
| 163 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 164 | * result is 0. | |
| 165 | * @exception SQLException if a database access error occurs | |
| 166 | */ | |
| 167 | 2 | public final short getShort( int parameterIndex ) |
| 168 | throws SQLException { | |
| 169 | 2 | checkIsOpen(); |
| 170 | 1 | return delegate_.getShort( parameterIndex ); |
| 171 | } | |
| 172 | ||
| 173 | ||
| 174 | /** | |
| 175 | * Gets the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code> | |
| 176 | * in the Java programming language. | |
| 177 | * | |
| 178 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 179 | * on | |
| 180 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 181 | * result is 0. | |
| 182 | * @exception SQLException if a database access error occurs | |
| 183 | */ | |
| 184 | 2 | public final int getInt( int parameterIndex ) |
| 185 | throws SQLException { | |
| 186 | 2 | checkIsOpen(); |
| 187 | 1 | return delegate_.getInt( parameterIndex ); |
| 188 | } | |
| 189 | ||
| 190 | ||
| 191 | /** | |
| 192 | * Gets the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code> | |
| 193 | * in the Java programming language. | |
| 194 | * | |
| 195 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 196 | * on | |
| 197 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 198 | * result is 0. | |
| 199 | * @exception SQLException if a database access error occurs | |
| 200 | */ | |
| 201 | 2 | public final long getLong( int parameterIndex ) |
| 202 | throws SQLException { | |
| 203 | 2 | checkIsOpen(); |
| 204 | 1 | return delegate_.getLong( parameterIndex ); |
| 205 | } | |
| 206 | ||
| 207 | ||
| 208 | /** | |
| 209 | * Gets the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code> | |
| 210 | * in the Java programming language. | |
| 211 | * | |
| 212 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 213 | * on | |
| 214 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 215 | * result is 0. | |
| 216 | * @exception SQLException if a database access error occurs | |
| 217 | */ | |
| 218 | 2 | public final float getFloat( int parameterIndex ) |
| 219 | throws SQLException { | |
| 220 | 2 | checkIsOpen(); |
| 221 | 1 | return delegate_.getFloat( parameterIndex ); |
| 222 | } | |
| 223 | ||
| 224 | ||
| 225 | /** | |
| 226 | * Gets the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code> | |
| 227 | * in the Java programming language. | |
| 228 | * | |
| 229 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 230 | * on | |
| 231 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 232 | * result is 0. | |
| 233 | * @exception SQLException if a database access error occurs | |
| 234 | */ | |
| 235 | 2 | public final double getDouble( int parameterIndex ) |
| 236 | throws SQLException { | |
| 237 | 2 | checkIsOpen(); |
| 238 | 1 | return delegate_.getDouble( parameterIndex ); |
| 239 | } | |
| 240 | ||
| 241 | ||
| 242 | /** | |
| 243 | * Gets the value of a JDBC <code>NUMERIC</code> parameter as a <code>java.math.BigDecimal</code> | |
| 244 | * object with scale digits to the right of the decimal point. | |
| 245 | * | |
| 246 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 247 | * on | |
| 248 | * @param scale the number of digits to the right of the decimal point | |
| 249 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 250 | * result is <code>null</code>. | |
| 251 | * @exception SQLException if a database access error occurs | |
| 252 | * @deprecated | |
| 253 | */ | |
| 254 | 2 | public final BigDecimal getBigDecimal( int parameterIndex, int scale ) |
| 255 | throws SQLException { | |
| 256 | 2 | checkIsOpen(); |
| 257 | 1 | return delegate_.getBigDecimal( parameterIndex, scale ); |
| 258 | } | |
| 259 | ||
| 260 | ||
| 261 | /** | |
| 262 | * Gets the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code> | |
| 263 | * parameter as an array of <code>byte</code> values in the Java | |
| 264 | * programming language. | |
| 265 | * | |
| 266 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 267 | * on | |
| 268 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 269 | * result is <code>null</code>. | |
| 270 | * @exception SQLException if a database access error occurs | |
| 271 | */ | |
| 272 | 2 | public final byte[] getBytes( int parameterIndex ) |
| 273 | throws SQLException { | |
| 274 | 2 | checkIsOpen(); |
| 275 | 1 | return delegate_.getBytes( parameterIndex ); |
| 276 | } | |
| 277 | ||
| 278 | ||
| 279 | /** | |
| 280 | * Gets the value of a JDBC <code>DATE</code> parameter as a <code>java.sql.Date</code> | |
| 281 | * object. | |
| 282 | * | |
| 283 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 284 | * on | |
| 285 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 286 | * result is <code>null</code>. | |
| 287 | * @exception SQLException if a database access error occurs | |
| 288 | */ | |
| 289 | 2 | public final java.sql.Date getDate( int parameterIndex ) |
| 290 | throws SQLException { | |
| 291 | 2 | checkIsOpen(); |
| 292 | 1 | return delegate_.getDate( parameterIndex ); |
| 293 | } | |
| 294 | ||
| 295 | ||
| 296 | /** | |
| 297 | * Get the value of a JDBC <code>TIME</code> parameter as a <code>java.sql.Time</code> | |
| 298 | * object. | |
| 299 | * | |
| 300 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 301 | * on | |
| 302 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 303 | * result is <code>null</code>. | |
| 304 | * @exception SQLException if a database access error occurs | |
| 305 | */ | |
| 306 | 2 | public final java.sql.Time getTime( int parameterIndex ) |
| 307 | throws SQLException { | |
| 308 | 2 | checkIsOpen(); |
| 309 | 1 | return delegate_.getTime( parameterIndex ); |
| 310 | } | |
| 311 | ||
| 312 | ||
| 313 | /** | |
| 314 | * Gets the value of a JDBC <code>TIMESTAMP</code> parameter as a <code>java.sql.Timestamp</code> | |
| 315 | * object. | |
| 316 | * | |
| 317 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 318 | * on | |
| 319 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 320 | * result is <code>null</code>. | |
| 321 | * @exception SQLException if a database access error occurs | |
| 322 | */ | |
| 323 | 2 | public final java.sql.Timestamp getTimestamp( int parameterIndex ) |
| 324 | throws SQLException { | |
| 325 | 2 | checkIsOpen(); |
| 326 | 1 | return delegate_.getTimestamp( parameterIndex ); |
| 327 | } | |
| 328 | ||
| 329 | //---------------------------------------------------------------------- | |
| 330 | // Advanced features: | |
| 331 | ||
| 332 | ||
| 333 | /** | |
| 334 | * Gets the value of a parameter as an <code>Object</code> in the Java | |
| 335 | * programming language. <p> | |
| 336 | * | |
| 337 | * This method returns a Java object whose type corresponds to the JDBC | |
| 338 | * type that was registered for this parameter using the method <code>registerOutParameter</code> | |
| 339 | * . By registering the target JDBC type as <code>java.sql.Types.OTHER</code> | |
| 340 | * , this method can be used to read database-specific abstract data types. | |
| 341 | * | |
| 342 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 343 | * on | |
| 344 | * @return A <code>java.lang.Object</code> holding the OUT parameter value. | |
| 345 | * @exception SQLException if a database access error occurs | |
| 346 | */ | |
| 347 | 2 | public final Object getObject( int parameterIndex ) |
| 348 | throws SQLException { | |
| 349 | 2 | checkIsOpen(); |
| 350 | 1 | return delegate_.getObject( parameterIndex ); |
| 351 | } | |
| 352 | ||
| 353 | ||
| 354 | //--------------------------JDBC 2.0----------------------------- | |
| 355 | ||
| 356 | /** | |
| 357 | * Gets the value of a JDBC <code>NUMERIC</code> parameter as a <code>java.math.BigDecimal</code> | |
| 358 | * object with as many digits to the right of the decimal point as the | |
| 359 | * value contains. | |
| 360 | * | |
| 361 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 362 | * on | |
| 363 | * @return the parameter value in full precision. If the value is SQL | |
| 364 | * <code>NULL</code>, the result is <code>null</code>. | |
| 365 | * @exception SQLException if a database access error occurs | |
| 366 | * @since 1.2 | |
| 367 | */ | |
| 368 | 2 | public final BigDecimal getBigDecimal( int parameterIndex ) |
| 369 | throws SQLException { | |
| 370 | 2 | checkIsOpen(); |
| 371 | 1 | return delegate_.getBigDecimal( parameterIndex ); |
| 372 | } | |
| 373 | ||
| 374 | ||
| 375 | /** | |
| 376 | * Returns an object representing the value of OUT parameter <code>i</code> | |
| 377 | * and uses <code>map</code> for the custom mapping of the parameter value. | |
| 378 | * <p> | |
| 379 | * | |
| 380 | * This method returns a Java object whose type corresponds to the JDBC | |
| 381 | * type that was registered for this parameter using the method <code>registerOutParameter</code> | |
| 382 | * . By registering the target JDBC type as <code>java.sql.Types.OTHER</code> | |
| 383 | * , this method can be used to read database-specific abstract data types. | |
| 384 | * | |
| 385 | * @param i the first parameter is 1, the second is 2, and so on | |
| 386 | * @param map the mapping from SQL type names to Java classes | |
| 387 | * @return a <code>java.lang.Object</code> holding the OUT parameter value | |
| 388 | * @exception SQLException if a database access error occurs | |
| 389 | * @since 1.2 | |
| 390 | */ | |
| 391 | 2 | public final Object getObject( int i, java.util.Map map ) |
| 392 | throws SQLException { | |
| 393 | 2 | checkIsOpen(); |
| 394 | 1 | return delegate_.getObject( i, map ); |
| 395 | } | |
| 396 | ||
| 397 | ||
| 398 | /** | |
| 399 | * Gets the value of a JDBC <code>REF(<structured-type>)</code> | |
| 400 | * parameter as a Ref object in the Java programming language. | |
| 401 | * | |
| 402 | * @param i the first parameter is 1, the second is 2, and so on | |
| 403 | * @return the parameter value as a <code>Ref</code> object in the Java | |
| 404 | * programming language. If the value was SQL <code>NULL</code>, the | |
| 405 | * value <code>null</code> is returned. | |
| 406 | * @exception SQLException if a database access error occurs | |
| 407 | * @since 1.2 | |
| 408 | */ | |
| 409 | 2 | public final Ref getRef( int i ) |
| 410 | throws SQLException { | |
| 411 | 2 | checkIsOpen(); |
| 412 | 1 | return delegate_.getRef( i ); |
| 413 | } | |
| 414 | ||
| 415 | ||
| 416 | /** | |
| 417 | * Gets the value of a JDBC <code>BLOB</code> parameter as a Blob\ object | |
| 418 | * in the Java programming language. | |
| 419 | * | |
| 420 | * @param i the first parameter is 1, the second is 2, and so on | |
| 421 | * @return the parameter value as a <code>Blob</code> object in the Java | |
| 422 | * programming language. If the value was SQL <code>NULL</code>, the | |
| 423 | * value <code>null</code> is returned. | |
| 424 | * @exception SQLException if a database access error occurs | |
| 425 | * @since 1.2 | |
| 426 | */ | |
| 427 | 2 | public final Blob getBlob( int i ) |
| 428 | throws SQLException { | |
| 429 | 2 | checkIsOpen(); |
| 430 | 1 | return delegate_.getBlob( i ); |
| 431 | } | |
| 432 | ||
| 433 | ||
| 434 | /** | |
| 435 | * Gets the value of a JDBC <code>CLOB</code> parameter as a <code>Clob</code> | |
| 436 | * object in the Java programming language. | |
| 437 | * | |
| 438 | * @param i the first parameter is 1, the second is 2, and so on | |
| 439 | * @return the parameter value as a <code>Clob</code> object in the Java | |
| 440 | * programming language. If the value was SQL <code>NULL</code>, the | |
| 441 | * value <code>null</code> is returned. | |
| 442 | * @exception SQLException if a database access error occurs | |
| 443 | * @since 1.2 | |
| 444 | */ | |
| 445 | 2 | public final Clob getClob( int i ) |
| 446 | throws SQLException { | |
| 447 | 2 | checkIsOpen(); |
| 448 | 1 | return delegate_.getClob( i ); |
| 449 | } | |
| 450 | ||
| 451 | ||
| 452 | /** | |
| 453 | * Gets the value of a JDBC <code>ARRAY</code> parameter as an Array object | |
| 454 | * in the Java programming language. | |
| 455 | * | |
| 456 | * @param i the first parameter is 1, the second is 2, and so on | |
| 457 | * @return the parameter value as an <code>Array</code> object in the Java | |
| 458 | * programming language. If the value was SQL <code>NULL</code>, the | |
| 459 | * value <code>null</code> is returned. | |
| 460 | * @exception SQLException if a database access error occurs | |
| 461 | * @since 1.2 | |
| 462 | */ | |
| 463 | 2 | public final Array getArray( int i ) |
| 464 | throws SQLException { | |
| 465 | 2 | checkIsOpen(); |
| 466 | 1 | return delegate_.getArray( i ); |
| 467 | } | |
| 468 | ||
| 469 | ||
| 470 | /** | |
| 471 | * Gets the value of a JDBC <code>DATE</code> parameter as a <code>java.sql.Date</code> | |
| 472 | * object, using the given <code>Calendar</code> object to construct the | |
| 473 | * date. With a <code>Calendar</code> object, the driver can calculate the | |
| 474 | * date taking into account a custom timezone and locale. If no <code>Calendar</code> | |
| 475 | * object is specified, the driver uses the default timezone and locale. | |
| 476 | * | |
| 477 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 478 | * on | |
| 479 | * @param cal the <code>Calendar</code> object the driver will use to | |
| 480 | * construct the date | |
| 481 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 482 | * result is <code>null</code>. | |
| 483 | * @exception SQLException if a database access error occurs | |
| 484 | */ | |
| 485 | 2 | public final java.sql.Date getDate( int parameterIndex, Calendar cal ) |
| 486 | throws SQLException { | |
| 487 | 2 | checkIsOpen(); |
| 488 | 1 | return delegate_.getDate( parameterIndex, cal ); |
| 489 | } | |
| 490 | ||
| 491 | ||
| 492 | /** | |
| 493 | * Gets the value of a JDBC <code>TIME</code> parameter as a <code>java.sql.Time</code> | |
| 494 | * object, using the given <code>Calendar</code> object to construct the | |
| 495 | * time. With a <code>Calendar</code> object, the driver can calculate the | |
| 496 | * time taking into account a custom timezone and locale. If no <code>Calendar</code> | |
| 497 | * object is specified, the driver uses the default timezone and locale. | |
| 498 | * | |
| 499 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 500 | * on | |
| 501 | * @param cal the <code>Calendar</code> object the driver will use to | |
| 502 | * construct the time | |
| 503 | * @return the parameter value; if the value is SQL <code>NULL</code>, the | |
| 504 | * result is <code>null</code>. | |
| 505 | * @exception SQLException if a database access error occurs | |
| 506 | */ | |
| 507 | 2 | public final java.sql.Time getTime( int parameterIndex, Calendar cal ) |
| 508 | throws SQLException { | |
| 509 | 2 | checkIsOpen(); |
| 510 | 1 | return delegate_.getTime( parameterIndex, cal ); |
| 511 | } | |
| 512 | ||
| 513 | ||
| 514 | /** | |
| 515 | * Gets the value of a JDBC <code>TIMESTAMP</code> parameter as a <code>java.sql.Timestamp</code> | |
| 516 | * object, using the given <code>Calendar</code> object to construct the | |
| 517 | * <code>Timestamp</code> object. With a <code>Calendar</code> object, the | |
| 518 | * driver can calculate the timestamp taking into account a custom timezone | |
| 519 | * and locale. If no <code>Calendar</code> object is specified, the driver | |
| 520 | * uses the default timezone and locale. | |
| 521 | * | |
| 522 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 523 | * on | |
| 524 | * @param cal the <code>Calendar</code> object the driver will use to | |
| 525 | * construct the timestamp | |
| 526 | * @return the parameter value. If the value is SQL <code>NULL</code>, the | |
| 527 | * result is <code>null</code>. | |
| 528 | * @exception SQLException if a database access error occurs | |
| 529 | */ | |
| 530 | 2 | public final java.sql.Timestamp getTimestamp( int parameterIndex, Calendar cal ) |
| 531 | throws SQLException { | |
| 532 | 2 | checkIsOpen(); |
| 533 | 1 | return delegate_.getTimestamp( parameterIndex, cal ); |
| 534 | } | |
| 535 | ||
| 536 | ||
| 537 | /** | |
| 538 | * Registers the OUT parameter in ordinal position <code>parameterIndex</code> | |
| 539 | * to the JDBC type <code>sqlType</code>. All OUT parameters must be | |
| 540 | * registered before a stored procedure is executed. <p> | |
| 541 | * | |
| 542 | * The JDBC type specified by <code>sqlType</code> for an OUT parameter | |
| 543 | * determines the Java type that must be used in the <code>get</code> | |
| 544 | * method to read the value of that parameter. <p> | |
| 545 | * | |
| 546 | * If the JDBC type expected to be returned to this output parameter is | |
| 547 | * specific to this particular database, <code>sqlType</code> should be | |
| 548 | * <code>java.sql.Types.OTHER</code>. The method getObject retrieves the | |
| 549 | * value. | |
| 550 | * | |
| 551 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 552 | * on | |
| 553 | * @param sqlType the JDBC type code defined by <code>java.sql.Types</code> | |
| 554 | * . If the parameter is of JDBC type <code>NUMERIC</code> or <code>DECIMAL</code> | |
| 555 | * , the version of <code>registerOutParameter</code> that accepts a | |
| 556 | * scale value should be used. | |
| 557 | * @exception SQLException if a database access error occurs | |
| 558 | */ | |
| 559 | 2 | public final void registerOutParameter( int parameterIndex, int sqlType ) |
| 560 | throws SQLException { | |
| 561 | 2 | checkIsOpen(); |
| 562 | 1 | delegate_.registerOutParameter( parameterIndex, sqlType ); |
| 563 | } | |
| 564 | ||
| 565 | ||
| 566 | /** | |
| 567 | * Registers the parameter in ordinal position <code>parameterIndex</code> | |
| 568 | * to be of JDBC type <code>sqlType</code>. This method must be called | |
| 569 | * before a stored procedure is executed. <p> | |
| 570 | * | |
| 571 | * The JDBC type specified by <code>sqlType</code> for an OUT parameter | |
| 572 | * determines the Java type that must be used in the <code>get</code> | |
| 573 | * method to read the value of that parameter. <p> | |
| 574 | * | |
| 575 | * This version of <code>registerOutParameter</code> should be used when | |
| 576 | * the parameter is of JDBC type <code>NUMERIC</code> or <code>DECIMAL</code> | |
| 577 | * . | |
| 578 | * | |
| 579 | * @param parameterIndex the first parameter is 1, the second is 2, and so | |
| 580 | * on | |
| 581 | * @param sqlType SQL type code defined by <code>java.sql.Types</code>. | |
| 582 | * @param scale the desired number of digits to the right of the decimal | |
| 583 | * point. It must be greater than or equal to zero. | |
| 584 | * @exception SQLException if a database access error occurs | |
| 585 | */ | |
| 586 | 2 | public final void registerOutParameter( int parameterIndex, int sqlType, int scale ) |
| 587 | throws SQLException { | |
| 588 | 2 | checkIsOpen(); |
| 589 | 1 | delegate_.registerOutParameter( parameterIndex, sqlType, scale ); |
| 590 | } | |
| 591 | ||
| 592 | ||
| 593 | /** | |
| 594 | * Indicates whether or not the last OUT parameter read had the value of | |
| 595 | * SQL <code>NULL</code>. Note that this method should be called only after | |
| 596 | * calling a <code>getXXX</code> method; otherwise, there is no value to | |
| 597 | * use in determining whether it is <code>null</code> or not. | |
| 598 | * | |
| 599 | * @return <code>true</code> if the last parameter read was SQL <code>NULL</code> | |
| 600 | * ; <code>false</code> otherwise | |
| 601 | * @exception SQLException if a database access error occurs | |
| 602 | */ | |
| 603 | 2 | public final boolean wasNull() |
| 604 | throws SQLException { | |
| 605 | 2 | checkIsOpen(); |
| 606 | 1 | return delegate_.wasNull(); |
| 607 | } | |
| 608 | ||
| 609 | ||
| 610 | /** | |
| 611 | * Registers the designated output parameter. This version of the method | |
| 612 | * <code>registerOutParameter</code> should be used for a user-named or REF | |
| 613 | * output parameter. Examples of user-named types include: STRUCT, | |
| 614 | * DISTINCT, JAVA_OBJECT, and named array types. Before executing a stored | |
| 615 | * procedure call, you must explicitly call <code>registerOutParameter</code> | |
| 616 | * to register the type from <code>java.sql.Types</code> for each OUT | |
| 617 | * parameter. For a user-named parameter the fully-qualified SQL type name | |
| 618 | * of the parameter should also be given, while a REF parameter requires | |
| 619 | * that the fully-qualified type name of the referenced type be given. A | |
| 620 | * JDBC driver that does not need the type code and type name information | |
| 621 | * may ignore it. To be portable, however, applications should always | |
| 622 | * provide these values for user-named and REF parameters. Although it is | |
| 623 | * intended for user-named and REF parameters, this method may be used to | |
| 624 | * register a parameter of any JDBC type. If the parameter does not have a | |
| 625 | * user-named or REF type, the typeName parameter is ignored. <P> | |
| 626 | * | |
| 627 | * <B>Note:</B> When reading the value of an out parameter, you must use | |
| 628 | * the <code>getXXX</code> method whose Java type XXX corresponds to the | |
| 629 | * parameter's registered SQL type. | |
| 630 | * | |
| 631 | * @param paramIndex the first parameter is 1, the second is 2,... | |
| 632 | * @param sqlType a value from java.sql.Types | |
| 633 | * @param typeName the fully-qualified name of an SQL structured type | |
| 634 | * @exception SQLException if a database access error occurs | |
| 635 | * @since 1.2 | |
| 636 | */ | |
| 637 | 2 | public final void registerOutParameter( int paramIndex, int sqlType, String typeName ) |
| 638 | throws SQLException { | |
| 639 | 2 | checkIsOpen(); |
| 640 | 1 | delegate_.registerOutParameter( paramIndex, sqlType, typeName ); |
| 641 | } | |
| 642 | ||
| 643 | ||
| 644 | /** | |
| 645 | * Retrieves the value of the designated JDBC <code>DATALINK</code> parameter as a | |
| 646 | * <code>java.net.URL</code> object. | |
| 647 | * | |
| 648 | * @param parameterIndex the first parameter is 1, the second is 2,... | |
| 649 | * @return a <code>java.net.URL</code> object that represents the | |
| 650 | * JDBC <code>DATALINK</code> value used as the designated | |
| 651 | * parameter | |
| 652 | * @exception SQLException if a database access error occurs, | |
| 653 | * or if the URL being returned is | |
| 654 | * not a valid URL on the Java platform | |
| 655 | * @see #setURL | |
| 656 | * @since 1.4 | |
| 657 | */ | |
| 658 | 2 | public java.net.URL getURL(int parameterIndex) throws SQLException { |
| 659 | 2 | checkIsOpen(); |
| 660 | 1 | return delegate_.getURL(parameterIndex); |
| 661 | } | |
| 662 | ||
| 663 | ||
| 664 | /** | |
| 665 | * Sets the designated parameter to the given <code>java.net.URL</code> object. | |
| 666 | * The driver converts this to an SQL <code>DATALINK</code> value when | |
| 667 | * it sends it to the database. | |
| 668 | * | |
| 669 | * @param parameterName the name of the parameter | |
| 670 | * @param val the parameter value | |
| 671 | * @exception SQLException if a database access error occurs, | |
| 672 | * or if a URL is malformed | |
| 673 | * @since 1.4 | |
| 674 | */ | |
| 675 | 2 | public void setURL(String parameterName, java.net.URL val) throws SQLException { |
| 676 | 2 | checkIsOpen(); |
| 677 | 1 | delegate_.setURL(parameterName, val); |
| 678 | } | |
| 679 | ||
| 680 | ||
| 681 | /** | |
| 682 | * Sets the designated parameter to SQL <code>NULL</code>. | |
| 683 | * | |
| 684 | * <P><B>Note:</B> You must specify the parameter's SQL type. | |
| 685 | * | |
| 686 | * @param parameterName the name of the parameter | |
| 687 | * @param sqlType the SQL type code defined in <code>java.sql.Types</code> | |
| 688 | * @exception SQLException if a database access error occurs | |
| 689 | * @since 1.4 | |
| 690 | */ | |
| 691 | 2 | public void setNull(String parameterName, int sqlType) throws SQLException { |
| 692 | 2 | checkIsOpen(); |
| 693 | 1 | delegate_.setNull(parameterName, sqlType); |
| 694 | } | |
| 695 | ||
| 696 | ||
| 697 | /** | |
| 698 | * Sets the designated parameter to the given Java <code>boolean</code> value. | |
| 699 | * The driver converts this | |
| 700 | * to an SQL <code>BIT</code> value when it sends it to the database. | |
| 701 | * | |
| 702 | * @param parameterName the name of the parameter | |
| 703 | * @param x the parameter value | |
| 704 | * @exception SQLException if a database access error occurs | |
| 705 | * @since 1.4 | |
| 706 | */ | |
| 707 | 2 | public void setBoolean(String parameterName, boolean x) throws SQLException { |
| 708 | 2 | checkIsOpen(); |
| 709 | 1 | delegate_.setBoolean(parameterName, x); |
| 710 | } | |
| 711 | ||
| 712 | ||
| 713 | /** | |
| 714 | * Sets the designated parameter to the given Java <code>byte</code> value. | |
| 715 | * The driver converts this | |
| 716 | * to an SQL <code>TINYINT</code> value when it sends it to the database. | |
| 717 | * | |
| 718 | * @param parameterName the name of the parameter | |
| 719 | * @param x the parameter value | |
| 720 | * @exception SQLException if a database access error occurs | |
| 721 | * @since 1.4 | |
| 722 | */ | |
| 723 | 2 | public void setByte(String parameterName, byte x) throws SQLException { |
| 724 | 2 | checkIsOpen(); |
| 725 | 1 | delegate_.setByte(parameterName, x); |
| 726 | } | |
| 727 | ||
| 728 | ||
| 729 | /** | |
| 730 | * Sets the designated parameter to the given Java <code>short</code> value. | |
| 731 | * The driver converts this | |
| 732 | * to an SQL <code>SMALLINT</code> value when it sends it to the database. | |
| 733 | * | |
| 734 | * @param parameterName the name of the parameter | |
| 735 | * @param x the parameter value | |
| 736 | * @exception SQLException if a database access error occurs | |
| 737 | * @since 1.4 | |
| 738 | */ | |
| 739 | 2 | public void setShort(String parameterName, short x) throws SQLException { |
| 740 | 2 | checkIsOpen(); |
| 741 | 1 | delegate_.setShort( parameterName, x ); |
| 742 | } | |
| 743 | ||
| 744 | ||
| 745 | /** | |
| 746 | * Sets the designated parameter to the given Java <code>int</code> value. | |
| 747 | * The driver converts this | |
| 748 | * to an SQL <code>INTEGER</code> value when it sends it to the database. | |
| 749 | * | |
| 750 | * @param parameterName the name of the parameter | |
| 751 | * @param x the parameter value | |
| 752 | * @exception SQLException if a database access error occurs | |
| 753 | * @since 1.4 | |
| 754 | */ | |
| 755 | 2 | public void setInt(String parameterName, int x) throws SQLException { |
| 756 | 2 | checkIsOpen(); |
| 757 | 1 | delegate_.setInt(parameterName, x); |
| 758 | } | |
| 759 | ||
| 760 | ||
| 761 | /** | |
| 762 | * Sets the designated parameter to the given Java <code>long</code> value. | |
| 763 | * The driver converts this | |
| 764 | * to an SQL <code>BIGINT</code> value when it sends it to the database. | |
| 765 | * | |
| 766 | * @param parameterName the name of the parameter | |
| 767 | * @param x the parameter value | |
| 768 | * @exception SQLException if a database access error occurs | |
| 769 | * @since 1.4 | |
| 770 | */ | |
| 771 | 2 | public void setLong(String parameterName, long x) throws SQLException { |
| 772 | 2 | checkIsOpen(); |
| 773 | 1 | delegate_.setLong(parameterName, x); |
| 774 | } | |
| 775 | ||
| 776 | ||
| 777 | /** | |
| 778 | * Sets the designated parameter to the given Java <code>float</code> value. | |
| 779 | * The driver converts this | |
| 780 | * to an SQL <code>FLOAT</code> value when it sends it to the database. | |
| 781 | * | |
| 782 | * @param parameterName the name of the parameter | |
| 783 | * @param x the parameter value | |
| 784 | * @exception SQLException if a database access error occurs | |
| 785 | * @since 1.4 | |
| 786 | */ | |
| 787 | 2 | public void setFloat(String parameterName, float x) throws SQLException { |
| 788 | 2 | checkIsOpen(); |
| 789 | 1 | delegate_.setFloat(parameterName, x); |
| 790 | } | |
| 791 | ||
| 792 | ||
| 793 | /** | |
| 794 | * Sets the designated parameter to the given Java <code>double</code> value. | |
| 795 | * The driver converts this | |
| 796 | * to an SQL <code>DOUBLE</code> value when it sends it to the database. | |
| 797 | * | |
| 798 | * @param parameterName the name of the parameter | |
| 799 | * @param x the parameter value | |
| 800 | * @exception SQLException if a database access error occurs | |
| 801 | * @since 1.4 | |
| 802 | */ | |
| 803 | 2 | public void setDouble(String parameterName, double x) throws SQLException { |
| 804 | 2 | checkIsOpen(); |
| 805 | 1 | delegate_.setDouble(parameterName, x); |
| 806 | } | |
| 807 | ||
| 808 | ||
| 809 | /** | |
| 810 | * Sets the designated parameter to the given | |
| 811 | * <code>java.math.BigDecimal</code> value. | |
| 812 | * The driver converts this to an SQL <code>NUMERIC</code> value when | |
| 813 | * it sends it to the database. | |
| 814 | * | |
| 815 | * @param parameterName the name of the parameter | |
| 816 | * @param x the parameter value | |
| 817 | * @exception SQLException if a database access error occurs | |
| 818 | * @since 1.4 | |
| 819 | */ | |
| 820 | 2 | public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { |
| 821 | 2 | checkIsOpen(); |
| 822 | 1 | delegate_.setBigDecimal(parameterName, x); |
| 823 | } | |
| 824 | ||
| 825 | ||
| 826 | /** | |
| 827 | * Sets the designated parameter to the given Java <code>String</code> value. | |
| 828 | * The driver converts this | |
| 829 | * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value | |
| 830 | * (depending on the argument's | |
| 831 | * size relative to the driver's limits on <code>VARCHAR</code> values) | |
| 832 | * when it sends it to the database. | |
| 833 | * | |
| 834 | * @param parameterName the name of the parameter | |
| 835 | * @param x the parameter value | |
| 836 | * @exception SQLException if a database access error occurs | |
| 837 | * @since 1.4 | |
| 838 | */ | |
| 839 | 2 | public void setString(String parameterName, String x) throws SQLException { |
| 840 | 2 | checkIsOpen(); |
| 841 | 1 | delegate_.setString(parameterName, x); |
| 842 | } | |
| 843 | ||
| 844 | ||
| 845 | /** | |
| 846 | * Sets the designated parameter to the given Java array of bytes. | |
| 847 | * The driver converts this to an SQL <code>VARBINARY</code> or | |
| 848 | * <code>LONGVARBINARY</code> (depending on the argument's size relative | |
| 849 | * to the driver's limits on <code>VARBINARY</code> values) when it sends | |
| 850 | * it to the database. | |
| 851 | * | |
| 852 | * @param parameterName the name of the parameter | |
| 853 | * @param x the parameter value | |
| 854 | * @exception SQLException if a database access error occurs | |
| 855 | * @since 1.4 | |
| 856 | */ | |
| 857 | 2 | public void setBytes(String parameterName, byte x[]) throws SQLException { |
| 858 | 2 | checkIsOpen(); |
| 859 | 1 | delegate_.setBytes(parameterName, x); |
| 860 | } | |
| 861 | ||
| 862 | ||
| 863 | /** | |
| 864 | * Sets the designated parameter to the given <code>java.sql.Date</code> value. | |
| 865 | * The driver converts this | |
| 866 | * to an SQL <code>DATE</code> value when it sends it to the database. | |
| 867 | * | |
| 868 | * @param parameterName the name of the parameter | |
| 869 | * @param x the parameter value | |
| 870 | * @exception SQLException if a database access error occurs | |
| 871 | * @since 1.4 | |
| 872 | */ | |
| 873 | 2 | public void setDate(String parameterName, java.sql.Date x) throws SQLException { |
| 874 | 2 | checkIsOpen(); |
| 875 | 1 | delegate_.setDate(parameterName, x); |
| 876 | } | |
| 877 | ||
| 878 | ||
| 879 | /** | |
| 880 | * Sets the designated parameter to the given <code>java.sql.Time</code> value. | |
| 881 | * The driver converts this | |
| 882 | * to an SQL <code>TIME</code> value when it sends it to the database. | |
| 883 | * | |
| 884 | * @param parameterName the name of the parameter | |
| 885 | * @param x the parameter value | |
| 886 | * @exception SQLException if a database access error occurs | |
| 887 | * @since 1.4 | |
| 888 | */ | |
| 889 | 2 | public void setTime(String parameterName, java.sql.Time x) throws SQLException { |
| 890 | 2 | checkIsOpen(); |
| 891 | 1 | delegate_.setTime(parameterName, x); |
| 892 | } | |
| 893 | ||
| 894 | ||
| 895 | /** | |
| 896 | * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. | |
| 897 | * The driver | |
| 898 | * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the | |
| 899 | * database. | |
| 900 | * | |
| 901 | * @param parameterName the name of the parameter | |
| 902 | * @param x the parameter value | |
| 903 | * @exception SQLException if a database access error occurs | |
| 904 | * @since 1.4 | |
| 905 | */ | |
| 906 | 2 | public void setTimestamp(String parameterName, java.sql.Timestamp x) throws SQLException { |
| 907 | 2 | checkIsOpen(); |
| 908 | 1 | delegate_.setTimestamp(parameterName, x); |
| 909 | } | |
| 910 | ||
| 911 | ||
| 912 | /** | |
| 913 | * Sets the designated parameter to the given input stream, which will have | |
| 914 | * the specified number of bytes. | |
| 915 | * When a very large ASCII value is input to a <code>LONGVARCHAR</code> | |
| 916 | * parameter, it may be more practical to send it via a | |
| 917 | * <code>java.io.InputStream</code>. Data will be read from the stream | |
| 918 | * as needed until end-of-file is reached. The JDBC driver will | |
| 919 | * do any necessary conversion from ASCII to the database char format. | |
| 920 | * | |
| 921 | * <P><B>Note:</B> This stream object can either be a standard | |
| 922 | * Java stream object or your own subclass that implements the | |
| 923 | * standard interface. | |
| 924 | * | |
| 925 | * @param parameterName the name of the parameter | |
| 926 | * @param x the Java input stream that contains the ASCII parameter value | |
| 927 | * @param length the number of bytes in the stream | |
| 928 | * @exception SQLException if a database access error occurs | |
| 929 | * @since 1.4 | |
| 930 | */ | |
| 931 | 2 | public void setAsciiStream(String parameterName, java.io.InputStream x, int length) throws SQLException { |
| 932 | 2 | checkIsOpen(); |
| 933 | 1 | delegate_.setAsciiStream(parameterName, x, length); |
| 934 | } | |
| 935 | ||
| 936 | ||
| 937 | /** | |
| 938 | * Sets the designated parameter to the given input stream, which will have | |
| 939 | * the specified number of bytes. | |
| 940 | * When a very large binary value is input to a <code>LONGVARBINARY</code> | |
| 941 | * parameter, it may be more practical to send it via a | |
| 942 | * <code>java.io.InputStream</code> object. The data will be read from the stream | |
| 943 | * as needed until end-of-file is reached. | |
| 944 | * | |
| 945 | * <P><B>Note:</B> This stream object can either be a standard | |
| 946 | * Java stream object or your own subclass that implements the | |
| 947 | * standard interface. | |
| 948 | * | |
| 949 | * @param parameterName the name of the parameter | |
| 950 | * @param x the java input stream which contains the binary parameter value | |
| 951 | * @param length the number of bytes in the stream | |
| 952 | * @exception SQLException if a database access error occurs | |
| 953 | * @since 1.4 | |
| 954 | */ | |
| 955 | 2 | public void setBinaryStream(String parameterName, java.io.InputStream x, int length) throws SQLException { |
| 956 | 2 | checkIsOpen(); |
| 957 | 1 | delegate_.setBinaryStream(parameterName, x, length); |
| 958 | } | |
| 959 | ||
| 960 | ||
| 961 | /** | |
| 962 | * Sets the value of the designated parameter with the given object. The second | |
| 963 | * argument must be an object type; for integral values, the | |
| 964 | * <code>java.lang</code> equivalent objects should be used. | |
| 965 | * | |
| 966 | * <p>The given Java object will be converted to the given targetSqlType | |
| 967 | * before being sent to the database. | |
| 968 | * | |
| 969 | * If the object has a custom mapping (is of a class implementing the | |
| 970 | * interface <code>SQLData</code>), | |
| 971 | * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it | |
| 972 | * to the SQL data stream. | |
| 973 | * If, on the other hand, the object is of a class implementing | |
| 974 | * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>Struct</code>, | |
| 975 | * or <code>Array</code>, the driver should pass it to the database as a | |
| 976 | * value of the corresponding SQL type. | |
| 977 | * <P> | |
| 978 | * Note that this method may be used to pass datatabase- | |
| 979 | * specific abstract data types. | |
| 980 | * | |
| 981 | * @param parameterName the name of the parameter | |
| 982 | * @param x the object containing the input parameter value | |
| 983 | * @param targetSqlType the SQL type (as defined in java.sql.Types) to be | |
| 984 | * sent to the database. The scale argument may further qualify this type. | |
| 985 | * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, | |
| 986 | * this is the number of digits after the decimal point. For all other | |
| 987 | * types, this value will be ignored. | |
| 988 | * @exception SQLException if a database access error occurs | |
| 989 | * @see java.sql.Types | |
| 990 | * @since 1.4 | |
| 991 | */ | |
| 992 | 2 | public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { |
| 993 | 2 | checkIsOpen(); |
| 994 | 1 | delegate_.setObject(parameterName, x, targetSqlType, scale); |
| 995 | } | |
| 996 | ||
| 997 | ||
| 998 | /** | |
| 999 | * Sets the value of the designated parameter with the given object. | |
| 1000 | * This method is like the method <code>setObject</code> | |
| 1001 | * above, except that it assumes a scale of zero. | |
| 1002 | * | |
| 1003 | * @param parameterName the name of the parameter | |
| 1004 | * @param x the object containing the input parameter value | |
| 1005 | * @param targetSqlType the SQL type (as defined in java.sql.Types) to be | |
| 1006 | * sent to the database | |
| 1007 | * @exception SQLException if a database access error occurs | |
| 1008 | * @since 1.4 | |
| 1009 | */ | |
| 1010 | 2 | public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { |
| 1011 | 2 | checkIsOpen(); |
| 1012 | 1 | delegate_.setObject(parameterName, x, targetSqlType); |
| 1013 | } | |
| 1014 | ||
| 1015 | ||
| 1016 | /** | |
| 1017 | * Sets the value of the designated parameter with the given object. | |
| 1018 | * The second parameter must be of type <code>Object</code>; therefore, the | |
| 1019 | * <code>java.lang</code> equivalent objects should be used for built-in types. | |
| 1020 | * | |
| 1021 | * <p>The JDBC specification specifies a standard mapping from | |
| 1022 | * Java <code>Object</code> types to SQL types. The given argument | |
| 1023 | * will be converted to the corresponding SQL type before being | |
| 1024 | * sent to the database. | |
| 1025 | * | |
| 1026 | * <p>Note that this method may be used to pass datatabase- | |
| 1027 | * specific abstract data types, by using a driver-specific Java | |
| 1028 | * type. | |
| 1029 | * | |
| 1030 | * If the object is of a class implementing the interface <code>SQLData</code>, | |
| 1031 | * the JDBC driver should call the method <code>SQLData.writeSQL</code> | |
| 1032 | * to write it to the SQL data stream. | |
| 1033 | * If, on the other hand, the object is of a class implementing | |
| 1034 | * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>Struct</code>, | |
| 1035 | * or <code>Array</code>, the driver should pass it to the database as a | |
| 1036 | * value of the corresponding SQL type. | |
| 1037 | * <P> | |
| 1038 | * This method throws an exception if there is an ambiguity, for example, if the | |
| 1039 | * object is of a class implementing more than one of the interfaces named above. | |
| 1040 | * | |
| 1041 | * @param parameterName the name of the parameter | |
| 1042 | * @param x the object containing the input parameter value | |
| 1043 | * @exception SQLException if a database access error occurs or if the given | |
| 1044 | * <code>Object</code> parameter is ambiguous | |
| 1045 | * @since 1.4 | |
| 1046 | */ | |
| 1047 | 2 | public void setObject(String parameterName, Object x) throws SQLException { |
| 1048 | 2 | checkIsOpen(); |
| 1049 | 1 | delegate_.setObject(parameterName, x); |
| 1050 | } | |
| 1051 | ||
| 1052 | ||
| 1053 | /** | |
| 1054 | * Sets the designated parameter to the given <code>Reader</code> | |
| 1055 | * object, which is the given number of characters long. | |
| 1056 | * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> | |
| 1057 | * parameter, it may be more practical to send it via a | |
| 1058 | * <code>java.io.Reader</code> object. The data will be read from the stream | |
| 1059 | * as needed until end-of-file is reached. The JDBC driver will | |
| 1060 | * do any necessary conversion from UNICODE to the database char format. | |
| 1061 | * | |
| 1062 | * <P><B>Note:</B> This stream object can either be a standard | |
| 1063 | * Java stream object or your own subclass that implements the | |
| 1064 | * standard interface. | |
| 1065 | * | |
| 1066 | * @param parameterName the name of the parameter | |
| 1067 | * @param reader the <code>java.io.Reader</code> object that | |
| 1068 | * contains the UNICODE data used as the designated parameter | |
| 1069 | * @param length the number of characters in the stream | |
| 1070 | * @exception SQLException if a database access error occurs | |
| 1071 | * @since 1.4 | |
| 1072 | */ | |
| 1073 | 2 | public void setCharacterStream(String parameterName, java.io.Reader reader, int length) throws SQLException { |
| 1074 | 2 | checkIsOpen(); |
| 1075 | 1 | delegate_.setCharacterStream(parameterName, reader, length); |
| 1076 | } | |
| 1077 | ||
| 1078 | ||
| 1079 | /** | |
| 1080 | * Sets the designated parameter to the given <code>java.sql.Date</code> value, | |
| 1081 | * using the given <code>Calendar</code> object. The driver uses | |
| 1082 | * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value, | |
| 1083 | * which the driver then sends to the database. With a | |
| 1084 | * a <code>Calendar</code> object, the driver can calculate the date | |
| 1085 | * taking into account a custom timezone. If no | |
| 1086 | * <code>Calendar</code> object is specified, the driver uses the default | |
| 1087 | * timezone, which is that of the virtual machine running the application. | |
| 1088 | * | |
| 1089 | * @param parameterName the name of the parameter | |
| 1090 | * @param x the parameter value | |
| 1091 | * @param cal the <code>Calendar</code> object the driver will use | |
| 1092 | * to construct the date | |
| 1093 | * @exception SQLException if a database access error occurs | |
| 1094 | * @since 1.4 | |
| 1095 | */ | |
| 1096 | 2 | public void setDate(String parameterName, java.sql.Date x, Calendar cal) throws SQLException { |
| 1097 | 2 | checkIsOpen(); |
| 1098 | 1 | delegate_.setDate(parameterName, x, cal); |
| 1099 | } | |
| 1100 | ||
| 1101 | ||
| 1102 | /** | |
| 1103 | * Sets the designated parameter to the given <code>java.sql.Time</code> value, | |
| 1104 | * using the given <code>Calendar</code> object. The driver uses | |
| 1105 | * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value, | |
| 1106 | * which the driver then sends to the database. With a | |
| 1107 | * a <code>Calendar</code> object, the driver can calculate the time | |
| 1108 | * taking into account a custom timezone. If no | |
| 1109 | * <code>Calendar</code> object is specified, the driver uses the default | |
| 1110 | * timezone, which is that of the virtual machine running the application. | |
| 1111 | * | |
| 1112 | * @param parameterName the name of the parameter | |
| 1113 | * @param x the parameter value | |
| 1114 | * @param cal the <code>Calendar</code> object the driver will use | |
| 1115 | * to construct the time | |
| 1116 | * @exception SQLException if a database access error occurs | |
| 1117 | * @since 1.4 | |
| 1118 | */ | |
| 1119 | 2 | public void setTime(String parameterName, java.sql.Time x, Calendar cal) throws SQLException { |
| 1120 | 2 | checkIsOpen(); |
| 1121 | 1 | delegate_.setTime(parameterName, x, cal); |
| 1122 | } | |
| 1123 | ||
| 1124 | ||
| 1125 | /** | |
| 1126 | * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value, | |
| 1127 | * using the given <code>Calendar</code> object. The driver uses | |
| 1128 | * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value, | |
| 1129 | * which the driver then sends to the database. With a | |
| 1130 | * a <code>Calendar</code> object, the driver can calculate the timestamp | |
| 1131 | * taking into account a custom timezone. If no | |
| 1132 | * <code>Calendar</code> object is specified, the driver uses the default | |
| 1133 | * timezone, which is that of the virtual machine running the application. | |
| 1134 | * | |
| 1135 | * @param parameterName the name of the parameter | |
| 1136 | * @param x the parameter value | |
| 1137 | * @param cal the <code>Calendar</code> object the driver will use | |
| 1138 | * to construct the timestamp | |
| 1139 | * @exception SQLException if a database access error occurs | |
| 1140 | * @since 1.4 | |
| 1141 | */ | |
| 1142 | 2 | public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal) throws SQLException { |
| 1143 | 2 | checkIsOpen(); |
| 1144 | 1 | delegate_.setTimestamp(parameterName, x, cal); |
| 1145 | } | |
| 1146 | ||
| 1147 | ||
| 1148 | /** | |
| 1149 | * Sets the designated parameter to SQL <code>NULL</code>. | |
| 1150 | * This version of the method <code>setNull</code> should | |
| 1151 | * be used for user-defined types and REF type parameters. Examples | |
| 1152 | * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and | |
| 1153 | * named array types. | |
| 1154 | * | |
| 1155 | * <P><B>Note:</B> To be portable, applications must give the | |
| 1156 | * SQL type code and the fully-qualified SQL type name when specifying | |
| 1157 | * a NULL user-defined or REF parameter. In the case of a user-defined type | |
| 1158 | * the name is the type name of the parameter itself. For a REF | |
| 1159 | * parameter, the name is the type name of the referenced type. If | |
| 1160 | * a JDBC driver does not need the type code or type name information, | |
| 1161 | * it may ignore it. | |
| 1162 | * | |
| 1163 | * Although it is intended for user-defined and Ref parameters, | |
| 1164 | * this method may be used to set a null parameter of any JDBC type. | |
| 1165 | * If the parameter does not have a user-defined or REF type, the given | |
| 1166 | * typeName is ignored. | |
| 1167 | * | |
| 1168 | * | |
| 1169 | * @param parameterName the name of the parameter | |
| 1170 | * @param sqlType a value from <code>java.sql.Types</code> | |
| 1171 | * @param typeName the fully-qualified name of an SQL user-defined type; | |
| 1172 | * ignored if the parameter is not a user-defined type or | |
| 1173 | * SQL <code>REF</code> value | |
| 1174 | * @exception SQLException if a database access error occurs | |
| 1175 | * @since 1.4 | |
| 1176 | */ | |
| 1177 | 2 | public void setNull (String parameterName, int sqlType, String typeName) throws SQLException { |
| 1178 | 2 | checkIsOpen(); |
| 1179 | 1 | delegate_.setNull(parameterName, sqlType, typeName); |
| 1180 | } | |
| 1181 | ||
| 1182 | ||
| 1183 | /** | |
| 1184 | * Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>, | |
| 1185 | * or <code>LONGVARCHAR</code> parameter as a <code>String</code> in | |
| 1186 | * the Java programming language. | |
| 1187 | * <p> | |
| 1188 | * For the fixed-length type JDBC <code>CHAR</code>, | |
| 1189 | * the <code>String</code> object | |
| 1190 | * returned has exactly the same value the JDBC | |
| 1191 | * <code>CHAR</code> value had in the | |
| 1192 | * database, including any padding added by the database. | |
| 1193 | * @param parameterName the name of the parameter | |
| 1194 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1195 | * is <code>null</code>. | |
| 1196 | * @exception SQLException if a database access error occurs | |
| 1197 | * @see #setString | |
| 1198 | * @since 1.4 | |
| 1199 | */ | |
| 1200 | 2 | public String getString(String parameterName) throws SQLException { |
| 1201 | 2 | checkIsOpen(); |
| 1202 | 1 | return delegate_.getString(parameterName); |
| 1203 | } | |
| 1204 | ||
| 1205 | ||
| 1206 | /** | |
| 1207 | * Retrieves the value of a JDBC <code>BIT</code> parameter as a | |
| 1208 | * <code>boolean</code> in the Java programming language. | |
| 1209 | * @param parameterName the name of the parameter | |
| 1210 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1211 | * is <code>false</code>. | |
| 1212 | * @exception SQLException if a database access error occurs | |
| 1213 | * @see #setBoolean | |
| 1214 | * @since 1.4 | |
| 1215 | */ | |
| 1216 | 2 | public boolean getBoolean(String parameterName) throws SQLException { |
| 1217 | 2 | checkIsOpen(); |
| 1218 | 1 | return delegate_.getBoolean(parameterName); |
| 1219 | } | |
| 1220 | ||
| 1221 | ||
| 1222 | /** | |
| 1223 | * Retrieves the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code> | |
| 1224 | * in the Java programming language. | |
| 1225 | * @param parameterName the name of the parameter | |
| 1226 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1227 | * is <code>0</code>. | |
| 1228 | * @exception SQLException if a database access error occurs | |
| 1229 | * @see #setByte | |
| 1230 | * @since 1.4 | |
| 1231 | */ | |
| 1232 | 2 | public byte getByte(String parameterName) throws SQLException { |
| 1233 | 2 | checkIsOpen(); |
| 1234 | 1 | return delegate_.getByte(parameterName); |
| 1235 | } | |
| 1236 | ||
| 1237 | ||
| 1238 | /** | |
| 1239 | * Retrieves the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code> | |
| 1240 | * in the Java programming language. | |
| 1241 | * @param parameterName the name of the parameter | |
| 1242 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1243 | * is <code>0</code>. | |
| 1244 | * @exception SQLException if a database access error occurs | |
| 1245 | * @see #setShort | |
| 1246 | * @since 1.4 | |
| 1247 | */ | |
| 1248 | 2 | public short getShort(String parameterName) throws SQLException { |
| 1249 | 2 | checkIsOpen(); |
| 1250 | 1 | return delegate_.getShort(parameterName); |
| 1251 | } | |
| 1252 | ||
| 1253 | ||
| 1254 | /** | |
| 1255 | * Retrieves the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code> | |
| 1256 | * in the Java programming language. | |
| 1257 | * | |
| 1258 | * @param parameterName the name of the parameter | |
| 1259 | * @return the parameter value. If the value is SQL <code>NULL</code>, | |
| 1260 | * the result is <code>0</code>. | |
| 1261 | * @exception SQLException if a database access error occurs | |
| 1262 | * @see #setInt | |
| 1263 | * @since 1.4 | |
| 1264 | */ | |
| 1265 | 2 | public int getInt(String parameterName) throws SQLException { |
| 1266 | 2 | checkIsOpen(); |
| 1267 | 1 | return delegate_.getInt(parameterName); |
| 1268 | } | |
| 1269 | ||
| 1270 | ||
| 1271 | /** | |
| 1272 | * Retrieves the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code> | |
| 1273 | * in the Java programming language. | |
| 1274 | * | |
| 1275 | * @param parameterName the name of the parameter | |
| 1276 | * @return the parameter value. If the value is SQL <code>NULL</code>, | |
| 1277 | * the result is <code>0</code>. | |
| 1278 | * @exception SQLException if a database access error occurs | |
| 1279 | * @see #setLong | |
| 1280 | * @since 1.4 | |
| 1281 | */ | |
| 1282 | 2 | public long getLong(String parameterName) throws SQLException { |
| 1283 | 2 | checkIsOpen(); |
| 1284 | 1 | return delegate_.getLong(parameterName); |
| 1285 | } | |
| 1286 | ||
| 1287 | ||
| 1288 | /** | |
| 1289 | * Retrieves the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code> | |
| 1290 | * in the Java programming language. | |
| 1291 | * @param parameterName the name of the parameter | |
| 1292 | * @return the parameter value. If the value is SQL <code>NULL</code>, | |
| 1293 | * the result is <code>0</code>. | |
| 1294 | * @exception SQLException if a database access error occurs | |
| 1295 | * @see #setFloat | |
| 1296 | * @since 1.4 | |
| 1297 | */ | |
| 1298 | 2 | public float getFloat(String parameterName) throws SQLException { |
| 1299 | 2 | checkIsOpen(); |
| 1300 | 1 | return delegate_.getFloat(parameterName); |
| 1301 | } | |
| 1302 | ||
| 1303 | ||
| 1304 | /** | |
| 1305 | * Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code> | |
| 1306 | * in the Java programming language. | |
| 1307 | * @param parameterName the name of the parameter | |
| 1308 | * @return the parameter value. If the value is SQL <code>NULL</code>, | |
| 1309 | * the result is <code>0</code>. | |
| 1310 | * @exception SQLException if a database access error occurs | |
| 1311 | * @see #setDouble | |
| 1312 | * @since 1.4 | |
| 1313 | */ | |
| 1314 | 2 | public double getDouble(String parameterName) throws SQLException { |
| 1315 | 2 | checkIsOpen(); |
| 1316 | 1 | return delegate_.getDouble(parameterName); |
| 1317 | } | |
| 1318 | ||
| 1319 | ||
| 1320 | /** | |
| 1321 | * Retrieves the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code> | |
| 1322 | * parameter as an array of <code>byte</code> values in the Java | |
| 1323 | * programming language. | |
| 1324 | * @param parameterName the name of the parameter | |
| 1325 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result is | |
| 1326 | * <code>null</code>. | |
| 1327 | * @exception SQLException if a database access error occurs | |
| 1328 | * @see #setBytes | |
| 1329 | * @since 1.4 | |
| 1330 | */ | |
| 1331 | 2 | public byte[] getBytes(String parameterName) throws SQLException { |
| 1332 | 2 | checkIsOpen(); |
| 1333 | 1 | return delegate_.getBytes(parameterName); |
| 1334 | } | |
| 1335 | ||
| 1336 | ||
| 1337 | /** | |
| 1338 | * Retrieves the value of a JDBC <code>DATE</code> parameter as a | |
| 1339 | * <code>java.sql.Date</code> object. | |
| 1340 | * @param parameterName the name of the parameter | |
| 1341 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1342 | * is <code>null</code>. | |
| 1343 | * @exception SQLException if a database access error occurs | |
| 1344 | * @since 1.4 | |
| 1345 | */ | |
| 1346 | 2 | public java.sql.Date getDate(String parameterName) throws SQLException { |
| 1347 | 2 | checkIsOpen(); |
| 1348 | 1 | return delegate_.getDate(parameterName); |
| 1349 | } | |
| 1350 | ||
| 1351 | ||
| 1352 | /** | |
| 1353 | * Retrieves the value of a JDBC <code>TIME</code> parameter as a | |
| 1354 | * <code>java.sql.Time</code> object. | |
| 1355 | * @param parameterName the name of the parameter | |
| 1356 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1357 | * is <code>null</code>. | |
| 1358 | * @exception SQLException if a database access error occurs | |
| 1359 | * @since 1.4 | |
| 1360 | */ | |
| 1361 | 2 | public java.sql.Time getTime(String parameterName) throws SQLException { |
| 1362 | 2 | checkIsOpen(); |
| 1363 | 1 | return delegate_.getTime(parameterName); |
| 1364 | } | |
| 1365 | ||
| 1366 | ||
| 1367 | /** | |
| 1368 | * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a | |
| 1369 | * <code>java.sql.Timestamp</code> object. | |
| 1370 | * @param parameterName the name of the parameter | |
| 1371 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result | |
| 1372 | * is <code>null</code>. | |
| 1373 | * @exception SQLException if a database access error occurs | |
| 1374 | * @since 1.4 | |
| 1375 | */ | |
| 1376 | 2 | public java.sql.Timestamp getTimestamp(String parameterName) throws SQLException { |
| 1377 | 2 | checkIsOpen(); |
| 1378 | 1 | return delegate_.getTimestamp(parameterName); |
| 1379 | } | |
| 1380 | ||
| 1381 | ||
| 1382 | /** | |
| 1383 | * Retrieves the value of a parameter as an <code>Object</code> in the Java | |
| 1384 | * programming language. If the value is an SQL <code>NULL</code>, the | |
| 1385 | * driver returns a Java <code>null</code>. | |
| 1386 | * <p> | |
| 1387 | * This method returns a Java object whose type corresponds to the JDBC | |
| 1388 | * type that was registered for this parameter using the method | |
| 1389 | * <code>registerOutParameter</code>. By registering the target JDBC | |
| 1390 | * type as <code>java.sql.Types.OTHER</code>, this method can be used | |
| 1391 | * to read database-specific abstract data types. | |
| 1392 | * @param parameterName the name of the parameter | |
| 1393 | * @return A <code>java.lang.Object</code> holding the OUT parameter value. | |
| 1394 | * @exception SQLException if a database access error occurs | |
| 1395 | * @see java.sql.Types | |
| 1396 | * @since 1.4 | |
| 1397 | */ | |
| 1398 | 2 | public Object getObject(String parameterName) throws SQLException { |
| 1399 | 2 | checkIsOpen(); |
| 1400 | 1 | return delegate_.getObject(parameterName); |
| 1401 | } | |
| 1402 | ||
| 1403 | ||
| 1404 | /** | |
| 1405 | * Retrieves the value of a JDBC <code>NUMERIC</code> parameter as a | |
| 1406 | * <code>java.math.BigDecimal</code> object with as many digits to the | |
| 1407 | * right of the decimal point as the value contains. | |
| 1408 | * @param parameterName the name of the parameter | |
| 1409 | * @return the parameter value in full precision. If the value is | |
| 1410 | * SQL <code>NULL</code>, the result is <code>null</code>. | |
| 1411 | * @exception SQLException if a database access error occurs | |
| 1412 | * @see #setBigDecimal | |
| 1413 | * @since 1.4 | |
| 1414 | */ | |
| 1415 | 2 | public BigDecimal getBigDecimal(String parameterName) throws SQLException { |
| 1416 | 2 | checkIsOpen(); |
| 1417 | 1 | return delegate_.getBigDecimal(parameterName); |
| 1418 | } | |
| 1419 | ||
| 1420 | ||
| 1421 | /** | |
| 1422 | * Returns an object representing the value of OUT parameter | |
| 1423 | * <code>i</code> and uses <code>map</code> for the custom | |
| 1424 | * mapping of the parameter value. | |
| 1425 | * <p> | |
| 1426 | * This method returns a Java object whose type corresponds to the | |
| 1427 | * JDBC type that was registered for this parameter using the method | |
| 1428 | * <code>registerOutParameter</code>. By registering the target | |
| 1429 | * JDBC type as <code>java.sql.Types.OTHER</code>, this method can | |
| 1430 | * be used to read database-specific abstract data types. | |
| 1431 | * @param parameterName the name of the parameter | |
| 1432 | * @param map the mapping from SQL type names to Java classes | |
| 1433 | * @return a <code>java.lang.Object</code> holding the OUT parameter value | |
| 1434 | * @exception SQLException if a database access error occurs | |
| 1435 | * @since 1.4 | |
| 1436 | */ | |
| 1437 | 2 | public Object getObject(String parameterName, java.util.Map map) throws SQLException { |
| 1438 | 2 | checkIsOpen(); |
| 1439 | 1 | return delegate_.getObject(parameterName, map); |
| 1440 | } | |
| 1441 | ||
| 1442 | ||
| 1443 | /** | |
| 1444 | * Retrieves the value of a JDBC <code>REF(<structured-type>)</code> | |
| 1445 | * parameter as a {@link Ref} object in the Java programming language. | |
| 1446 | * | |
| 1447 | * @param parameterName the name of the parameter | |
| 1448 | * @return the parameter value as a <code>Ref</code> object in the | |
| 1449 | * Java programming language. If the value was SQL <code>NULL</code>, | |
| 1450 | * the value <code>null</code> is returned. | |
| 1451 | * @exception SQLException if a database access error occurs | |
| 1452 | * @since 1.4 | |
| 1453 | */ | |
| 1454 | 2 | public Ref getRef (String parameterName) throws SQLException { |
| 1455 | 2 | checkIsOpen(); |
| 1456 | 1 | return delegate_.getRef(parameterName); |
| 1457 | } | |
| 1458 | ||
| 1459 | ||
| 1460 | /** | |
| 1461 | * Retrieves the value of a JDBC <code>BLOB</code> parameter as a | |
| 1462 | * {@link Blob} object in the Java programming language. | |
| 1463 | * | |
| 1464 | * @param parameterName the name of the parameter | |
| 1465 | * @return the parameter value as a <code>Blob</code> object in the | |
| 1466 | * Java programming language. If the value was SQL <code>NULL</code>, | |
| 1467 | * the value <code>null</code> is returned. | |
| 1468 | * @exception SQLException if a database access error occurs | |
| 1469 | * @since 1.4 | |
| 1470 | */ | |
| 1471 | 2 | public Blob getBlob (String parameterName) throws SQLException { |
| 1472 | 2 | checkIsOpen(); |
| 1473 | 1 | return delegate_.getBlob(parameterName); |
| 1474 | } | |
| 1475 | ||
| 1476 | ||
| 1477 | /** | |
| 1478 | * Retrieves the value of a JDBC <code>CLOB</code> parameter as a | |
| 1479 | * <code>Clob</code> object in the Java programming language. | |
| 1480 | * @param parameterName the name of the parameter | |
| 1481 | * @return the parameter value as a <code>Clob</code> object in the | |
| 1482 | * Java programming language. If the value was SQL <code>NULL</code>, | |
| 1483 | * the value <code>null</code> is returned. | |
| 1484 | * @exception SQLException if a database access error occurs | |
| 1485 | * @since 1.4 | |
| 1486 | */ | |
| 1487 | 2 | public Clob getClob (String parameterName) throws SQLException { |
| 1488 | 2 | checkIsOpen(); |
| 1489 | 1 | return delegate_.getClob(parameterName); |
| 1490 | } | |
| 1491 | ||
| 1492 | ||
| 1493 | /** | |
| 1494 | * Retrieves the value of a JDBC <code>ARRAY</code> parameter as an | |
| 1495 | * {@link Array} object in the Java programming language. | |
| 1496 | * | |
| 1497 | * @param parameterName the name of the parameter | |
| 1498 | * @return the parameter value as an <code>Array</code> object in | |
| 1499 | * Java programming language. If the value was SQL <code>NULL</code>, | |
| 1500 | * the value <code>null</code> is returned. | |
| 1501 | * @exception SQLException if a database access error occurs | |
| 1502 | * @since 1.4 | |
| 1503 | */ | |
| 1504 | 2 | public Array getArray (String parameterName) throws SQLException { |
| 1505 | 2 | checkIsOpen(); |
| 1506 | 1 | return delegate_.getArray(parameterName); |
| 1507 | } | |
| 1508 | ||
| 1509 | ||
| 1510 | /** | |
| 1511 | * Retrieves the value of a JDBC <code>DATE</code> parameter as a | |
| 1512 | * <code>java.sql.Date</code> object, using | |
| 1513 | * the given <code>Calendar</code> object | |
| 1514 | * to construct the date. | |
| 1515 | * With a <code>Calendar</code> object, the driver | |
| 1516 | * can calculate the date taking into account a custom timezone and locale. | |
| 1517 | * If no <code>Calendar</code> object is specified, the driver uses the | |
| 1518 | * default timezone and locale. | |
| 1519 | * | |
| 1520 | * @param parameterName the name of the parameter | |
| 1521 | * @param cal the <code>Calendar</code> object the driver will use | |
| 1522 | * to construct the date | |
| 1523 | * @return the parameter value. If the value is SQL <code>NULL</code>, | |
| 1524 | * the result is <code>null</code>. | |
| 1525 | * @exception SQLException if a database access error occurs | |
| 1526 | * @since 1.4 | |
| 1527 | */ | |
| 1528 | 2 | public java.sql.Date getDate(String parameterName, Calendar cal) throws SQLException { |
| 1529 | 2 | checkIsOpen(); |
| 1530 | 1 | return delegate_.getDate(parameterName, cal); |
| 1531 | } | |
| 1532 | ||
| 1533 | ||
| 1534 | /** | |
| 1535 | * Retrieves the value of a JDBC <code>TIME</code> parameter as a | |
| 1536 | * <code>java.sql.Time</code> object, using | |
| 1537 | * the given <code>Calendar</code> object | |
| 1538 | * to construct the time. | |
| 1539 | * With a <code>Calendar</code> object, the driver | |
| 1540 | * can calculate the time taking into account a custom timezone and locale. | |
| 1541 | * If no <code>Calendar</code> object is specified, the driver uses the | |
| 1542 | * default timezone and locale. | |
| 1543 | * | |
| 1544 | * @param parameterName the name of the parameter | |
| 1545 | * @param cal the <code>Calendar</code> object the driver will use | |
| 1546 | * to construct the time | |
| 1547 | * @return the parameter value; if the value is SQL <code>NULL</code>, the result is | |
| 1548 | * <code>null</code>. | |
| 1549 | * @exception SQLException if a database access error occurs | |
| 1550 | * @since 1.4 | |
| 1551 | */ | |
| 1552 | 2 | public java.sql.Time getTime(String parameterName, Calendar cal) throws SQLException { |
| 1553 | 2 | checkIsOpen(); |
| 1554 | 1 | return delegate_.getTime(parameterName, cal); |
| 1555 | } | |
| 1556 | ||
| 1557 | ||
| 1558 | /** | |
| 1559 | * Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a | |
| 1560 | * <code>java.sql.Timestamp</code> object, using | |
| 1561 | * the given <code>Calendar</code> object to construct | |
| 1562 | * the <code>Timestamp</code> object. | |
| 1563 | * With a <code>Calendar</code> object, the driver | |
| 1564 | * can calculate the timestamp taking into account a custom timezone and locale. | |
| 1565 | * If no <code>Calendar</code> object is specified, the driver uses the | |
| 1566 | * default timezone and locale. | |
| 1567 | * | |
| 1568 | * | |
| 1569 | * @param parameterName the name of the parameter | |
| 1570 | * @param cal the <code>Calendar</code> object the driver will use | |
| 1571 | * to construct the timestamp | |
| 1572 | * @return the parameter value. If the value is SQL <code>NULL</code>, the result is | |
| 1573 | * <code>null</code>. | |
| 1574 | * @exception SQLException if a database access error occurs | |
| 1575 | * @since 1.4 | |
| 1576 | */ | |
| 1577 | 2 | public java.sql.Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException { |
| 1578 | 2 | checkIsOpen(); |
| 1579 | 1 | return delegate_.getTimestamp(parameterName, cal); |
| 1580 | } | |
| 1581 | ||
| 1582 | ||
| 1583 | /** | |
| 1584 | * Retrieves the value of a JDBC <code>DATALINK</code> parameter as a | |
| 1585 | * <code>java.net.URL</code> object. | |
| 1586 | * | |
| 1587 | * @param parameterName the name of the parameter | |
| 1588 | * @return the parameter value as a <code>java.net.URL</code> object in the | |
| 1589 | * Java programming language. If the value was SQL <code>NULL</code>, the | |
| 1590 | * value <code>null</code> is returned. | |
| 1591 | * @exception SQLException if a database access error occurs, | |
| 1592 | * or if there is a problem with the URL | |
| 1593 | * @see #setURL | |
| 1594 | * @since 1.4 | |
| 1595 | */ | |
| 1596 | 2 | public java.net.URL getURL(String parameterName) throws SQLException { |
| 1597 | 2 | checkIsOpen(); |
| 1598 | 1 | return delegate_.getURL(parameterName); |
| 1599 | } | |
| 1600 | ||
| 1601 | ||
| 1602 | /** | |
| 1603 | * Registers the OUT parameter named | |
| 1604 | * <code>parameterName</code> to the JDBC type | |
| 1605 | * <code>sqlType</code>. All OUT parameters must be registered | |
| 1606 | * before a stored procedure is executed. | |
| 1607 | * <p> | |
| 1608 | * The JDBC type specified by <code>sqlType</code> for an OUT | |
| 1609 | * parameter determines the Java type that must be used | |
| 1610 | * in the <code>get</code> method to read the value of that parameter. | |
| 1611 | * <p> | |
| 1612 | * If the JDBC type expected to be returned to this output parameter | |
| 1613 | * is specific to this particular database, <code>sqlType</code> | |
| 1614 | * should be <code>java.sql.Types.OTHER</code>. The method | |
| 1615 | * getObject retrieves the value. | |
| 1616 | * @param parameterName the name of the parameter | |
| 1617 | * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>. | |
| 1618 | * If the parameter is of JDBC type <code>NUMERIC</code> | |
| 1619 | * or <code>DECIMAL</code>, the version of | |
| 1620 | * <code>registerOutParameter</code> that accepts a scale value | |
| 1621 | * should be used. | |
| 1622 | * @exception SQLException if a database access error occurs | |
| 1623 | * @since 1.4 | |
| 1624 | * @see java.sql.Types | |
| 1625 | */ | |
| 1626 | 2 | public void registerOutParameter(String parameterName, int sqlType) throws SQLException { |
| 1627 | 2 | checkIsOpen(); |
| 1628 | 1 | delegate_.registerOutParameter(parameterName, sqlType); |
| 1629 | } | |
| 1630 | ||
| 1631 | ||
| 1632 | /** | |
| 1633 | * Registers the parameter named | |
| 1634 | * <code>parameterName</code> to be of JDBC type | |
| 1635 | * <code>sqlType</code>. This method must be called | |
| 1636 | * before a stored procedure is executed. | |
| 1637 | * <p> | |
| 1638 | * The JDBC type specified by <code>sqlType</code> for an OUT | |
| 1639 | * parameter determines the Java type that must be used | |
| 1640 | * in the <code>get</code> method to read the value of that parameter. | |
| 1641 | * <p> | |
| 1642 | * This version of <code>registerOutParameter</code> should be | |
| 1643 | * used when the parameter is of JDBC type <code>NUMERIC</code> | |
| 1644 | * or <code>DECIMAL</code>. | |
| 1645 | * @param parameterName the name of the parameter | |
| 1646 | * @param sqlType SQL type code defined by <code>java.sql.Types</code>. | |
| 1647 | * @param scale the desired number of digits to the right of the | |
| 1648 | * decimal point. It must be greater than or equal to zero. | |
| 1649 | * @exception SQLException if a database access error occurs | |
| 1650 | * @since 1.4 | |
| 1651 | * @see java.sql.Types | |
| 1652 | */ | |
| 1653 | 2 | public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException { |
| 1654 | 2 | checkIsOpen(); |
| 1655 | 1 | delegate_.registerOutParameter(parameterName, sqlType, scale); |
| 1656 | } | |
| 1657 | ||
| 1658 | ||
| 1659 | /** | |
| 1660 | * Registers the designated output parameter. This version of | |
| 1661 | * the method <code>registerOutParameter</code> | |
| 1662 | * should be used for a user-named or REF output parameter. Examples | |
| 1663 | * of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and | |
| 1664 | * named array types. | |
| 1665 | * | |
| 1666 | * Before executing a stored procedure call, you must explicitly | |
| 1667 | * call <code>registerOutParameter</code> to register the type from | |
| 1668 | * <code>java.sql.Types</code> for each | |
| 1669 | * OUT parameter. For a user-named parameter the fully-qualified SQL | |
| 1670 | * type name of the parameter should also be given, while a REF | |
| 1671 | * parameter requires that the fully-qualified type name of the | |
| 1672 | * referenced type be given. A JDBC driver that does not need the | |
| 1673 | * type code and type name information may ignore it. To be portable, | |
| 1674 | * however, applications should always provide these values for | |
| 1675 | * user-named and REF parameters. | |
| 1676 | * | |
| 1677 | * Although it is intended for user-named and REF parameters, | |
| 1678 | * this method may be used to register a parameter of any JDBC type. | |
| 1679 | * If the parameter does not have a user-named or REF type, the | |
| 1680 | * typeName parameter is ignored. | |
| 1681 | * | |
| 1682 | * <P><B>Note:</B> When reading the value of an out parameter, you | |
| 1683 | * must use the <code>getXXX</code> method whose Java type XXX corresponds to the | |
| 1684 | * parameter's registered SQL type. | |
| 1685 | * | |
| 1686 | * @param parameterName the name of the parameter | |
| 1687 | * @param sqlType a value from {@link java.sql.Types} | |
| 1688 | * @param typeName the fully-qualified name of an SQL structured type | |
| 1689 | * @exception SQLException if a database access error occurs | |
| 1690 | * @see java.sql.Types | |
| 1691 | * @since 1.4 | |
| 1692 | */ | |
| 1693 | 2 | public void registerOutParameter (String parameterName, int sqlType, String typeName) throws SQLException { |
| 1694 | 2 | checkIsOpen(); |
| 1695 | 1 | delegate_.registerOutParameter(parameterName, sqlType, typeName); |
| 1696 | } | |
| 1697 | } | |
| 1698 |
|
||||||||||