1 /* SQLOutput.java -- Write SQL values to a stream
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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)
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.
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
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. */
30 import java.io.InputStream;
31 import java.io.Reader;
32 import java.math.BigDecimal;
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
39 * @author Aaron M. Renn (arenn@urbanophile.com)
41 public interface SQLOutput
44 /*************************************************************************/
47 * This method writes the specified Java <code>String</code>
50 * @param value The value to write to the stream.
52 * @exception SQLException If an error occurs.
55 writeString(String value) throws SQLException;
57 /*************************************************************************/
60 * This method writes the specified Java <code>boolean</code>
63 * @param value The value to write to the stream.
65 * @exception SQLException If an error occurs.
68 writeBoolean(boolean value) throws SQLException;
70 /*************************************************************************/
73 * This method writes the specified Java <code>byte</code>
76 * @param value The value to write to the stream.
78 * @exception SQLException If an error occurs.
81 writeByte(byte value) throws SQLException;
83 /*************************************************************************/
86 * This method writes the specified Java <code>short</code>
89 * @param value The value to write to the stream.
91 * @exception SQLException If an error occurs.
94 writeShort(short value) throws SQLException;
96 /*************************************************************************/
99 * This method writes the specified Java <code>int</code>
102 * @param value The value to write to the stream.
104 * @exception SQLException If an error occurs.
107 writeInt(int value) throws SQLException;
109 /*************************************************************************/
112 * This method writes the specified Java <code>long</code>
115 * @param value The value to write to the stream.
117 * @exception SQLException If an error occurs.
120 writeLong(long value) throws SQLException;
122 /*************************************************************************/
125 * This method writes the specified Java <code>float</code>
128 * @param value The value to write to the stream.
130 * @exception SQLException If an error occurs.
133 writeFloat(float value) throws SQLException;
135 /*************************************************************************/
138 * This method writes the specified Java <code>double</code>
141 * @param value The value to write to the stream.
143 * @exception SQLException If an error occurs.
146 writeDouble(double value) throws SQLException;
148 /*************************************************************************/
151 * This method writes the specified Java <code>BigDecimal</code>
154 * @param value The value to write to the stream.
156 * @exception SQLException If an error occurs.
159 writeBigDecimal(BigDecimal value) throws SQLException;
161 /*************************************************************************/
164 * This method writes the specified Java <code>byte</code> array
167 * @param value The value to write to the stream.
169 * @exception SQLException If an error occurs.
172 writeBytes(byte[] value) throws SQLException;
174 /*************************************************************************/
177 * This method writes the specified Java <code>java.sql.Date</code>
180 * @param value The value to write to the stream.
182 * @exception SQLException If an error occurs.
185 writeDate(java.sql.Date value) throws SQLException;
187 /*************************************************************************/
190 * This method writes the specified Java <code>java.sql.Time</code>
193 * @param value The value to write to the stream.
195 * @exception SQLException If an error occurs.
198 writeTime(java.sql.Time value) throws SQLException;
200 /*************************************************************************/
203 * This method writes the specified Java <code>java.sql.Timestamp</code>
206 * @param value The value to write to the stream.
208 * @exception SQLException If an error occurs.
211 writeTimestamp(java.sql.Timestamp value) throws SQLException;
213 /*************************************************************************/
216 * This method writes the specified Java character stream
219 * @param value The value to write to the stream.
221 * @exception SQLException If an error occurs.
224 writeCharacterStream(Reader value) throws SQLException;
226 /*************************************************************************/
229 * This method writes the specified uninterpreted binary byte stream
232 * @param value The value to write to the stream.
234 * @exception SQLException If an error occurs.
237 writeBinaryStream(InputStream value) throws SQLException;
239 /*************************************************************************/
242 * This method writes the specified ASCII text stream
245 * @param value The value to write to the stream.
247 * @exception SQLException If an error occurs.
250 writeAsciiStream(InputStream value) throws SQLException;
252 /*************************************************************************/
255 * This method writes the specified Java <code>SQLData</code> object
258 * @param value The value to write to the stream.
260 * @exception SQLException If an error occurs.
263 writeObject(SQLData value) throws SQLException;
265 /*************************************************************************/
268 * This method writes the specified Java SQL <code>Ref</code> object
271 * @param value The value to write to the stream.
273 * @exception SQLException If an error occurs.
276 writeRef(Ref value) throws SQLException;
278 /*************************************************************************/
281 * This method writes the specified Java SQL <code>Blob</code> object
284 * @param value The value to write to the stream.
286 * @exception SQLException If an error occurs.
289 writeBlob(Blob value) throws SQLException;
291 /*************************************************************************/
294 * This method writes the specified Java SQL <code>Clob</code> object
297 * @param value The value to write to the stream.
299 * @exception SQLException If an error occurs.
302 writeClob(Clob value) throws SQLException;
304 /*************************************************************************/
307 * This method writes the specified Java SQL <code>Struct</code> object
310 * @param value The value to write to the stream.
312 * @exception SQLException If an error occurs.
315 writeStruct(Struct value) throws SQLException;
317 /*************************************************************************/
320 * This method writes the specified Java SQL <code>Array</code> object
323 * @param value The value to write to the stream.
325 * @exception SQLException If an error occurs.
328 writeArray(Array value) throws SQLException;
330 } // interface SQLOutput