CallableStatement.java 31.9 KB
Newer Older
Tom Tromey committed
1
/* CallableStatement.java -- A statement for calling stored procedures.
2
   Copyright (C) 1999, 2000, 2002, 2006 Free Software Foundation, Inc.
Tom Tromey committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
 
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
or based on this library.  If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so.  If you do not wish to do so, delete this
exception statement from your version. */

package java.sql;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Calendar;
import java.util.Map;

/**
 * This interface provides a mechanism for calling stored procedures.
 *
 * @author Aaron M. Renn (arenn@urbanophile.com)
 */
public interface CallableStatement extends PreparedStatement 
{
  /**
   * This method registers the specified parameter as an output parameter
   * of the specified SQL type.
   *
   * @param index The index of the parameter to register as output.
59
   * @param sqlType The SQL type value from <code>Types</code>.
Tom Tromey committed
60 61
   * @exception SQLException If an error occurs.
   */   
62
  void registerOutParameter(int index, int sqlType)
Tom Tromey committed
63 64 65 66 67 68 69
    throws SQLException;

  /**
   * This method registers the specified parameter as an output parameter
   * of the specified SQL type and scale.
   *
   * @param index The index of the parameter to register as output.
70
   * @param sqlType The SQL type value from <code>Types</code>.
Tom Tromey committed
71 72 73
   * @param scale The scale of the value that will be returned.
   * @exception SQLException If an error occurs.
   */   
74
  void registerOutParameter(int index, int sqlType, int scale)
Tom Tromey committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
    throws SQLException;

  /**
   * This method tests whether the value of the last parameter that was fetched
   * was actually a SQL NULL value.
   *
   * @return <code>true</code> if the last parameter fetched was a NULL,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
  boolean wasNull() throws SQLException;

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>String</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>String</code>.
   * @exception SQLException If an error occurs.
   */
95
  String getString(int index) throws SQLException;
Tom Tromey committed
96 97 98 99 100 101 102 103 104

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>boolean</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>boolean</code>.
   * @exception SQLException If an error occurs.
   */
105
  boolean getBoolean(int index) throws SQLException;
Tom Tromey committed
106 107 108 109 110 111 112 113 114

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>byte</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>byte</code>.
   * @exception SQLException If an error occurs.
   */
115
  byte getByte(int index) throws SQLException;
Tom Tromey committed
116 117 118 119 120 121 122 123 124

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>short</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>short</code>.
   * @exception SQLException If an error occurs.
   */
125
  short getShort(int index) throws SQLException;
Tom Tromey committed
126 127 128 129 130 131 132 133 134

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>int</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>int</code>.
   * @exception SQLException If an error occurs.
   */
135
  int getInt(int index) throws SQLException;
Tom Tromey committed
136 137 138 139 140 141 142 143 144

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>long</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>long</code>.
   * @exception SQLException If an error occurs.
   */
145
  long getLong(int index) throws SQLException;
Tom Tromey committed
146 147 148 149 150 151 152 153 154

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>float</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>float</code>.
   * @exception SQLException If an error occurs.
   */
155
  float getFloat(int index) throws SQLException;
Tom Tromey committed
156 157 158 159 160 161 162 163 164

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>double</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>double</code>.
   * @exception SQLException If an error occurs.
   */
165
  double getDouble(int index) throws SQLException;
Tom Tromey committed
166 167 168 169 170

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>BigDecimal</code>.
   *
171
   * @param index The index of the parameter to return.
Tom Tromey committed
172 173 174
   * @param scale The number of digits to the right of the decimal to return.
   * @return The parameter value as a <code>BigDecimal</code>.
   * @exception SQLException If an error occurs.
175 176
   * @deprecated Use getBigDecimal(int index)
   *             or getBigDecimal(String name) instead.
Tom Tromey committed
177
   */
178
  BigDecimal getBigDecimal(int index, int scale)
Tom Tromey committed
179 180 181 182 183 184
    throws SQLException;

