-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCallableStatement.java
More file actions
1621 lines (1507 loc) · 62.2 KB
/
Copy pathCallableStatement.java
File metadata and controls
1621 lines (1507 loc) · 62.2 KB
1
2
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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;
/**
* An interface used to call <i>Stored Procedures</i>.
* <p>
* The JDBC API provides an SQL escape syntax allowing <i>Stored Procedures</i>
* to be called in a standard way for all databases. The JDBC escape syntax has
* two forms. One form includes a result parameter. The second form does not
* include a result parameter. Where the result parameter is used, it must be
* declared as an {@code OUT} parameter. Other parameters can be declared as
* {@code IN}, {@code OUT}, or {@code INOUT}. Parameters are referenced either by
* name or by a numerical index starting at 1.
* <p>
* The correct syntax is:
* <dd>
* <dl>
* { ?= call <procedurename> [( [parameter1,parameter2,...] )] }
* </dl>
* <dl>
* { call <procedurename> [( [parameter1,parameter2,...] )] }
* </dl>
* </code></dd>
* {@code IN} parameters are set before calling the procedure,
* using the setter methods which are inherited from {@code PreparedStatement}.
* For {@code OUT} parameters, their type must be registered before executing
* the stored procedure. The values are retrieved using the getter methods
* defined in the {@code CallableStatement} interface.
* <p>
* {@code CallableStatement}s can return one or more {@code ResultSets}. In the
* event that multiple {@code ResultSets} are returned, they are accessed using
* the methods inherited from the {@code Statement} interface.
*/
public interface CallableStatement extends PreparedStatement {
/**
* Gets the value of a specified JDBC {@code ARRAY} parameter as a
* {@code java.sql.Array}.
*
* @param parameterIndex
* the parameter index, where the first parameter has
* index 1.
* @return a {@code java.sql.Array} containing the parameter value.
* @throws SQLException
* if a database error occurs.
*/
public Array getArray(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code ARRAY} parameter as a {@code
* java.sql.Array}.
*
* @param parameterName
* the desired parameter's name.
* @return a {@code java.sql.Array} containing the parameter's value.
* @throws SQLException
* if there is a problem accessing the database.
*/
public Array getArray(String parameterName) throws SQLException;
/**
* Returns a new {@link BigDecimal} representation of the JDBC {@code
* NUMERIC} parameter specified by the input index.
*
* @param parameterIndex
* the parameter number index where the first parameter has index
* 1.
* @return a {@code java.math.BigDecimal} representing the value of the
* specified parameter. The value {@code null} is returned if
* the parameter in question is an SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public BigDecimal getBigDecimal(int parameterIndex) throws SQLException;
/**
* Returns a new {@link BigDecimal} representation of the JDBC {@code
* NUMERIC} parameter specified by the input index. The number of digits
* after the decimal point is specified by {@code scale}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @param scale
* the number of digits after the decimal point to get.
* @return a {@code java.math.BigDecimal} representing the value of the
* specified parameter. The value {@code null} is returned if
* the parameter in question is an SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @deprecated Use {@link #getBigDecimal(int)} or
* {@link #getBigDecimal(String)}
*/
@Deprecated
public BigDecimal getBigDecimal(int parameterIndex, int scale)
throws SQLException;
/**
* Returns a new {@link BigDecimal} representation of the JDBC {@code
* NUMERIC} parameter specified by the input name.
*
* @param parameterName
* the desired parameter's name.
* @return a {@code java.math.BigDecimal} representing the value of the
* specified parameter. The value {@code null} is returned if
* the parameter in question is an SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public BigDecimal getBigDecimal(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code BLOB} parameter as a {@code
* java.sql.Blob}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return a {@code java.sql.Blob} representing the value of the
* specified parameter. The value {@code null} is returned if
* the parameter in question is an SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public Blob getBlob(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code BLOB} parameter as a {@code
* java.sql.Blob}.
*
* @param parameterName
* the desired parameter's name.
* @return a {@code java.sql.Blob} representing the value of the
* specified parameter. The value {@code null} is returned if
* the parameter in question is an SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public Blob getBlob(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code BIT} parameter as a boolean.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return a {@code boolean} representing the parameter value. {@code false}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public boolean getBoolean(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code BIT} parameter as a {@code
* boolean}.
*
* @param parameterName
* the desired parameter's name.
* @return a {@code boolean} representation of the value of the parameter.
* {@code false} is returned if the SQL value is {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public boolean getBoolean(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code TINYINT} parameter as a {@code
* byte}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return a {@code byte} representation of the value of the parameter.
* {@code 0} is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public byte getByte(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code TINYINT} parameter as a Java
* {@code byte}.
*
* @param parameterName
* the desired parameter's name.
* @return a {@code byte} representation of the value of the parameter.
* {@code 0} is returned if the SQL value is {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public byte getByte(String parameterName) throws SQLException;
/**
* Returns a byte array representation of the indexed JDBC {@code BINARY} or
* {@code VARBINARY} parameter.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return an array of bytes giving the value of the parameter. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public byte[] getBytes(int parameterIndex) throws SQLException;
/**
* Returns a byte array representation of the named JDBC {@code BINARY} or
* {@code VARBINARY} parameter.
*
* @param parameterName
* the name of the parameter.
* @return an array of bytes giving the value of the parameter. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public byte[] getBytes(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code CLOB} parameter as a {@code
* java.sql.Clob}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return a {@code java.sql.Clob} representing the value of the
* parameter. {@code null} is returned if the value is SQL
* {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Clob
*/
public Clob getClob(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code CLOB} parameter as a {@code
* java.sql.Clob}.
*
* @param parameterName
* the name of the parameter.
* @return a {@code java.sql.Clob} with the value of the parameter. {@code
* null} is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Clob
*/
public Clob getClob(String parameterName) throws SQLException;
/**
* Gets the value of the specified JDBC {@code DATE} parameter as a {@code
* java.sql.Date}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the {@code java.sql.Date} representing the parameter's value.
* {@code null} is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Date
*/
public Date getDate(int parameterIndex) throws SQLException;
/**
* Gets the value of the specified JDBC {@code DATE} parameter as a {@code
* java.sql.Date}, using the specified {@code Calendar} to construct the date.
* <p>
* The JDBC driver uses the calendar to create the Date using a particular
* timezone and locale. The default behavior of the driver is to use the Java
* virtual machine default settings.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @param cal
* the {@code Calendar} to use to construct the date
* @return the {@code java.sql.Date} giving the parameter's value. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Date
*/
public Date getDate(int parameterIndex, Calendar cal) throws SQLException;
/**
* Gets the value of the specified JDBC {@code DATE} parameter as a {@code
* java.sql.Date}.
*
* @param parameterName
* the name of the desired parameter.
* @return the {@code java.sql.Date} giving the parameter's value. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Date
*/
public Date getDate(String parameterName) throws SQLException;
/**
* Gets the value of the specified JDBC {@code DATE} parameter as a {@code
* java.sql.Date}, using the specified {@code Calendar} to construct the date.
* <p>
* The JDBC driver uses the calendar to create the date using a particular
* timezone and locale. The default behavior of the driver is to use the Java
* virtual machine default settings.
*
* @param parameterName
* the name of the desired parameter.
* @param cal
* used for creating the returned {@code Date}.
* @return the {@code java.sql.Date} giving the parameter's value. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Date
*/
public Date getDate(String parameterName, Calendar cal) throws SQLException;
/**
* Gets the value of the specified JDBC {@code DOUBLE} parameter as a
* {@code double}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the parameter's value as a {@code double}. {@code 0.0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public double getDouble(int parameterIndex) throws SQLException;
/**
* Gets the value of the specified JDBC {@code DOUBLE} parameter as a
* {@code double}.
*
* @param parameterName
* the name of the desired parameter.
* @return the parameter's value as a {@code double}. {@code 0.0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if there is a problem accessing the database.
*/
public double getDouble(String parameterName) throws SQLException;
/**
* Gets the value of the specified JDBC {@code FLOAT} parameter as a {@code
* float}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the parameter's value as a {@code float}. {@code 0.0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public float getFloat(int parameterIndex) throws SQLException;
/**
* Gets the value of the specified JDBC {@code FLOAT} parameter as a Java
* {@code float}.
*
* @param parameterName
* the name of the desired parameter.
* @return the parameter's value as a {@code float}. {@code 0.0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if there is a problem accessing the database.
*/
public float getFloat(String parameterName) throws SQLException;
/**
* Gets the value of the specified JDBC {@code INTEGER} parameter as an
* {@code int}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the {@code int} giving the parameter's value. {@code 0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public int getInt(int parameterIndex) throws SQLException;
/**
* Gets the value of the specified JDBC {@code INTEGER} parameter as an
* {@code int}.
*
* @param parameterName
* the name of the desired parameter.
* @return the {@code int} giving the parameter's value. {@code 0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public int getInt(String parameterName) throws SQLException;
/**
* Gets the value of the specified JDBC {@code BIGINT} parameter as a
* {@code long}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the {@code long} giving the parameter's value. {@code 0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public long getLong(int parameterIndex) throws SQLException;
/**
* Gets the value of the specified JDBC {@code BIGINT} parameter as a
* {@code long}.
*
* @param parameterName
* the name of the desired parameter.
* @return the {@code long} giving the parameter's value. {@code 0}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public long getLong(String parameterName) throws SQLException;
/**
* Gets the value of the specified parameter as a Java {@code Object}.
* <p>
* The object type returned is the JDBC type registered for the parameter
* with a {@code registerOutParameter} call. If a parameter was registered
* as a {@code java.sql.Types.OTHER} then it may hold abstract types that
* are particular to the connected database.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return an Object holding the value of the parameter.
* @throws SQLException
* if a database error occurs.
*/
public Object getObject(int parameterIndex) throws SQLException;
/**
* Gets the value of the specified parameter as an {@code Object}. The
* {@code Map} gives the correspondence between SQL types and Java classes.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @param map
* the {@code Map} giving the correspondence between SQL
* types and Java classes.
* @return an Object holding the value of the parameter.
* @throws SQLException
* if a database error occurs.
*/
public Object getObject(int parameterIndex, Map<String, Class<?>> map)
throws SQLException;
/**
* Gets the value of the specified parameter as an {@code Object}.
* <p>
* The object type returned is the JDBC type that was registered for
* the parameter by an earlier call to {@link #registerOutParameter}.
* If a parameter was registered as a {@code java.sql.Types.OTHER}
* then it may hold abstract types that are particular to the
* connected database.
*
* @param parameterName
* the parameter name.
* @return the Java {@code Object} representation of the value of the
* parameter.
* @throws SQLException
* if there is a problem accessing the database.
*/
public Object getObject(String parameterName) throws SQLException;
/**
* Gets the value of a specified parameter as an {@code Object}. The
* actual return type is determined by the {@code Map} parameter which
* gives the correspondence between SQL types and Java classes.
*
* @param parameterName
* the parameter name.
* @param map
* the {@code Map} of SQL types to their Java counterparts
* @return an {@code Object} holding the value of the parameter.
* @throws SQLException
* if there is a problem accessing the database.
*/
public Object getObject(String parameterName, Map<String, Class<?>> map)
throws SQLException;
/**
* Gets the value of a specified SQL {@code REF(<structured type>)}
* parameter as a {@code java.sql.Ref}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return a {@code java.sql.Ref} with the parameter value. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public Ref getRef(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified SQL {@code REF(<structured type>)}
* parameter as a {@code java.sql.Ref}.
*
* @param parameterName
* the desired parameter's name.
* @return the parameter's value in the form of a {@code
* java.sql.Ref}. A {@code null} reference is returned if the
* parameter's value is SQL {@code NULL}.
* @throws SQLException
* if there is a problem accessing the database.
* @see Ref
*/
public Ref getRef(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code SMALLINT} parameter as a
* {@code short}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the parameter's value as a {@code short}. 0 is returned
* if the parameter's value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
*/
public short getShort(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code SMALLINT} parameter as a
* {@code short}.
*
* @param parameterName
* the desired parameter's name.
* @return the parameter's value as a {@code short}. 0 is returned
* if the parameter's value is SQL {@code NULL}.
* @throws SQLException
* if there is a problem accessing the database.
*/
public short getShort(String parameterName) throws SQLException;
/**
* Returns the indexed parameter's value as a {@code String}. The
* parameter value must be one of the JDBC types {@code CHAR},
* {@code VARCHAR} or {@code LONGVARCHAR}.
* <p>
* The {@code String} corresponding to a {@code CHAR} of fixed length
* will be of identical length to the value in the database inclusive
* of padding characters.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the parameter's value as a {@code String}. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if there is a problem accessing the database.
*/
public String getString(int parameterIndex) throws SQLException;
/**
* Returns the named parameter's value as a string. The parameter value must
* be one of the JDBC types {@code CHAR}, {@code VARCHAR} or {@code
* LONGVARCHAR}.
* <p>
* The string corresponding to a {@code CHAR} of fixed length will be of
* identical length to the value in the database inclusive of padding
* characters.
*
* @param parameterName
* the desired parameter's name.
* @return the parameter's value as a {@code String}. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if there is a problem accessing the database.
*/
public String getString(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code TIME} parameter as a {@code
* java.sql.Time}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return the parameter's value as a {@code java.sql.Time}.
* {@code null} is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Time
*/
public Time getTime(int parameterIndex) throws SQLException;
/**
* Gets the value of a specified JDBC {@code TIME} parameter as a {@code
* java.sql.Time}, using the supplied {@code Calendar} to construct the
* time. The JDBC driver uses the calendar to handle specific timezones
* and locales in order to determine {@code Time}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @param cal
* the calendar to use in constructing {@code Time}.
* @return the parameter's value as a {@code java.sql.Time}.
* {@code null} is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Time
* @see java.util.Calendar
*/
public Time getTime(int parameterIndex, Calendar cal) throws SQLException;
/**
* Gets the value of a specified JDBC {@code TIME} parameter as a {@code
* java.sql.Time}.
*
* @param parameterName
* the name of the desired parameter.
* @return a new {@code java.sql.Time} with the parameter's value. A {@code
* null} reference is returned for an SQL value of {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Time
*/
public Time getTime(String parameterName) throws SQLException;
/**
* Gets the value of a specified JDBC {@code TIME} parameter as a {@code
* java.sql.Time}, using the supplied {@code Calendar} to construct
* the time. The JDBC driver uses the calendar to handle specific
* timezones and locales when creating {@code Time}.
*
* @param parameterName
* the name of the desired parameter.
* @param cal
* used for creating the returned {@code Time}
* @return a new {@code java.sql.Time} with the parameter's value. A {@code
* null} reference is returned for an SQL value of {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see Time
* @see java.util.Calendar
*/
public Time getTime(String parameterName, Calendar cal) throws SQLException;
/**
* Returns the indexed parameter's {@code TIMESTAMP} value as a {@code
* java.sql.Timestamp}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1
* @return the parameter's value as a {@code java.sql.Timestamp}. A
* {@code null} reference is returned for an SQL value of {@code
* NULL}.
* @throws SQLException
* if a database error occurs.
* @see Timestamp
*/
public Timestamp getTimestamp(int parameterIndex) throws SQLException;
/**
* Returns the indexed parameter's {@code TIMESTAMP} value as a {@code
* java.sql.Timestamp}. The JDBC driver uses the supplied {@code Calendar}
* to handle specific timezones and locales when creating the result.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1
* @param cal
* used for creating the returned {@code Timestamp}
* @return the parameter's value as a {@code java.sql.Timestamp}. A
* {@code null} reference is returned for an SQL value of {@code
* NULL}.
* @throws SQLException
* if a database error occurs.
* @see Timestamp
*/
public Timestamp getTimestamp(int parameterIndex, Calendar cal)
throws SQLException;
/**
* Returns the named parameter's {@code TIMESTAMP} value as a {@code
* java.sql.Timestamp}.
*
* @param parameterName
* the name of the desired parameter.
* @return the parameter's value as a {@code java.sql.Timestamp}. A
* {@code null} reference is returned for an SQL value of {@code
* NULL}.
* @throws SQLException
* if a database error occurs.
* @see Timestamp
*/
public Timestamp getTimestamp(String parameterName) throws SQLException;
/**
* Returns the indexed parameter's {@code TIMESTAMP} value as a {@code
* java.sql.Timestamp}. The JDBC driver uses the supplied {@code Calendar}
* to handle specific timezones and locales when creating the result.
*
* @param parameterName
* the name of the desired parameter.
* @param cal
* used for creating the returned {@code Timestamp}
* @return the parameter's value as a {@code java.sql.Timestamp}. A
* {@code null} reference is returned for an SQL value of {@code
* NULL}.
* @throws SQLException
* if a database error occurs.
* @see Timestamp
*/
public Timestamp getTimestamp(String parameterName, Calendar cal)
throws SQLException;
/**
* Gets the value of a specified JDBC {@code DATALINK} parameter as a
* {@code java.net.URL}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1.
* @return a {@code URL} giving the parameter's value. {@code null}
* is returned if the value is SQL {@code NULL}.
* @throws SQLException
* if a database error occurs.
* @see java.net.URL
*/
public URL getURL(int parameterIndex) throws SQLException;
/**
* Returns the named parameter's JDBC {@code DATALINK} value in a new Java
* {@code java.net.URL}.
*
* @param parameterName
* the name of the desired parameter.
* @return a new {@code java.net.URL} encapsulating the parameter value. A
* {@code null} reference is returned for an SQL value of {@code
* NULL}.
* @throws SQLException
* if a database error occurs.
* @see java.net.URL
*/
public URL getURL(String parameterName) throws SQLException;
/**
* Defines the type of a specified {@code OUT} parameter. All {@code OUT}
* parameters must have their type defined before a stored procedure is
* executed.
* <p>
* The type supplied in the {@code sqlType} parameter fixes the
* type that will be returned by the getter methods of
* {@code CallableStatement}.
* If a database specific type is expected for a parameter, the Type {@code
* java.sql.Types.OTHER} should be used. Note that there is another variant
* of this method for User Defined Types or a {@code REF} type.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1
* @param sqlType
* the JDBC type as defined by {@code java.sql.Types}. The JDBC
* types {@code NUMERIC} and {@code DECIMAL} should be defined
* using {@link #registerOutParameter(int, int, int)}.
* @throws SQLException
* if a database error occurs.
* @see Types
*/
public void registerOutParameter(int parameterIndex, int sqlType)
throws SQLException;
/**
* Defines the Type of a specified {@code OUT} parameter. All {@code OUT}
* parameters must have their type defined before a stored procedure is
* executed. This version of the {@code registerOutParameter} method, which
* has a scale parameter, should be used for the JDBC types {@code NUMERIC}
* and {@code DECIMAL}, where there is a need to specify the number of
* digits expected after the decimal point.
* <p>
* The type supplied in the {@code sqlType} parameter fixes the
* type that will be returned by the getter methods of
* {@code CallableStatement}.
*
* @param parameterIndex
* the parameter number index, where the first parameter has
* index 1
* @param sqlType
* the JDBC type as defined by {@code java.sql.Types}.
* @param scale
* the number of digits after the decimal point. Must be greater
* than or equal to 0.
* @throws SQLException
* if a database error occurs.
* @see Types
*/
public void registerOutParameter(int parameterIndex, int sqlType, int scale)
throws SQLException;
/**
* Defines the Type of a specified {@code OUT} parameter. This variant
* of the method is designed for use with parameters that are
* <i>User Defined Types</i> (UDT) or a {@code REF} type, although it
* can be used for any type.
*
* @param paramIndex
* the parameter number index, where the first parameter has
* index 1.
* @param sqlType
* a JDBC type expressed as a constant from {@link Types}.
* @param typeName
* an SQL type name. For a {@code REF} type, this name should be
* the fully qualified name of the referenced type.
* @throws SQLException
* if a database error occurs.
* @see Ref
*/
public void registerOutParameter(int paramIndex, int sqlType,
String typeName) throws SQLException;
/**
* Defines the Type of a specified {@code OUT} parameter. All OUT parameters
* must have their Type defined before a stored procedure is executed.
* <p>
* The type supplied in the {@code sqlType} parameter fixes the
* type that will be returned by the getter methods of
* {@code CallableStatement}.
* If a database-specific type is expected for a parameter, the Type {@code
* java.sql.Types.OTHER} should be used. Note that there is another variant
* of this method for User Defined Types or a {@code REF} type.
*
* @param parameterName
* the parameter name.
* @param sqlType
* a JDBC type expressed as a constant from {@link Types}. Types
* {@code NUMERIC} and {@code DECIMAL} should be defined using
* the variant of this method that takes a {@code scale}
* parameter.
* @throws SQLException
* if a database error occurs.
*/
public void registerOutParameter(String parameterName, int sqlType)
throws SQLException;
/**
* Defines the Type of a specified {@code OUT} parameter. All {@code OUT}
* parameters must have their Type defined before a stored procedure is
* executed. This version of the {@code registerOutParameter} method, which
* has a scale parameter, should be used for the JDBC types {@code NUMERIC}
* and {@code DECIMAL}, where there is a need to specify the number of
* digits expected after the decimal point.
* <p>
* The type supplied in the {@code sqlType} parameter fixes the
* type that will be returned by the getter methods of
* {@code CallableStatement}.
*
* @param parameterName
* the parameter name.
* @param sqlType
* a JDBC type expressed as a constant from {@link Types}.
* @param scale
* the number of digits after the decimal point. Must be greater
* than or equal to 0.
* @throws SQLException
* if a database error occurs.
*/
public void registerOutParameter(String parameterName, int sqlType,
int scale) throws SQLException;
/**
* Defines the Type of a specified {@code OUT} parameter. This variant of
* the method is designed for use with parameters that are <i>User Defined
* Types</i> (UDT) or a {@code REF} type, although it can be used for any
* type.
*
* @param parameterName
* the parameter name
* @param sqlType
* a JDBC type expressed as a constant from {@link Types}
* @param typeName
* the fully qualified name of an SQL structured type. For a
* {@code REF} type, this name should be the fully qualified name
* of the referenced type.
* @throws SQLException
* if a database error occurs.
*/
public void registerOutParameter(String parameterName, int sqlType,
String typeName) throws SQLException;
/**
* Sets the value of a specified parameter to the content of a supplied
* {@code InputStream}, which has a specified number of bytes.
* <p>
* This is a good method for setting an SQL {@code LONGVARCHAR} parameter
* where the length of the data is large. Data is read from the {@code
* InputStream} until end-of-file is reached or the specified number of
* bytes is copied.
*
* @param parameterName
* the parameter name
* @param theInputStream
* the ASCII input stream carrying the data to update the
* parameter with.
* @param length
* the number of bytes in the {@code InputStream} to copy to the
* parameter.
* @throws SQLException
* if a database error occurs.
*/
public void setAsciiStream(String parameterName,
InputStream theInputStream, int length) throws SQLException;
/**
* Sets the value of a specified parameter to a supplied {@code
* java.math.BigDecimal} value.
*
* @param parameterName
* the name of the parameter.
* @param theBigDecimal
* the {@code java.math.BigInteger} value to set.
* @throws SQLException
* if a database error occurs.
*/
public void setBigDecimal(String parameterName, BigDecimal theBigDecimal)
throws SQLException;
/**
* Sets the value of a specified parameter to the content of a supplied
* binary {@code InputStream}, which has a specified number of bytes.
* <p>
* Use this method when a large amount of data needs to be set into a
* {@code LONGVARBINARY} parameter.
*
* @param parameterName
* the name of the parameter.
* @param theInputStream
* the binary {@code InputStream} carrying the data to update the
* parameter.
* @param length
* the number of bytes in the {@code InputStream} to copy to the
* parameter.
* @throws SQLException
* if a database error occurs.
*/
public void setBinaryStream(String parameterName,
InputStream theInputStream, int length) throws SQLException;
/**
* Sets the value of a specified parameter to a supplied {@code boolean}
* value.
*
* @param parameterName
* the parameter name.
* @param theBoolean
* the new value with which to update the parameter.
* @throws SQLException
* if a database error occurs.
*/
public void setBoolean(String parameterName, boolean theBoolean)
throws SQLException;
/**
* Sets the value of a specified parameter to a supplied {@code byte} value.
*
* @param parameterName
* the parameter name.