OSDN Git Service

Start of AWT merge with Classpath:
[pf3gnuchains/gcc-fork.git] / libjava / java / sql / SQLOutput.java
1 /* SQLOutput.java -- Write SQL values to a stream
2    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27
28 package java.sql;
29
30 import java.io.InputStream;
31 import java.io.Reader;
32 import java.math.BigDecimal;
33
34 /**
35   * This interface provides methods for writing Java types to a SQL stream.
36   * It is used for implemented custom type mappings for user defined data
37   * types.
38   *
39   * @author Aaron M. Renn (arenn@urbanophile.com)
40   */
41 public interface SQLOutput
42 {
43
44 /*************************************************************************/
45
46 /**
47   * This method writes the specified Java <code>String</code>
48   * to the SQL stream.
49   *
50   * @param value The value to write to the stream.
51   *
52   * @exception SQLException If an error occurs.
53   */
54 public abstract void
55 writeString(String value) throws SQLException;
56
57 /*************************************************************************/
58
59 /**
60   * This method writes the specified Java <code>boolean</code>
61   * to the SQL stream.
62   *
63   * @param value The value to write to the stream.
64   *
65   * @exception SQLException If an error occurs.
66   */
67 public abstract void
68 writeBoolean(boolean value) throws SQLException;
69
70 /*************************************************************************/
71
72 /**
73   * This method writes the specified Java <code>byte</code>
74   * to the SQL stream.
75   *
76   * @param value The value to write to the stream.
77   *
78   * @exception SQLException If an error occurs.
79   */
80 public abstract void
81 writeByte(byte value) throws SQLException;
82
83 /*************************************************************************/
84
85 /**
86   * This method writes the specified Java <code>short</code>
87   * to the SQL stream.
88   *
89   * @param value The value to write to the stream.
90   *
91   * @exception SQLException If an error occurs.
92   */
93 public abstract void
94 writeShort(short value) throws SQLException;
95
96 /*************************************************************************/
97
98 /**
99   * This method writes the specified Java <code>int</code>
100   * to the SQL stream.
101   *
102   * @param value The value to write to the stream.
103   *
104   * @exception SQLException If an error occurs.
105   */
106 public abstract void
107 writeInt(int value) throws SQLException;
108
109 /*************************************************************************/
110
111 /**
112   * This method writes the specified Java <code>long</code>
113   * to the SQL stream.
114   *
115   * @param value The value to write to the stream.
116   *
117   * @exception SQLException If an error occurs.
118   */
119 public abstract void
120 writeLong(long value) throws SQLException;
121
122 /*************************************************************************/
123
124 /**
125   * This method writes the specified Java <code>float</code>
126   * to the SQL stream.
127   *
128   * @param value The value to write to the stream.
129   *
130   * @exception SQLException If an error occurs.
131   */
132 public abstract void
133 writeFloat(float value) throws SQLException;
134
135 /*************************************************************************/
136
137 /**
138   * This method writes the specified Java <code>double</code>
139   * to the SQL stream.
140   *
141   * @param value The value to write to the stream.
142   *
143   * @exception SQLException If an error occurs.
144   */
145 public abstract void
146 writeDouble(double value) throws SQLException;
147
148 /*************************************************************************/
149
150 /**
151   * This method writes the specified Java <code>BigDecimal</code>
152   * to the SQL stream.
153   *
154   * @param value The value to write to the stream.
155   *
156   * @exception SQLException If an error occurs.
157   */
158 public abstract void
159 writeBigDecimal(BigDecimal value) throws SQLException;
160
161 /*************************************************************************/
162
163 /**
164   * This method writes the specified Java <code>byte</code> array
165   * to the SQL stream.
166   *
167   * @param value The value to write to the stream.
168   *
169   * @exception SQLException If an error occurs.
170   */
171 public abstract void
172 writeBytes(byte[] value) throws SQLException;
173
174 /*************************************************************************/
175
176 /**
177   * This method writes the specified Java <code>java.sql.Date</code> 
178   * to the SQL stream.
179   *
180   * @param value The value to write to the stream.
181   *
182   * @exception SQLException If an error occurs.
183   */
184 public abstract void
185 writeDate(java.sql.Date value) throws SQLException;
186
187 /*************************************************************************/
188
189 /**
190   * This method writes the specified Java <code>java.sql.Time</code> 
191   * to the SQL stream.
192   *
193   * @param value The value to write to the stream.
194   *
195   * @exception SQLException If an error occurs.
196   */
197 public abstract void
198 writeTime(java.sql.Time value) throws SQLException;
199
200 /*************************************************************************/
201
202 /**
203   * This method writes the specified Java <code>java.sql.Timestamp</code> 
204   * to the SQL stream.
205   *
206   * @param value The value to write to the stream.
207   *
208   * @exception SQLException If an error occurs.
209   */
210 public abstract void
211 writeTimestamp(java.sql.Timestamp value) throws SQLException;
212
213 /*************************************************************************/
214
215 /**
216   * This method writes the specified Java character stream
217   * to the SQL stream.
218   *
219   * @param value The value to write to the stream.
220   *
221   * @exception SQLException If an error occurs.
222   */
223 public abstract void
224 writeCharacterStream(Reader value) throws SQLException;
225
226 /*************************************************************************/
227
228 /**
229   * This method writes the specified uninterpreted binary byte stream
230   * to the SQL stream.
231   *
232   * @param value The value to write to the stream.
233   * 
234   * @exception SQLException If an error occurs.
235   */
236 public abstract void
237 writeBinaryStream(InputStream value) throws SQLException;
238
239 /*************************************************************************/
240
241 /**
242   * This method writes the specified ASCII text stream
243   * to the SQL stream.
244   *
245   * @param value The value to write to the stream.
246   * 
247   * @exception SQLException If an error occurs.
248   */
249 public abstract void
250 writeAsciiStream(InputStream value) throws SQLException;
251
252 /*************************************************************************/
253
254 /**
255   * This method writes the specified Java <code>SQLData</code> object
256   * to the SQL stream.
257   *
258   * @param value The value to write to the stream.
259   *
260   * @exception SQLException If an error occurs.
261   */
262 public abstract void
263 writeObject(SQLData value) throws SQLException;
264
265 /*************************************************************************/
266
267 /**
268   * This method writes the specified Java SQL <code>Ref</code> object
269   * to the SQL stream.
270   *
271   * @param value The value to write to the stream.
272   *
273   * @exception SQLException If an error occurs.
274   */
275 public abstract void
276 writeRef(Ref value) throws SQLException;
277
278 /*************************************************************************/
279
280 /**
281   * This method writes the specified Java SQL <code>Blob</code> object
282   * to the SQL stream.
283   *
284   * @param value The value to write to the stream.
285   *
286   * @exception SQLException If an error occurs.
287   */
288 public abstract void
289 writeBlob(Blob value) throws SQLException;
290
291 /*************************************************************************/
292
293 /**
294   * This method writes the specified Java SQL <code>Clob</code> object
295   * to the SQL stream.
296   *
297   * @param value The value to write to the stream.
298   *
299   * @exception SQLException If an error occurs.
300   */
301 public abstract void
302 writeClob(Clob value) throws SQLException;
303
304 /*************************************************************************/
305
306 /**
307   * This method writes the specified Java SQL <code>Struct</code> object
308   * to the SQL stream.
309   *
310   * @param value The value to write to the stream.
311   *
312   * @exception SQLException If an error occurs.
313   */
314 public abstract void
315 writeStruct(Struct value) throws SQLException;
316
317 /*************************************************************************/
318
319 /**
320   * This method writes the specified Java SQL <code>Array</code> object
321   * to the SQL stream.
322   *
323   * @param value The value to write to the stream.
324   *
325   * @exception SQLException If an error occurs.
326   */
327 public abstract void
328 writeArray(Array value) throws SQLException;
329
330 } // interface SQLOutput
331