  /**
   * This method returns the value of the specified parameter as a Java
   * byte array.
   *
185
   * @param index The index of the parameter to return.
Tom Tromey committed
186 187 188
   * @return The parameter value as a byte array
   * @exception SQLException If an error occurs.
   */
189
  byte[] getBytes(int index) throws SQLException;
Tom Tromey committed
190 191 192 193 194 195 196 197 198

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Date</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>java.sql.Date</code>.
   * @exception SQLException If an error occurs.
   */
199
  Date getDate(int index) throws SQLException;
Tom Tromey committed
200 201 202 203 204 205 206 207 208

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Time</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>java.sql.Time</code>.
   * @exception SQLException If an error occurs.
   */
209
  Time getTime(int index) throws SQLException;
Tom Tromey committed
210 211 212 213 214 215 216 217 218

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Timestamp</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>java.sql.Timestamp</code>.
   * @exception SQLException If an error occurs.
   */
219
  Timestamp getTimestamp(int index) throws SQLException;
Tom Tromey committed
220 221 222 223 224

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>Object</code>.
   *
225
   * @param index The index of the parameter to return.
Tom Tromey committed
226 227 228 229
   * @return The parameter value as an <code>Object</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
230
  Object getObject(int index) throws SQLException;
Tom Tromey committed
231 232 233 234 235

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>BigDecimal</code>.
   *
236
   * @param index The index of the parameter to return.
Tom Tromey committed
237 238 239 240
   * @return The parameter value as a <code>BigDecimal</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
241
  BigDecimal getBigDecimal(int index) throws SQLException;
Tom Tromey committed
242 243 244 245 246 247 248 249 250 251 252

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>Object</code>.
   *
   * @param index The index of the parameter to return.
   * @param map The mapping to use for conversion from SQL to Java types.
   * @return The parameter value as an <code>Object</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
253
  Object getObject(int index, Map<String, Class<?>> map) throws SQLException;
Tom Tromey committed
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>Ref</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>Ref</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
  Ref getRef(int index) throws SQLException;

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>Blob</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>Blob</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */   
  Blob getBlob(int index) throws SQLException;

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>Clob</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>Clob</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
  Clob getClob(int index) throws SQLException;

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>Array</code>.
   *
292
   * @param index The index of the parameter to return.
Tom Tromey committed
293 294 295 296 297 298 299 300 301 302
   * @return The parameter value as a <code>Array</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
  Array getArray(int index) throws SQLException;

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Date</code>.
   *
303
   * @param index The index of the parameter to return.
Tom Tromey committed
304 305 306 307 308
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @return The parameter value as a <code>java.sql.Date</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
309
  Date getDate(int index, Calendar cal) throws SQLException;
Tom Tromey committed
310 311 312 313 314

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Time</code>.
   *
315
   * @param index The index of the parameter to return.
Tom Tromey committed
316 317 318 319 320
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @return The parameter value as a <code>java.sql.Time</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
321
  Time getTime(int index, Calendar cal) throws SQLException;
Tom Tromey committed
322 323 324 325 326 327 328 329 330 331

  /**
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Timestamp</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>java.sql.Timestamp</code>.
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
332
  Timestamp getTimestamp(int index, Calendar cal)
Tom Tromey committed
333 334 335 336 337 338 339
    throws SQLException;

  /**
   * This method registers the specified parameter as an output parameter
   * of the specified SQL type.
   *
   * @param index The index of the parameter to register as output.
340 341
   * @param sqlType The SQL type value from <code>Types</code>.
   * @param typeName The user defined data type name.
Tom Tromey committed
342 343 344
   * @exception SQLException If an error occurs.
   * @since 1.2
   */
345
  void registerOutParameter(int index, int sqlType, String typeName)
Tom Tromey committed
346 347 348 349 350 351
    throws SQLException;

  /**
   * This method registers the specified parameter as an output parameter
   * of the specified SQL type.
   *
352
   * @param name The name of the parameter to register as output.
Tom Tromey committed
353 354 355 356
   * @param sqlType The SQL type value from <code>Types</code>.
   * @exception SQLException If an error occurs.
   * @since 1.4
   */
357
  void registerOutParameter(String name, int sqlType)
Tom Tromey committed
358 359 360 361 362 363 364
    throws SQLException;

