source: trunk/src/gcc/libjava/java/sql/SQLInput.java@ 1389

Last change on this file since 1389 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: 9.8 KB
Line 
1/* SQLInput.java -- Read SQL values from a stream
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;
44
45/**
46 * This interface provides methods for reading values from a stream
47 * that is connected to a SQL structured or distinct type. It is used
48 * for custom mapping of user defined data types.
49 *
50 * @author Aaron M. Renn ([email protected])
51 */
52public interface SQLInput
53{
54
55/*************************************************************************/
56
57/**
58 * This method reads the next item from the stream a Java
59 * <code>String</code>.
60 *
61 * @return The value read from the stream as a <code>String</code>.
62 *
63 * @exception SQLException If an error occurs.
64 */
65public abstract String
66readString() throws SQLException;
67
68/*************************************************************************/
69
70/**
71 * This method reads the next item from the stream a Java
72 * <code>boolean</code>.
73 *
74 * @return The value read from the stream as a <code>boolean</code>.
75 *
76 * @exception SQLException If an error occurs.
77 */
78public abstract boolean
79readBoolean() throws SQLException;
80
81/*************************************************************************/
82
83/**
84 * This method reads the next item from the stream a Java
85 * <code>byte</code>.
86 *
87 * @return The value read from the stream as a <code>byte</code>.
88 *
89 * @exception SQLException If an error occurs.
90 */
91public abstract byte
92readByte() throws SQLException;
93
94/*************************************************************************/
95
96/**
97 * This method reads the next item from the stream a Java
98 * <code>short</code>.
99 *
100 * @return The value read from the stream as a <code>short</code>.
101 *
102 * @exception SQLException If an error occurs.
103 */
104public abstract short
105readShort() throws SQLException;
106
107/*************************************************************************/
108
109/**
110 * This method reads the next item from the stream a Java
111 * <code>int</code>.
112 *
113 * @return The value read from the stream as an <code>int</code>.
114 *
115 * @exception SQLException If an error occurs.
116 */
117public abstract int
118readInt() throws SQLException;
119
120/*************************************************************************/
121
122/**
123 * This method reads the next item from the stream a Java
124 * <code>long</code>.
125 *
126 * @return The value read from the stream as a <code>long</code>.
127 *
128 * @exception SQLException If an error occurs.
129 */
130public abstract long
131readLong() throws SQLException;
132
133/*************************************************************************/
134
135/**
136 * This method reads the next item from the stream a Java
137 * <code>float</code>.
138 *
139 * @return The value read from the stream as a <code>float</code>.
140 *
141 * @exception SQLException If an error occurs.
142 */
143public abstract float
144readFloat() throws SQLException;
145
146/*************************************************************************/
147
148/**
149 * This method reads the next item from the stream a Java
150 * <code>double</code>.
151 *
152 * @return The value read from the stream as a <code>double</code>.
153 *
154 * @exception SQLException If an error occurs.
155 */
156public abstract double
157readDouble() throws SQLException;
158
159/*************************************************************************/
160
161/**
162 * This method reads the next item from the stream a Java
163 * <code>BigDecimal</code>.
164 *
165 * @return The value read from the stream as a <code>BigDecimal</code>.
166 *
167 * @exception SQLException If an error occurs.
168 */
169public abstract BigDecimal
170readBigDecimal() throws SQLException;
171
172/*************************************************************************/
173
174/**
175 * This method reads the next item from the stream a Java
176 * byte array
177 *
178 * @return The value read from the stream as a byte array.
179 *
180 * @exception SQLException If an error occurs.
181 */
182public abstract byte[]
183readBytes() throws SQLException;
184
185/*************************************************************************/
186
187/**
188 * This method reads the next item from the stream a Java
189 * <code>java.sql.Date</code>.
190 *
191 * @return The value read from the stream as a <code>java.sql.Date</code>.
192 *
193 * @exception SQLException If an error occurs.
194 */
195public abstract java.sql.Date
196readDate() throws SQLException;
197
198/*************************************************************************/
199
200/**
201 * This method reads the next item from the stream a Java
202 * <code>java.sql.Time</code>.
203 *
204 * @return The value read from the stream as a <code>java.sql.Time</code>.
205 *
206 * @exception SQLException If an error occurs.
207 */
208public abstract java.sql.Time
209readTime() throws SQLException;
210
211/*************************************************************************/
212
213/**
214 * This method reads the next item from the stream a Java
215 * <code>java.sql.Timestamp</code>.
216 *
217 * @return The value read from the stream as a <code>java.sql.Timestamp</code>.
218 *
219 * @exception SQLException If an error occurs.
220 */
221public abstract java.sql.Timestamp
222readTimestamp() throws SQLException;
223
224/*************************************************************************/
225
226/**
227 * This method reads the next item from the stream a ASCII text
228 * <code>InputStream</code>.
229 *
230 * @return The value read from the stream as an <code>InputStream</code>.
231 *
232 * @exception SQLException If an error occurs.
233 */
234public abstract InputStream
235readAsciiStream() throws SQLException;
236
237/*************************************************************************/
238
239/**
240 * This method reads the next item from the stream a binary
241 * <code>InputStream</code>.
242 *
243 * @return The value read from the stream as an <code>InputStream</code>.
244 *
245 * @exception SQLException If an error occurs.
246 */
247public abstract InputStream
248readBinaryStream() throws SQLException;
249
250/*************************************************************************/
251
252/**
253 * This method reads the next item from the stream a character
254 * <code>Reader</code>.
255 *
256 * @return The value read from the stream as a <code>Reader</code>.
257 *
258 * @exception SQLException If an error occurs.
259 */
260public abstract Reader
261readCharacterStream() throws SQLException;
262
263/*************************************************************************/
264
265/**
266 * This method reads the next item from the stream a Java
267 * <code>Object</code>.
268 *
269 * @return The value read from the stream as an <code>Object</code>.
270 *
271 * @exception SQLException If an error occurs.
272 */
273public abstract Object
274readObject() throws SQLException;
275
276/*************************************************************************/
277
278/**
279 * This method reads the next item from the stream a Java SQL
280 * <code>Ref</code>.
281 *
282 * @return The value read from the stream as an <code>Ref</code>.
283 *
284 * @exception SQLException If an error occurs.
285 */
286public abstract Ref
287readRef() throws SQLException;
288
289/*************************************************************************/
290
291/**
292 * This method reads the next item from the stream a Java SQL
293 * <code>Blob</code>.
294 *
295 * @return The value read from the stream as a <code>Blob</code>.
296 *
297 * @exception SQLException If an error occurs.
298 */
299public abstract Blob
300readBlob() throws SQLException;
301
302/*************************************************************************/
303
304/**
305 * This method reads the next item from the stream a Java SQL
306 * <code>Clob</code>.
307 *
308 * @return The value read from the stream as a <code>Clob</code>.
309 *
310 * @exception SQLException If an error occurs.
311 */
312public abstract Clob
313readClob() throws SQLException;
314
315/*************************************************************************/
316
317/**
318 * This method reads the next item from the stream a Java SQL
319 * <code>Array</code>.
320 *
321 * @return The value read from the stream as an <code>Array</code>.
322 *
323 * @exception SQLException If an error occurs.
324 */
325public abstract Array
326readArray() throws SQLException;
327
328/*************************************************************************/
329
330/**
331 * This method tests whether or not the last value read was a SQL
332 * NULL value.
333 *
334 * @return <code>true</code> if the last value read was a NULL,
335 * <code>false</code> otherwise.
336 *
337 * @exception SQLException If an error occurs.
338 */
339public abstract boolean
340wasNull() throws SQLException;
341
342} // interface SQLInput
343
Note: See TracBrowser for help on using the repository browser.