Source for java.sql.CallableStatement

   1: /* CallableStatement.java -- A statement for calling stored procedures.
   2:    Copyright (C) 1999, 2000, 2002, 2006 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10:  
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: package java.sql;
  39: 
  40: import java.io.InputStream;
  41: import java.io.Reader;
  42: import java.math.BigDecimal;
  43: import java.net.URL;
  44: import java.util.Calendar;
  45: import java.util.Map;
  46: 
  47: /**
  48:  * This interface provides a mechanism for calling stored procedures.
  49:  *
  50:  * @author Aaron M. Renn (arenn@urbanophile.com)
  51:  */
  52: public interface CallableStatement extends PreparedStatement 
  53: {
  54:   /**
  55:    * This method registers the specified parameter as an output parameter
  56:    * of the specified SQL type.
  57:    *
  58:    * @param index The index of the parameter to register as output.
  59:    * @param sqlType The SQL type value from <code>Types</code>.
  60:    * @exception SQLException If an error occurs.
  61:    */   
  62:   void registerOutParameter(int index, int sqlType)
  63:     throws SQLException;
  64: 
  65:   /**
  66:    * This method registers the specified parameter as an output parameter
  67:    * of the specified SQL type and scale.
  68:    *
  69:    * @param index The index of the parameter to register as output.
  70:    * @param sqlType The SQL type value from <code>Types</code>.
  71:    * @param scale The scale of the value that will be returned.
  72:    * @exception SQLException If an error occurs.
  73:    */   
  74:   void registerOutParameter(int index, int sqlType, int scale)
  75:     throws SQLException;
  76: 
  77:   /**
  78:    * This method tests whether the value of the last parameter that was fetched
  79:    * was actually a SQL NULL value.
  80:    *
  81:    * @return <code>true</code> if the last parameter fetched was a NULL,
  82:    *         <code>false</code> otherwise.
  83:    * @exception SQLException If an error occurs.
  84:    */
  85:   boolean wasNull() throws SQLException;
  86: 
  87:   /**
  88:    * This method returns the value of the specified parameter as a Java
  89:    * <code>String</code>.
  90:    *
  91:    * @param index The index of the parameter to return.
  92:    * @return The parameter value as a <code>String</code>.
  93:    * @exception SQLException If an error occurs.
  94:    */
  95:   String getString(int index) throws SQLException;
  96: 
  97:   /**
  98:    * This method returns the value of the specified parameter as a Java
  99:    * <code>boolean</code>.
 100:    *
 101:    * @param index The index of the parameter to return.
 102:    * @return The parameter value as a <code>boolean</code>.
 103:    * @exception SQLException If an error occurs.
 104:    */
 105:   boolean getBoolean(int index) throws SQLException;
 106: 
 107:   /**
 108:    * This method returns the value of the specified parameter as a Java
 109:    * <code>byte</code>.
 110:    *
 111:    * @param index The index of the parameter to return.
 112:    * @return The parameter value as a <code>byte</code>.
 113:    * @exception SQLException If an error occurs.
 114:    */
 115:   byte getByte(int index) throws SQLException;
 116: 
 117:   /**
 118:    * This method returns the value of the specified parameter as a Java
 119:    * <code>short</code>.
 120:    *
 121:    * @param index The index of the parameter to return.
 122:    * @return The parameter value as a <code>short</code>.
 123:    * @exception SQLException If an error occurs.
 124:    */
 125:   short getShort(int index) throws SQLException;
 126: 
 127:   /**
 128:    * This method returns the value of the specified parameter as a Java
 129:    * <code>int</code>.
 130:    *
 131:    * @param index The index of the parameter to return.
 132:    * @return The parameter value as a <code>int</code>.
 133:    * @exception SQLException If an error occurs.
 134:    */
 135:   int getInt(int index) throws SQLException;
 136: 
 137:   /**
 138:    * This method returns the value of the specified parameter as a Java
 139:    * <code>long</code>.
 140:    *
 141:    * @param index The index of the parameter to return.
 142:    * @return The parameter value as a <code>long</code>.
 143:    * @exception SQLException If an error occurs.
 144:    */
 145:   long getLong(int index) throws SQLException;
 146: 
 147:   /**
 148:    * This method returns the value of the specified parameter as a Java
 149:    * <code>float</code>.
 150:    *
 151:    * @param index The index of the parameter to return.
 152:    * @return The parameter value as a <code>float</code>.
 153:    * @exception SQLException If an error occurs.
 154:    */
 155:   float getFloat(int index) throws SQLException;
 156: 
 157:   /**
 158:    * This method returns the value of the specified parameter as a Java
 159:    * <code>double</code>.
 160:    *
 161:    * @param index The index of the parameter to return.
 162:    * @return The parameter value as a <code>double</code>.
 163:    * @exception SQLException If an error occurs.
 164:    */
 165:   double getDouble(int index) throws SQLException;
 166: 
 167:   /**
 168:    * This method returns the value of the specified parameter as a Java
 169:    * <code>BigDecimal</code>.
 170:    *
 171:    * @param index The index of the parameter to return.
 172:    * @param scale The number of digits to the right of the decimal to return.
 173:    * @return The parameter value as a <code>BigDecimal</code>.
 174:    * @exception SQLException If an error occurs.
 175:    * @deprecated Use getBigDecimal(int index)
 176:    *             or getBigDecimal(String name) instead.
 177:    */
 178:   BigDecimal getBigDecimal(int index, int scale)
 179:     throws SQLException;
 180: 
 181:   /**
 182:    * This method returns the value of the specified parameter as a Java
 183:    * byte array.
 184:    *
 185:    * @param index The index of the parameter to return.
 186:    * @return The parameter value as a byte array
 187:    * @exception SQLException If an error occurs.
 188:    */
 189:   byte[] getBytes(int index) throws SQLException;
 190: 
 191:   /**
 192:    * This method returns the value of the specified parameter as a Java
 193:    * <code>java.sql.Date</code>.
 194:    *
 195:    * @param index The index of the parameter to return.
 196:    * @return The parameter value as a <code>java.sql.Date</code>.
 197:    * @exception SQLException If an error occurs.
 198:    */
 199:   Date getDate(int index) throws SQLException;
 200: 
 201:   /**
 202:    * This method returns the value of the specified parameter as a Java
 203:    * <code>java.sql.Time</code>.
 204:    *
 205:    * @param index The index of the parameter to return.
 206:    * @return The parameter value as a <code>java.sql.Time</code>.
 207:    * @exception SQLException If an error occurs.
 208:    */
 209:   Time getTime(int index) throws SQLException;
 210: 
 211:   /**
 212:    * This method returns the value of the specified parameter as a Java
 213:    * <code>java.sql.Timestamp</code>.
 214:    *
 215:    * @param index The index of the parameter to return.
 216:    * @return The parameter value as a <code>java.sql.Timestamp</code>.
 217:    * @exception SQLException If an error occurs.
 218:    */
 219:   Timestamp getTimestamp(int index) throws SQLException;
 220: 
 221:   /**
 222:    * This method returns the value of the specified parameter as a Java
 223:    * <code>Object</code>.
 224:    *
 225:    * @param index The index of the parameter to return.
 226:    * @return The parameter value as an <code>Object</code>.
 227:    * @exception SQLException If an error occurs.
 228:    * @since 1.2
 229:    */
 230:   Object getObject(int index) throws SQLException;
 231: 
 232:   /**
 233:    * This method returns the value of the specified parameter as a Java
 234:    * <code>BigDecimal</code>.
 235:    *
 236:    * @param index The index of the parameter to return.
 237:    * @return The parameter value as a <code>BigDecimal</code>.
 238:    * @exception SQLException If an error occurs.
 239:    * @since 1.2
 240:    */
 241:   BigDecimal getBigDecimal(int index) throws SQLException;
 242: 
 243:   /**
 244:    * This method returns the value of the specified parameter as a Java
 245:    * <code>Object</code>.
 246:    *
 247:    * @param index The index of the parameter to return.
 248:    * @param map The mapping to use for conversion from SQL to Java types.
 249:    * @return The parameter value as an <code>Object</code>.
 250:    * @exception SQLException If an error occurs.
 251:    * @since 1.2
 252:    */
 253:   Object getObject(int index, Map<String, Class<?>> map) throws SQLException;
 254: 
 255:   /**
 256:    * This method returns the value of the specified parameter as a Java
 257:    * <code>Ref</code>.
 258:    *
 259:    * @param index The index of the parameter to return.
 260:    * @return The parameter value as a <code>Ref</code>.
 261:    * @exception SQLException If an error occurs.
 262:    * @since 1.2
 263:    */
 264:   Ref getRef(int index) throws SQLException;
 265: 
 266:   /**
 267:    * This method returns the value of the specified parameter as a Java
 268:    * <code>Blob</code>.
 269:    *
 270:    * @param index The index of the parameter to return.
 271:    * @return The parameter value as a <code>Blob</code>.
 272:    * @exception SQLException If an error occurs.
 273:    * @since 1.2
 274:    */   
 275:   Blob getBlob(int index) throws SQLException;
 276: 
 277:   /**
 278:    * This method returns the value of the specified parameter as a Java
 279:    * <code>Clob</code>.
 280:    *
 281:    * @param index The index of the parameter to return.
 282:    * @return The parameter value as a <code>Clob</code>.
 283:    * @exception SQLException If an error occurs.
 284:    * @since 1.2
 285:    */
 286:   Clob getClob(int index) throws SQLException;
 287: 
 288:   /**
 289:    * This method returns the value of the specified parameter as a Java
 290:    * <code>Array</code>.
 291:    *
 292:    * @param index The index of the parameter to return.
 293:    * @return The parameter value as a <code>Array</code>.
 294:    * @exception SQLException If an error occurs.
 295:    * @since 1.2
 296:    */
 297:   Array getArray(int index) throws SQLException;
 298: 
 299:   /**
 300:    * This method returns the value of the specified parameter as a Java
 301:    * <code>java.sql.Date</code>.
 302:    *
 303:    * @param index The index of the parameter to return.
 304:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 305:    * @return The parameter value as a <code>java.sql.Date</code>.
 306:    * @exception SQLException If an error occurs.
 307:    * @since 1.2
 308:    */
 309:   Date getDate(int index, Calendar cal) throws SQLException;
 310: 
 311:   /**
 312:    * This method returns the value of the specified parameter as a Java
 313:    * <code>java.sql.Time</code>.
 314:    *
 315:    * @param index The index of the parameter to return.
 316:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 317:    * @return The parameter value as a <code>java.sql.Time</code>.
 318:    * @exception SQLException If an error occurs.
 319:    * @since 1.2
 320:    */
 321:   Time getTime(int index, Calendar cal) throws SQLException;
 322: 
 323:   /**
 324:    * This method returns the value of the specified parameter as a Java
 325:    * <code>java.sql.Timestamp</code>.
 326:    *
 327:    * @param index The index of the parameter to return.
 328:    * @return The parameter value as a <code>java.sql.Timestamp</code>.
 329:    * @exception SQLException If an error occurs.
 330:    * @since 1.2
 331:    */
 332:   Timestamp getTimestamp(int index, Calendar cal)
 333:     throws SQLException;
 334: 
 335:   /**
 336:    * This method registers the specified parameter as an output parameter
 337:    * of the specified SQL type.
 338:    *
 339:    * @param index The index of the parameter to register as output.
 340:    * @param sqlType The SQL type value from <code>Types</code>.
 341:    * @param typeName The user defined data type name.
 342:    * @exception SQLException If an error occurs.
 343:    * @since 1.2
 344:    */
 345:   void registerOutParameter(int index, int sqlType, String typeName)
 346:     throws SQLException;
 347: 
 348:   /**
 349:    * This method registers the specified parameter as an output parameter
 350:    * of the specified SQL type.
 351:    *
 352:    * @param name The name of the parameter to register as output.
 353:    * @param sqlType The SQL type value from <code>Types</code>.
 354:    * @exception SQLException If an error occurs.
 355:    * @since 1.4
 356:    */
 357:   void registerOutParameter(String name, int sqlType)
 358:     throws SQLException;
 359: 
 360:   /**
 361:    * This method registers the specified parameter as an output parameter
 362:    * of the specified SQL type.  This version of registerOutParameter is used 
 363:    * for NUMERIC or DECIMAL types.
 364:    *
 365:    * @param name The name of the parameter to register as output.
 366:    * @param sqlType The SQL type value from <code>Types</code>.
 367:    * @param scale Number of digits to the right of the decimal point.
 368:    * @exception SQLException If an error occurs.
 369:    * @since 1.4
 370:    */
 371:   void registerOutParameter(String name, int sqlType, int scale)
 372:     throws SQLException;
 373: 
 374: 
 375:   /**
 376:    * This method registers the specified parameter as an output parameter
 377:    * of the specified SQL type.  This version of registerOutParameter is used 
 378:    * for user-named or REF types. If the type of the output parameter does
 379:    * not have such a type, the typeName argument is ignored.
 380:    *
 381:    * @param name The name of the parameter to register as output.
 382:    * @param sqlType The SQL type value from <code>Types</code>.
 383:    * @param typeName The SQL structured type name.
 384:    * @exception SQLException If an error occurs.
 385:    * @since 1.4
 386:    */
 387:   void registerOutParameter(String name, int sqlType, String typeName) 
 388:     throws SQLException;
 389: 
 390:   /**
 391:    * This method returns the value of the specified parameter as a Java
 392:    * <code>java.net.URL</code>.
 393:    *
 394:    * @param index The index of the parameter to return.
 395:    * @return The parameter value as a <code>URL</code>.
 396:    * @exception SQLException If an error occurs.
 397:    * @since 1.4
 398:    */
 399:   URL getURL(int index) throws SQLException;
 400: 
 401:   /**
 402:    * This method sets the value of the specified parameter to the specified
 403:    * <code>java.net.URL</code>
 404:    * 
 405:    * @param name The name of the parameter to set.
 406:    * @param value The value the parameter.
 407:    * @since 1.4
 408:    */
 409:   void setURL(String name, URL value) throws SQLException;
 410: 
 411:   /**
 412:    * This method populates the specified parameter with a SQL NULL value
 413:    * for the specified type.
 414:    *
 415:    * @param name The name of the parameter to set.
 416:    * @param sqlType The SQL type identifier of the parameter from 
 417:    *                <code>Types</code>
 418:    * @exception SQLException If an error occurs.
 419:    * @since 1.4
 420:    */
 421:   void setNull(String name, int sqlType) throws SQLException;
 422: 
 423:   /**
 424:    * This method sets the specified parameter from the given Java
 425:    * <code>boolean</code> value.
 426:    *
 427:    * @param name The name of the parameter value to set.
 428:    * @param value The value of the parameter.
 429:    * @exception SQLException If an error occurs.
 430:    * @since 1.4
 431:    */
 432:   void setBoolean(String name, boolean value) throws SQLException;
 433: 
 434:   /**
 435:    * This method sets the specified parameter from the given Java
 436:    * <code>byte</code> value.
 437:    *
 438:    * @param name The name of the parameter value to set.
 439:    * @param value The value of the parameter.
 440:    * @exception SQLException If an error occurs.
 441:    * @since 1.4
 442:    */
 443:   void setByte(String name, byte value) throws SQLException;
 444: 
 445:   /**
 446:    * This method sets the specified parameter from the given Java
 447:    * <code>short</code> value.
 448:    *
 449:    * @param name The name of the parameter value to set.
 450:    * @param value The value of the parameter.
 451:    * @exception SQLException If an error occurs.
 452:    * @since 1.4
 453:    */
 454:   void setShort(String name, short value) throws SQLException;
 455: 
 456:   /**
 457:    * This method sets the specified parameter from the given Java
 458:    * <code>int</code> value.
 459:    *
 460:    * @param name The name of the parameter value to set.
 461:    * @param value The value of the parameter.
 462:    * @exception SQLException If an error occurs.
 463:    * @since 1.4
 464:    */
 465:   void setInt(String name, int value) throws SQLException;
 466: 
 467:   /**
 468:    * This method sets the specified parameter from the given Java
 469:    * <code>long</code> value.
 470:    *
 471:    * @param name The name of the parameter value to set.
 472:    * @param value The value of the parameter.
 473:    * @exception SQLException If an error occurs.
 474:    * @since 1.4
 475:    */
 476:   void setLong(String name, long value) throws SQLException;
 477: 
 478:   /**
 479:    * This method sets the specified parameter from the given Java
 480:    * <code>float</code> value.
 481:    *
 482:    * @param name The name of the parameter value to set.
 483:    * @param value The value of the parameter.
 484:    * @exception SQLException If an error occurs.
 485:    * @since 1.4
 486:    */
 487:   void setFloat(String name, float value) throws SQLException;
 488: 
 489:   /**
 490:    * This method sets the specified parameter from the given Java
 491:    * <code>double</code> value.
 492:    *
 493:    * @param name The name of the parameter value to set.
 494:    * @param value The value of the parameter.
 495:    * @exception SQLException If an error occurs.
 496:    * @since 1.4
 497:    */
 498:   void setDouble(String name, double value) throws SQLException;
 499: 
 500:   /**
 501:    * This method sets the specified parameter from the given Java
 502:    * <code>BigDecimal</code> value.
 503:    *
 504:    * @param name The name of the parameter value to set.
 505:    * @param value The value of the parameter.
 506:    * @exception SQLException If an error occurs.
 507:    * @since 1.4
 508:    */
 509:   void setBigDecimal(String name, BigDecimal value)
 510:     throws SQLException;
 511: 
 512:   /**
 513:    * This method sets the specified parameter from the given Java
 514:    * <code>String</code> value.
 515:    *
 516:    * @param name The name of the parameter value to set.
 517:    * @param value The value of the parameter.
 518:    * @exception SQLException If an error occurs.
 519:    * @since 1.4
 520:    */
 521:   void setString(String name, String value) throws SQLException;
 522: 
 523:   /**
 524:    * This method sets the specified parameter from the given Java
 525:    * <code>byte</code> array value.
 526:    *
 527:    * @param name The name of the parameter value to set.
 528:    * @param value The value of the parameter.
 529:    * @exception SQLException If an error occurs.
 530:    * @since 1.4
 531:    */
 532:   void setBytes(String name, byte[] value) throws SQLException;
 533: 
 534:   /**
 535:    * This method sets the specified parameter from the given Java
 536:    * <code>java.sql.Date</code> value.
 537:    *
 538:    * @param name The name of the parameter value to set.
 539:    * @param value The value of the parameter.
 540:    * @exception SQLException If an error occurs.
 541:    * @since 1.4
 542:    */
 543:   void setDate(String name, Date value) throws SQLException;
 544: 
 545:   /**
 546:    * This method sets the specified parameter from the given Java
 547:    * <code>java.sql.Time</code> value.
 548:    *
 549:    * @param name The name of the parameter value to set.
 550:    * @param value The value of the parameter.
 551:    * @exception SQLException If an error occurs.
 552:    * @since 1.4
 553:    */
 554:   void setTime(String name, Time value) throws SQLException;
 555: 
 556:   /**
 557:    * This method sets the specified parameter from the given Java
 558:    * <code>java.sql.Timestamp</code> value.
 559:    *
 560:    * @param name The name of the parameter value to set.
 561:    * @param value The value of the parameter.
 562:    * @exception SQLException If an error occurs.
 563:    * @since 1.4
 564:    */
 565:   void setTimestamp(String name, Timestamp value)
 566:     throws SQLException;
 567: 
 568:   /**
 569:    * This method sets the specified parameter from the given Java
 570:    * ASCII <code>InputStream</code> value.
 571:    *
 572:    * @param name The name of the parameter value to set.
 573:    * @param stream The stream from which the parameter value is read.
 574:    * @param count The number of bytes in the stream.
 575:    * @exception SQLException If an error occurs.
 576:    * @since 1.4
 577:    */
 578:   void setAsciiStream(String name, InputStream stream, int count)
 579:       throws SQLException;
 580: 
 581:   /**
 582:    * This method sets the specified parameter from the given Java
 583:    * binary <code>InputStream</code> value.
 584:    *
 585:    * @param name The name of the parameter value to set.
 586:    * @param stream The stream from which the parameter value is read.
 587:    * @param count The number of bytes in the stream.
 588:    * @exception SQLException If an error occurs.
 589:    * @since 1.4
 590:    */
 591:   void setBinaryStream(String name, InputStream stream, int count)
 592:       throws SQLException;
 593: 
 594:   /**
 595:    * This method sets the specified parameter from the given Java
 596:    * <code>Object</code> value.  The specified SQL object type will be used.
 597:    *
 598:    * @param name The name of the parameter value to set.
 599:    * @param value The value of the parameter.
 600:    * @param sqlType The SQL type to use for the parameter, from 
 601:    *                <code>Types</code>
 602:    * @param scale The scale of the value, for numeric values only.
 603:    * @exception SQLException If an error occurs.
 604:    * @see Types
 605:    * @since 1.4
 606:    */
 607:   void setObject(String name, Object value, int sqlType, int scale)
 608:     throws SQLException;
 609: 
 610:   /**
 611:    * This method sets the specified parameter from the given Java
 612:    * <code>Object</code> value.  The specified SQL object type will be used.
 613:    *
 614:    * @param name The name of the parameter value to set.
 615:    * @param value The value of the parameter.
 616:    * @param sqlType The SQL type to use for the parameter, from 
 617:    *                <code>Types</code>
 618:    * @exception SQLException If an error occurs.
 619:    * @see Types
 620:    * @since 1.4
 621:    */
 622:   void setObject(String name, Object value, int sqlType)
 623:     throws SQLException;
 624: 
 625:   /**
 626:    * This method sets the specified parameter from the given Java
 627:    * <code>Object</code> value.  The default object type to SQL type mapping
 628:    * will be used.
 629:    *
 630:    * @param name The name of the parameter value to set.
 631:    * @param value The value of the parameter.
 632:    * @exception SQLException If an error occurs.
 633:    * @since 1.4
 634:    */
 635:   void setObject(String name, Object value) throws SQLException;
 636: 
 637:   /**
 638:    * This method sets the specified parameter from the given Java
 639:    * character <code>Reader</code> value.
 640:    *
 641:    * @param name The name of the parameter value to set.
 642:    * @param reader The reader from which the parameter value is read.
 643:    * @param count The number of characters in the stream.
 644:    * @exception SQLException If an error occurs.
 645:    * @since 1.4
 646:    */
 647:   void setCharacterStream(String name, Reader reader, int count)
 648:     throws SQLException;
 649: 
 650:   /**
 651:    * This method sets the specified parameter from the given Java
 652:    * <code>java.sql.Date</code> value.
 653:    *
 654:    * @param name The name of the parameter value to set.
 655:    * @param value The value of the parameter.
 656:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 657:    * @exception SQLException If an error occurs.
 658:    * @since 1.4
 659:    */
 660:   void setDate(String name, Date value, Calendar cal)
 661:     throws SQLException;
 662: 
 663:   /**
 664:    * This method sets the specified parameter from the given Java
 665:    * <code>java.sql.Time</code> value.
 666:    *
 667:    * @param name The name of the parameter value to set.
 668:    * @param value The value of the parameter.
 669:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 670:    * @exception SQLException If an error occurs.
 671:    * @since 1.4
 672:    */
 673:   void setTime(String name, Time value, Calendar cal)
 674:     throws SQLException;
 675: 
 676:   /**
 677:    * This method sets the specified parameter from the given Java
 678:    * <code>java.sql.Timestamp</code> value.
 679:    *
 680:    * @param name The name of the parameter value to set.
 681:    * @param value The value of the parameter.
 682:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 683:    * @exception SQLException If an error occurs.
 684:    * @since 1.4
 685:    */
 686:   void setTimestamp(String name, Timestamp value, Calendar cal)
 687:     throws SQLException;
 688: 
 689:   /**
 690:    * This method populates the specified parameter with a SQL NULL value
 691:    * for the specified type.
 692:    *
 693:    * @param name The name of the parameter to set.
 694:    * @param sqlType The SQL type identifier of the parameter from
 695:    *                <code>Types</code>
 696:    * @param typeName The name of the data type, for user defined types.
 697:    * @exception SQLException If an error occurs.
 698:    * @since 1.4
 699:    */
 700:   void setNull(String name, int sqlType, String typeName)
 701:     throws SQLException;
 702: 
 703:   /**
 704:    * This method returns the value of the specified parameter as a Java
 705:    * <code>String</code>.
 706:    *
 707:    * @param name The name of the parameter to return.
 708:    * @return The parameter value as a <code>String</code>.
 709:    * @exception SQLException If an error occurs.
 710:    * @since 1.4
 711:    */
 712:   String getString(String name) throws SQLException;
 713: 
 714:   /**
 715:    * This method returns the value of the specified parameter as a Java
 716:    * <code>boolean</code>.
 717:    *
 718:    * @param name The name of the parameter to return.
 719:    * @return The parameter value as a <code>boolean</code>.
 720:    * @exception SQLException If an error occurs.
 721:    * @since 1.4
 722:    */
 723:   boolean getBoolean(String name) throws SQLException;
 724: 
 725:   /**
 726:    * This method returns the value of the specified parameter as a Java
 727:    * <code>byte</code>.
 728:    *
 729:    * @param name The name of the parameter to return.
 730:    * @return The parameter value as a <code>byte</code>.
 731:    * @exception SQLException If an error occurs.
 732:    * @since 1.4
 733:    */
 734:   byte getByte(String name) throws SQLException;
 735: 
 736:   /**
 737:    * This method returns the value of the specified parameter as a Java
 738:    * <code>short</code>.
 739:    *
 740:    * @param name The name of the parameter to return.
 741:    * @return The parameter value as a <code>short</code>.
 742:    * @exception SQLException If an error occurs.
 743:    * @since 1.4
 744:    */
 745:   short getShort(String name) throws SQLException;
 746: 
 747:   /**
 748:    * This method returns the value of the specified parameter as a Java
 749:    * <code>int</code>.
 750:    *
 751:    * @param name The name of the parameter to return.
 752:    * @return The parameter value as a <code>int</code>.
 753:    * @exception SQLException If an error occurs.
 754:    * @since 1.4
 755:    */
 756:   int getInt(String name) throws SQLException;
 757: 
 758:   /**
 759:    * This method returns the value of the specified parameter as a Java
 760:    * <code>long</code>.
 761:    *
 762:    * @param name The name of the parameter to return.
 763:    * @return The parameter value as a <code>long</code>.
 764:    * @exception SQLException If an error occurs.
 765:    * @since 1.4
 766:    */
 767:   long getLong(String name) throws SQLException;
 768: 
 769:   /**
 770:    * This method returns the value of the specified parameter as a Java
 771:    * <code>float</code>.
 772:    *
 773:    * @param name The name of the parameter to return.
 774:    * @return The parameter value as a <code>float</code>.
 775:    * @exception SQLException If an error occurs.
 776:    * @since 1.4
 777:    */
 778:   float getFloat(String name) throws SQLException;
 779: 
 780:   /**
 781:    * This method returns the value of the specified parameter as a Java
 782:    * <code>double</code>.
 783:    *
 784:    * @param name The name of the parameter to return.
 785:    * @return The parameter value as a <code>double</code>.
 786:    * @exception SQLException If an error occurs.
 787:    * @since 1.4
 788:    */
 789:   double getDouble(String name) throws SQLException;
 790: 
 791:   /**
 792:    * This method returns the value of the specified parameter as a Java
 793:    * <code>byte</code> array.
 794:    *
 795:    * @param name The name of the parameter to return.
 796:    * @return The parameter value as a <code>byte[]</code>.
 797:    * @exception SQLException If an error occurs.
 798:    * @since 1.4
 799:    */
 800:   byte[] getBytes(String name) throws SQLException;
 801: 
 802:   /**
 803:    * This method returns the value of the specified parameter as a Java
 804:    * <code>java.sql.Date</code>.
 805:    *
 806:    * @param name The name of the parameter to return.
 807:    * @return The parameter value as a <code>java.sql.Date</code>.
 808:    * @exception SQLException If an error occurs.
 809:    * @since 1.4
 810:    */
 811:   Date getDate(String name) throws SQLException;
 812: 
 813:   /**
 814:    * This method returns the value of the specified parameter as a Java
 815:    * <code>java.sql.Time</code>.
 816:    *
 817:    * @param name The name of the parameter to return.
 818:    * @return The parameter value as a <code>java.sql.Time</code>.
 819:    * @exception SQLException If an error occurs.
 820:    * @since 1.4
 821:    */
 822:   Time getTime(String name) throws SQLException;
 823: 
 824:   /**
 825:    * This method returns the value of the specified parameter as a Java
 826:    * <code>java.sql.Timestamp</code>.
 827:    *
 828:    * @param name The name of the parameter to return.
 829:    * @return The parameter value as a <code>java.sql.Timestamp</code>.
 830:    * @exception SQLException If an error occurs.
 831:    * @since 1.4
 832:    */
 833:   Timestamp getTimestamp(String name) throws SQLException;
 834: 
 835:   /**
 836:    * This method returns the value of the specified parameter as a Java
 837:    * <code>Object</code>.
 838:    *
 839:    * @param name The name of the parameter to return.
 840:    * @return The parameter value as a <code>Object</code>.
 841:    * @exception SQLException If an error occurs.
 842:    * @since 1.4
 843:    */
 844:   Object getObject(String name) throws SQLException;
 845: 
 846:   /**
 847:    * This method returns the value of the specified parameter as a Java
 848:    * <code>BigDecimal</code>.
 849:    *
 850:    * @param name The name of the parameter to return.
 851:    * @return The parameter value as a <code>BigDecimal</code>.
 852:    * @exception SQLException If an error occurs.
 853:    * @since 1.4
 854:    */
 855:   BigDecimal getBigDecimal(String name) throws SQLException;
 856: 
 857:   /**
 858:    * This method returns the value of the specified parameter as a Java
 859:    * <code>Object</code> using the specified mapping for conversion from
 860:    * SQL to Java types.
 861:    *
 862:    * @param name The name of the parameter to return.
 863:    * @param map The mapping to use for conversion from SQL to Java types.
 864:    * @return The parameter value as an <code>Object</code>.
 865:    * @exception SQLException If an error occurs.
 866:    * @since 1.4
 867:    */
 868:   Object getObject(String name, Map<String, Class<?>> map) throws SQLException;
 869: 
 870:   /**
 871:    * This method returns the value of the specified parameter as a Java
 872:    * <code>Ref</code>.
 873:    *
 874:    * @param name The name of the parameter to return.
 875:    * @return The parameter value as a <code>Ref</code>.
 876:    * @exception SQLException If an error occurs.
 877:    * @since 1.4
 878:    */
 879:   Ref getRef(String name) throws SQLException;
 880: 
 881:   /**
 882:    * This method returns the value of the specified parameter as a Java
 883:    * <code>Blob</code>.
 884:    *
 885:    * @param name The name of the parameter to return.
 886:    * @return The parameter value as a <code>Blob</code>.
 887:    * @exception SQLException If an error occurs.
 888:    * @since 1.4
 889:    */
 890:   Blob getBlob(String name) throws SQLException;
 891: 
 892:   /**
 893:    * This method returns the value of the specified parameter as a Java
 894:    * <code>Clob</code>.
 895:    *
 896:    * @param name The name of the parameter to return.
 897:    * @return The parameter value as a <code>Clob</code>.
 898:    * @exception SQLException If an error occurs.
 899:    * @since 1.4
 900:    */
 901:   Clob getClob(String name) throws SQLException;
 902: 
 903:   /**
 904:    * This method returns the value of the specified parameter as a Java
 905:    * <code>Array</code>.
 906:    *
 907:    * @param name The name of the parameter to return.
 908:    * @return The parameter value as a <code>Array</code>.
 909:    * @exception SQLException If an error occurs.
 910:    * @since 1.4
 911:    */
 912:   Array getArray(String name) throws SQLException;
 913: 
 914:   /**
 915:    * This method returns the value of the specified parameter as a Java
 916:    * <code>java.sql.Date</code>.
 917:    *
 918:    * @param name The name of the parameter to return.
 919:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 920:    * @return The parameter value as a <code>java.sql.Date</code>.
 921:    * @exception SQLException If an error occurs.
 922:    * @since 1.4
 923:    */
 924:   Date getDate(String name, Calendar cal) throws SQLException;
 925: 
 926:   /**
 927:    * This method returns the value of the specified parameter as a Java
 928:    * <code>java.sql.Time</code>.
 929:    *
 930:    * @param name The name of the parameter to return.
 931:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 932:    * @return The parameter value as a <code>java.sql.Time</code>.
 933:    * @exception SQLException If an error occurs.
 934:    * @since 1.4
 935:    */
 936:   Time getTime(String name, Calendar cal) throws SQLException;
 937: 
 938:   /**
 939:    * This method returns the value of the specified parameter as a Java
 940:    * <code>java.sql.Timestamp</code>.
 941:    *
 942:    * @param name The name of the parameter to return.
 943:    * @param cal The <code>Calendar</code> to use for timezone and locale.
 944:    * @return The parameter value as a <code>java.sql.Timestamp</code>.
 945:    * @exception SQLException If an error occurs.
 946:    * @since 1.4
 947:    */
 948:   Timestamp getTimestamp(String name, Calendar cal)
 949:     throws SQLException;
 950: 
 951:   /**
 952:    * This method returns the value of the specified parameter as a Java
 953:    * <code>java.net.URL</code>.
 954:    *
 955:    * @param name The name of the parameter to return.
 956:    * @return The parameter value as a <code>java.net.URL</code>.
 957:    * @exception SQLException If an error occurs.
 958:    * @since 1.4
 959:    */
 960:   URL getURL(String name) throws SQLException;
 961: }