  /**
   * This method registers the specified parameter as an output parameter
   * of the specified SQL type.  This version of registerOutParameter is used 
   * for NUMERIC or DECIMAL types.
   *
365
   * @param name The name of the parameter to register as output.
Tom Tromey committed
366 367 368 369 370
   * @param sqlType The SQL type value from <code>Types</code>.
   * @param scale Number of digits to the right of the decimal point.
   * @exception SQLException If an error occurs.
   * @since 1.4
   */
371
  void registerOutParameter(String name, int sqlType, int scale)
Tom Tromey committed
372 373 374 375 376 377 378 379 380
    throws SQLException;


  /**
   * This method registers the specified parameter as an output parameter
   * of the specified SQL type.  This version of registerOutParameter is used 
   * for user-named or REF types. If the type of the output parameter does
   * not have such a type, the typeName argument is ignored.
   *
381
   * @param name The name of the parameter to register as output.
Tom Tromey committed
382 383 384 385 386
   * @param sqlType The SQL type value from <code>Types</code>.
   * @param typeName The SQL structured type name.
   * @exception SQLException If an error occurs.
   * @since 1.4
   */
387
  void registerOutParameter(String name, int sqlType, String typeName) 
Tom Tromey committed
388 389 390
    throws SQLException;

  /**
391 392 393 394 395 396
   * This method returns the value of the specified parameter as a Java
   * <code>java.net.URL</code>.
   *
   * @param index The index of the parameter to return.
   * @return The parameter value as a <code>URL</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
397 398
   * @since 1.4
   */
399
  URL getURL(int index) throws SQLException;
Tom Tromey committed
400 401

  /**
402 403 404 405 406
   * This method sets the value of the specified parameter to the specified
   * <code>java.net.URL</code>
   * 
   * @param name The name of the parameter to set.
   * @param value The value the parameter.
Tom Tromey committed
407 408
   * @since 1.4
   */
409
  void setURL(String name, URL value) throws SQLException;
Tom Tromey committed
410 411

  /**
412 413 414 415 416 417 418
   * This method populates the specified parameter with a SQL NULL value
   * for the specified type.
   *
   * @param name The name of the parameter to set.
   * @param sqlType The SQL type identifier of the parameter from 
   *                <code>Types</code>
   * @exception SQLException If an error occurs.
Tom Tromey committed
419 420
   * @since 1.4
   */
421
  void setNull(String name, int sqlType) throws SQLException;
Tom Tromey committed
422 423

  /**
424 425 426 427 428 429
   * This method sets the specified parameter from the given Java
   * <code>boolean</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
430 431
   * @since 1.4
   */
432
  void setBoolean(String name, boolean value) throws SQLException;
Tom Tromey committed
433 434

  /**
435 436 437 438 439 440
   * This method sets the specified parameter from the given Java
   * <code>byte</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
441 442
   * @since 1.4
   */
443
  void setByte(String name, byte value) throws SQLException;
Tom Tromey committed
444 445

  /**
446 447 448 449 450 451
   * This method sets the specified parameter from the given Java
   * <code>short</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
452 453
   * @since 1.4
   */
454
  void setShort(String name, short value) throws SQLException;
Tom Tromey committed
455 456

  /**
457 458 459 460 461 462
   * This method sets the specified parameter from the given Java
   * <code>int</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
463 464
   * @since 1.4
   */
465
  void setInt(String name, int value) throws SQLException;
Tom Tromey committed
466 467

  /**
468 469 470 471 472 473
   * This method sets the specified parameter from the given Java
   * <code>long</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
474 475
   * @since 1.4
   */
476
  void setLong(String name, long value) throws SQLException;
Tom Tromey committed
477 478

  /**
479 480 481 482 483 484
   * This method sets the specified parameter from the given Java
   * <code>float</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
485 486
   * @since 1.4
   */
487
  void setFloat(String name, float value) throws SQLException;
Tom Tromey committed
488 489

  /**
490 491 492 493 494 495
   * This method sets the specified parameter from the given Java
   * <code>double</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
496 497
   * @since 1.4
   */
498
  void setDouble(String name, double value) throws SQLException;
Tom Tromey committed
499 500

