source: trunk/src/gcc/libjava/java/sql/CallableStatement.java@ 192

Last change on this file since 192 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 14.0 KB
Line 
1/* CallableStatement.java -- A statement for calling stored procedures.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package java.sql;
40
41import java.io.InputStream;
42import java.io.Reader;
43import java.math.BigDecimal;
44import java.util.Calendar;
45import java.util.Map;
46
47/**
48 * This interface provides a mechanism for calling stored procedures.
49 *
50 * @author Aaron M. Renn ([email protected])
51 */
52public interface CallableStatement extends PreparedStatement
53{
54
55/*************************************************************************/
56
57/**
58 * This method tests whether the value of the last parameter that was fetched
59 * was actually a SQL NULL value.
60 *
61 * @return <code>true</code> if the last parameter fetched was a NULL,
62 * <code>false</code> otherwise.
63 *
64 * @exception SQLException If an error occurs.
65 */
66public abstract boolean
67wasNull() throws SQLException;
68
69/*************************************************************************/
70
71/**
72 * This method returns the value of the specified parameter as a Java
73 * <code>String</code>.
74 *
75 * @param index The index of the parameter to return.
76 *
77 * @return The parameter value as a <code>String</code>.
78 *
79 * @exception SQLException If an error occurs.
80 */
81public abstract String
82getString(int index) throws SQLException;
83
84/*************************************************************************/
85
86/**
87 * This method returns the value of the specified parameter as a Java
88 * <code>Object</code>.
89 *
90 * @param index The index of the parameter to return.
91 *
92 * @return The parameter value as an <code>Object</code>.
93 *
94 * @exception SQLException If an error occurs.
95 */
96public abstract Object
97getObject(int index) throws SQLException;
98
99/*************************************************************************/
100
101/**
102 * This method returns the value of the specified parameter as a Java
103 * <code>Object</code>.
104 *
105 * @param index The index of the parameter to return.
106 * @param map The mapping to use for conversion from SQL to Java types.
107 *
108 * @return The parameter value as an <code>Object</code>.
109 *
110 * @exception SQLException If an error occurs.
111 */
112public abstract Object
113getObject(int index, Map map) throws SQLException;
114
115/*************************************************************************/
116
117/**
118 * This method returns the value of the specified parameter as a Java
119 * <code>boolean</code>.
120 *
121 * @param index The index of the parameter to return.
122 *
123 * @return The parameter value as a <code>boolean</code>.
124 *
125 * @exception SQLException If an error occurs.
126 */
127public abstract boolean
128getBoolean(int index) throws SQLException;
129
130/*************************************************************************/
131
132/**
133 * This method returns the value of the specified parameter as a Java
134 * <code>byte</code>.
135 *
136 * @param index The index of the parameter to return.
137 *
138 * @return The parameter value as a <code>byte</code>.
139 *
140 * @exception SQLException If an error occurs.
141 */
142public abstract byte
143getByte(int index) throws SQLException;
144
145/*************************************************************************/
146
147/**
148 * This method returns the value of the specified parameter as a Java
149 * <code>short</code>.
150 *
151 * @param index The index of the parameter to return.
152 *
153 * @return The parameter value as a <code>short</code>.
154 *
155 * @exception SQLException If an error occurs.
156 */
157public abstract short
158getShort(int index) throws SQLException;
159
160/*************************************************************************/
161
162/**
163 * This method returns the value of the specified parameter as a Java
164 * <code>int</code>.
165 *
166 * @param index The index of the parameter to return.
167 *
168 * @return The parameter value as a <code>int</code>.
169 *
170 * @exception SQLException If an error occurs.
171 */
172public abstract int
173getInt(int index) throws SQLException;
174
175/*************************************************************************/
176
177/**
178 * This method returns the value of the specified parameter as a Java
179 * <code>long</code>.
180 *
181 * @param index The index of the parameter to return.
182 *
183 * @return The parameter value as a <code>long</code>.
184 *
185 * @exception SQLException If an error occurs.
186 */
187public abstract long
188getLong(int index) throws SQLException;
189
190/*************************************************************************/
191
192/**
193 * This method returns the value of the specified parameter as a Java
194 * <code>float</code>.
195 *
196 * @param index The index of the parameter to return.
197 *
198 * @return The parameter value as a <code>float</code>.
199 *
200 * @exception SQLException If an error occurs.
201 */
202public abstract float
203getFloat(int index) throws SQLException;
204
205/*************************************************************************/
206
207/**
208 * This method returns the value of the specified parameter as a Java
209 * <code>double</code>.
210 *
211 * @param index The index of the parameter to return.
212 *
213 * @return The parameter value as a <code>double</code>.
214 *
215 * @exception SQLException If an error occurs.
216 */
217public abstract double
218getDouble(int index) throws SQLException;
219
220/*************************************************************************/
221
222/**
223 * This method returns the value of the specified parameter as a Java
224 * <code>BigDecimal</code>.
225 *
226 * @param index The index of the parameter to return.
227 *
228 * @return The parameter value as a <code>BigDecimal</code>.
229 *
230 * @exception SQLException If an error occurs.
231 */
232public abstract BigDecimal
233getBigDecimal(int index) throws SQLException;
234
235/*************************************************************************/
236
237/**
238 * This method returns the value of the specified parameter as a Java
239 * <code>BigDecimal</code>.
240 *
241 * @param index The index of the parameter to return.
242 * @param scale The number of digits to the right of the decimal to return.
243 *
244 * @return The parameter value as a <code>BigDecimal</code>.
245 *
246 * @exception SQLException If an error occurs.
247 */
248public abstract BigDecimal
249getBigDecimal(int index, int scale) throws SQLException;
250
251/*************************************************************************/
252
253/**
254 * This method returns the value of the specified parameter as a Java
255 * byte array.
256 *
257 * @param index The index of the parameter to return.
258 *
259 * @return The parameter value as a byte array
260 *
261 * @exception SQLException If an error occurs.
262 */
263public abstract byte[]
264getBytes(int index) throws SQLException;
265
266/*************************************************************************/
267
268/**
269 * This method returns the value of the specified parameter as a Java
270 * <code>java.sql.Date</code>.
271 *
272 * @param index The index of the parameter to return.
273 *
274 * @return The parameter value as a <code>java.sql.Date</code>.
275 *
276 * @exception SQLException If an error occurs.
277 */
278public abstract java.sql.Date
279getDate(int index) throws SQLException;
280
281/*************************************************************************/
282
283/**
284 * This method returns the value of the specified parameter as a Java
285 * <code>java.sql.Date</code>.
286 *
287 * @param index The index of the parameter to return.
288 * @param calendar The <code>Calendar</code> to use for timezone and locale.
289 *
290 * @return The parameter value as a <code>java.sql.Date</code>.
291 *
292 * @exception SQLException If an error occurs.
293 */
294public abstract java.sql.Date
295getDate(int index, Calendar calendar) throws SQLException;
296
297/*************************************************************************/
298
299/**
300 * This method returns the value of the specified parameter as a Java
301 * <code>java.sql.Time</code>.
302 *
303 * @param index The index of the parameter to return.
304 *
305 * @return The parameter value as a <code>java.sql.Time</code>.
306 *
307 * @exception SQLException If an error occurs.
308 */
309public abstract java.sql.Time
310getTime(int index) throws SQLException;
311
312/*************************************************************************/
313
314/**
315 * This method returns the value of the specified parameter as a Java
316 * <code>java.sql.Time</code>.
317 *
318 * @param index The index of the parameter to return.
319 * @param calendar The <code>Calendar</code> to use for timezone and locale.
320 *
321 * @return The parameter value as a <code>java.sql.Time</code>.
322 *
323 * @exception SQLException If an error occurs.
324 */
325public abstract java.sql.Time
326getTime(int index, Calendar calendar) throws SQLException;
327
328/*************************************************************************/
329
330/**
331 * This method returns the value of the specified parameter as a Java
332 * <code>java.sql.Timestamp</code>.
333 *
334 * @param index The index of the parameter to return.
335 *
336 * @return The parameter value as a <code>java.sql.Timestamp</code>.
337 *
338 * @exception SQLException If an error occurs.
339 */
340public abstract java.sql.Timestamp
341getTimestamp(int index) throws SQLException;
342
343/*************************************************************************/
344
345/**
346 * This method returns the value of the specified parameter as a Java
347 * <code>java.sql.Timestamp</code>.
348 *
349 * @param index The index of the parameter to return.
350 * @param calendar The <code>Calendar</code> to use for timezone and locale.
351 *
352 * @return The parameter value as a <code>java.sql.Timestamp</code>.
353 *
354 * @exception SQLException If an error occurs.
355 */
356public abstract java.sql.Timestamp
357getTimestamp(int index, Calendar calendar) throws SQLException;
358
359/*************************************************************************/
360
361/**
362 * This method returns the value of the specified parameter as a Java
363 * <code>Ref</code>.
364 *
365 * @param index The index of the parameter to return.
366 *
367 * @return The parameter value as a <code>Ref</code>.
368 *
369 * @exception SQLException If an error occurs.
370 */
371public abstract Ref
372getRef(int index) throws SQLException;
373
374/*************************************************************************/
375
376/**
377 * This method returns the value of the specified parameter as a Java
378 * <code>Blob</code>.
379 *
380 * @param index The index of the parameter to return.
381 *
382 * @return The parameter value as a <code>Blob</code>.
383 *
384 * @exception SQLException If an error occurs.
385 */
386public abstract Blob
387getBlob(int index) throws SQLException;
388
389/*************************************************************************/
390
391/**
392 * This method returns the value of the specified parameter as a Java
393 * <code>Clob</code>.
394 *
395 * @param index The index of the parameter to return.
396 *
397 * @return The parameter value as a <code>Clob</code>.
398 *
399 * @exception SQLException If an error occurs.
400 */
401public abstract Clob
402getClob(int index) throws SQLException;
403
404/*************************************************************************/
405
406/**
407 * This method returns the value of the specified parameter as a Java
408 * <code>Array</code>.
409 *
410 * @param index The index of the parameter to return.
411 *
412 * @return The parameter value as a <code>Array</code>.
413 *
414 * @exception SQLException If an error occurs.
415 */
416public abstract Array
417getArray(int index) throws SQLException;
418
419/*************************************************************************/
420
421/**
422 * This method registers the specified parameter as an output parameter
423 * of the specified SQL type.
424 *
425 * @param index The index of the parameter to register as output.
426 * @param type The SQL type value from <code>Types</code>.
427 *
428 * @exception SQLException If an error occurs.
429 */
430public abstract void
431registerOutParameter(int index, int type) throws SQLException;
432
433/*************************************************************************/
434
435/**
436 * This method registers the specified parameter as an output parameter
437 * of the specified SQL type.
438 *
439 * @param index The index of the parameter to register as output.
440 * @param type The SQL type value from <code>Types</code>.
441 * @param name The user defined data type name.
442 *
443 * @exception SQLException If an error occurs.
444 */
445public abstract void
446registerOutParameter(int index, int type, String name) throws SQLException;
447
448/*************************************************************************/
449
450/**
451 * This method registers the specified parameter as an output parameter
452 * of the specified SQL type and scale.
453 *
454 * @param index The index of the parameter to register as output.
455 * @param type The SQL type value from <code>Types</code>.
456 * @param scale The scale of the value that will be returned.
457 *
458 * @exception SQLException If an error occurs.
459 */
460public abstract void
461registerOutParameter(int index, int type, int scale) throws SQLException;
462
463} // interface CallableStatement
464
465
Note: See TracBrowser for help on using the repository browser.