  /**
501 502 503 504 505 506
   * This method sets the specified parameter from the given Java
   * <code>BigDecimal</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
507 508
   * @since 1.4
   */
509
  void setBigDecimal(String name, BigDecimal value)
Tom Tromey committed
510 511 512
    throws SQLException;

  /**
513 514 515 516 517 518
   * This method sets the specified parameter from the given Java
   * <code>String</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
519 520
   * @since 1.4
   */
521
  void setString(String name, String value) throws SQLException;
Tom Tromey committed
522 523

  /**
524 525 526 527 528 529
   * This method sets the specified parameter from the given Java
   * <code>byte</code> array value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
530 531
   * @since 1.4
   */
532
  void setBytes(String name, byte[] value) throws SQLException;
Tom Tromey committed
533 534

  /**
535 536 537 538 539 540
   * This method sets the specified parameter from the given Java
   * <code>java.sql.Date</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
541 542
   * @since 1.4
   */
543
  void setDate(String name, Date value) throws SQLException;
Tom Tromey committed
544 545

  /**
546 547 548 549 550 551
   * This method sets the specified parameter from the given Java
   * <code>java.sql.Time</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
552 553
   * @since 1.4
   */
554
  void setTime(String name, Time value) throws SQLException;
Tom Tromey committed
555 556

  /**
557 558 559 560 561 562
   * This method sets the specified parameter from the given Java
   * <code>java.sql.Timestamp</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
563 564
   * @since 1.4
   */
565
  void setTimestamp(String name, Timestamp value)
Tom Tromey committed
566 567 568
    throws SQLException;

  /**
569 570 571 572 573 574 575
   * This method sets the specified parameter from the given Java
   * ASCII <code>InputStream</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param stream The stream from which the parameter value is read.
   * @param count The number of bytes in the stream.
   * @exception SQLException If an error occurs.
Tom Tromey committed
576 577
   * @since 1.4
   */
578
  void setAsciiStream(String name, InputStream stream, int count)
Tom Tromey committed
579 580 581
      throws SQLException;

  /**
582 583 584 585 586 587 588
   * This method sets the specified parameter from the given Java
   * binary <code>InputStream</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param stream The stream from which the parameter value is read.
   * @param count The number of bytes in the stream.
   * @exception SQLException If an error occurs.
Tom Tromey committed
589 590
   * @since 1.4
   */
591
  void setBinaryStream(String name, InputStream stream, int count)
Tom Tromey committed
592 593 594
      throws SQLException;

  /**
595 596 597 598 599 600 601 602 603 604
   * This method sets the specified parameter from the given Java
   * <code>Object</code> value.  The specified SQL object type will be used.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @param sqlType The SQL type to use for the parameter, from 
   *                <code>Types</code>
   * @param scale The scale of the value, for numeric values only.
   * @exception SQLException If an error occurs.
   * @see Types
Tom Tromey committed
605 606
   * @since 1.4
   */
607
  void setObject(String name, Object value, int sqlType, int scale)
Tom Tromey committed
608 609 610
    throws SQLException;

  /**
611 612 613 614 615 616 617 618 619
   * This method sets the specified parameter from the given Java
   * <code>Object</code> value.  The specified SQL object type will be used.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @param sqlType The SQL type to use for the parameter, from 
   *                <code>Types</code>
   * @exception SQLException If an error occurs.
   * @see Types
Tom Tromey committed
620 621
   * @since 1.4
   */
622
  void setObject(String name, Object value, int sqlType)
Tom Tromey committed
623 624 625
    throws SQLException;

  /**
626 627 628 629 630 631 632
   * This method sets the specified parameter from the given Java
   * <code>Object</code> value.  The default object type to SQL type mapping
   * will be used.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @exception SQLException If an error occurs.
Tom Tromey committed
633 634
   * @since 1.4
   */
635
  void setObject(String name, Object value) throws SQLException;
Tom Tromey committed
636 637

  /**
638 639 640 641 642 643 644
   * This method sets the specified parameter from the given Java
   * character <code>Reader</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param reader The reader from which the parameter value is read.
   * @param count The number of characters in the stream.
   * @exception SQLException If an error occurs.
Tom Tromey committed
645 646
   * @since 1.4
   */
647
  void setCharacterStream(String name, Reader reader, int count)
Tom Tromey committed
648 649 650
    throws SQLException;

  /**
651 652 653 654 655 656 657
   * This method sets the specified parameter from the given Java
   * <code>java.sql.Date</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @exception SQLException If an error occurs.
Tom Tromey committed
658 659
   * @since 1.4
   */
660
  void setDate(String name, Date value, Calendar cal)
Tom Tromey committed
661 662 663
    throws SQLException;

  /**
664 665 666 667 668 669 670
   * This method sets the specified parameter from the given Java
   * <code>java.sql.Time</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @exception SQLException If an error occurs.
Tom Tromey committed
671 672
   * @since 1.4
   */
673
  void setTime(String name, Time value, Calendar cal)
Tom Tromey committed
674 675 676
    throws SQLException;

  /**
677 678 679 680 681 682 683
   * This method sets the specified parameter from the given Java
   * <code>java.sql.Timestamp</code> value.
   *
   * @param name The name of the parameter value to set.
   * @param value The value of the parameter.
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @exception SQLException If an error occurs.
Tom Tromey committed
684 685
   * @since 1.4
   */
686
  void setTimestamp(String name, Timestamp value, Calendar cal)
Tom Tromey committed
687 688 689
    throws SQLException;

  /**
690 691 692 693 694 695 696 697
   * This method populates the specified parameter with a SQL NULL value
   * for the specified type.
   *
   * @param name The name of the parameter to set.
   * @param sqlType The SQL type identifier of the parameter from
   *                <code>Types</code>
   * @param typeName The name of the data type, for user defined types.
   * @exception SQLException If an error occurs.
Tom Tromey committed
698 699
   * @since 1.4
   */
700
  void setNull(String name, int sqlType, String typeName)
Tom Tromey committed
701 702 703
    throws SQLException;

  /**
704 705 706 707 708 709
   * This method returns the value of the specified parameter as a Java
   * <code>String</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>String</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
710 711
   * @since 1.4
   */
712
  String getString(String name) throws SQLException;
Tom Tromey committed
713 714

  /**
715 716 717 718 719 720
   * This method returns the value of the specified parameter as a Java
   * <code>boolean</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>boolean</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
721 722
   * @since 1.4
   */
723
  boolean getBoolean(String name) throws SQLException;
Tom Tromey committed
724 725

  /**
726 727 728 729 730 731
   * This method returns the value of the specified parameter as a Java
   * <code>byte</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>byte</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
732 733
   * @since 1.4
   */
734
  byte getByte(String name) throws SQLException;
Tom Tromey committed
735 736

  /**
737 738 739 740 741 742
   * This method returns the value of the specified parameter as a Java
   * <code>short</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>short</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
743 744
   * @since 1.4
   */
745
  short getShort(String name) throws SQLException;
Tom Tromey committed
746 747

  /**
748 749 750 751 752 753
   * This method returns the value of the specified parameter as a Java
   * <code>int</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>int</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
754 755
   * @since 1.4
   */
756
  int getInt(String name) throws SQLException;
Tom Tromey committed
757 758

  /**
759 760 761 762 763 764
   * This method returns the value of the specified parameter as a Java
   * <code>long</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>long</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
765 766
   * @since 1.4
   */
767
  long getLong(String name) throws SQLException;
Tom Tromey committed
768 769

  /**
770 771 772 773 774 775
   * This method returns the value of the specified parameter as a Java
   * <code>float</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>float</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
776 777
   * @since 1.4
   */
778
  float getFloat(String name) throws SQLException;
Tom Tromey committed
779 780

  /**
781 782 783 784 785 786
   * This method returns the value of the specified parameter as a Java
   * <code>double</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>double</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
787 788
   * @since 1.4
   */
789
  double getDouble(String name) throws SQLException;
Tom Tromey committed
790 791

  /**
792 793 794 795 796 797
   * This method returns the value of the specified parameter as a Java
   * <code>byte</code> array.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>byte[]</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
798 799
   * @since 1.4
   */
800
  byte[] getBytes(String name) throws SQLException;
Tom Tromey committed
801 802

  /**
803 804 805 806 807 808
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Date</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>java.sql.Date</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
809 810
   * @since 1.4
   */
811
  Date getDate(String name) throws SQLException;
Tom Tromey committed
812 813

  /**
814 815 816 817 818 819
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Time</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>java.sql.Time</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
820 821
   * @since 1.4
   */
822
  Time getTime(String name) throws SQLException;
Tom Tromey committed
823 824

  /**
825 826 827 828 829 830
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Timestamp</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>java.sql.Timestamp</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
831 832
   * @since 1.4
   */
833
  Timestamp getTimestamp(String name) throws SQLException;
Tom Tromey committed
834 835

  /**
836 837 838 839 840 841
   * This method returns the value of the specified parameter as a Java
   * <code>Object</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>Object</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
842 843
   * @since 1.4
   */
844
  Object getObject(String name) throws SQLException;
Tom Tromey committed
845 846

  /**
847 848 849 850 851 852
   * This method returns the value of the specified parameter as a Java
   * <code>BigDecimal</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>BigDecimal</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
853 854
   * @since 1.4
   */
855
  BigDecimal getBigDecimal(String name) throws SQLException;
Tom Tromey committed
856 857

  /**
858 859 860 861 862 863 864 865
   * This method returns the value of the specified parameter as a Java
   * <code>Object</code> using the specified mapping for conversion from
   * SQL to Java types.
   *
   * @param name The name of the parameter to return.
   * @param map The mapping to use for conversion from SQL to Java types.
   * @return The parameter value as an <code>Object</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
866 867
   * @since 1.4
   */
868
  Object getObject(String name, Map<String, Class<?>> map) throws SQLException;
Tom Tromey committed
869 870

  /**
871 872 873 874 875 876
   * This method returns the value of the specified parameter as a Java
   * <code>Ref</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>Ref</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
877 878
   * @since 1.4
   */
879
  Ref getRef(String name) throws SQLException;
Tom Tromey committed
880 881

  /**
882 883 884 885 886 887
   * This method returns the value of the specified parameter as a Java
   * <code>Blob</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>Blob</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
888 889
   * @since 1.4
   */
890
  Blob getBlob(String name) throws SQLException;
Tom Tromey committed
891 892

  /**
893 894 895 896 897 898
   * This method returns the value of the specified parameter as a Java
   * <code>Clob</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>Clob</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
899 900
   * @since 1.4
   */
901
  Clob getClob(String name) throws SQLException;
Tom Tromey committed
902 903

  /**
904 905 906 907 908 909
   * This method returns the value of the specified parameter as a Java
   * <code>Array</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>Array</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
910 911
   * @since 1.4
   */
912
  Array getArray(String name) throws SQLException;
Tom Tromey committed
913 914

  /**
915 916 917 918 919 920 921
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Date</code>.
   *
   * @param name The name of the parameter to return.
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @return The parameter value as a <code>java.sql.Date</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
922 923
   * @since 1.4
   */
924
  Date getDate(String name, Calendar cal) throws SQLException;
Tom Tromey committed
925 926

  /**
927 928 929 930 931 932 933
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Time</code>.
   *
   * @param name The name of the parameter to return.
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @return The parameter value as a <code>java.sql.Time</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
934 935
   * @since 1.4
   */
936
  Time getTime(String name, Calendar cal) throws SQLException;
Tom Tromey committed
937 938

  /**
939 940 941 942 943 944 945
   * This method returns the value of the specified parameter as a Java
   * <code>java.sql.Timestamp</code>.
   *
   * @param name The name of the parameter to return.
   * @param cal The <code>Calendar</code> to use for timezone and locale.
   * @return The parameter value as a <code>java.sql.Timestamp</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
946 947
   * @since 1.4
   */
948
  Timestamp getTimestamp(String name, Calendar cal)
Tom Tromey committed
949 950 951
    throws SQLException;

  /**
952 953 954 955 956 957
   * This method returns the value of the specified parameter as a Java
   * <code>java.net.URL</code>.
   *
   * @param name The name of the parameter to return.
   * @return The parameter value as a <code>java.net.URL</code>.
   * @exception SQLException If an error occurs.
Tom Tromey committed
958 959
   * @since 1.4
   */
960
  URL getURL(String name) throws SQLException;
Tom Tromey committed
961
}