Imported GNU Classpath 0.90
[official-gcc.git] / libjava / classpath / java / sql / SQLOutput.java
blobe210258fa0a56b5c9c0bcacd460eacaed66c0ad1
1 /* SQLOutput.java -- Write SQL values to a stream
2 Copyright (C) 1999, 2000, 2002, 2006 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)
9 any later version.
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., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package java.sql;
41 import java.io.InputStream;
42 import java.io.Reader;
43 import java.math.BigDecimal;
44 import java.net.URL;
46 /**
47 * This interface provides methods for writing Java types to a SQL stream.
48 * It is used for implemented custom type mappings for user defined data
49 * types.
51 * @author Aaron M. Renn (arenn@urbanophile.com)
53 public interface SQLOutput
55 /**
56 * This method writes the specified Java <code>String</code>
57 * to the SQL stream.
59 * @param value The value to write to the stream.
60 * @exception SQLException If an error occurs.
62 void writeString(String value) throws SQLException;
64 /**
65 * This method writes the specified Java <code>boolean</code>
66 * to the SQL stream.
68 * @param value The value to write to the stream.
69 * @exception SQLException If an error occurs.
71 void writeBoolean(boolean value) throws SQLException;
73 /**
74 * This method writes the specified Java <code>byte</code>
75 * to the SQL stream.
77 * @param value The value to write to the stream.
78 * @exception SQLException If an error occurs.
80 void writeByte(byte value) throws SQLException;
82 /**
83 * This method writes the specified Java <code>short</code>
84 * to the SQL stream.
86 * @param value The value to write to the stream.
87 * @exception SQLException If an error occurs.
89 void writeShort(short value) throws SQLException;
91 /**
92 * This method writes the specified Java <code>int</code>
93 * to the SQL stream.
95 * @param value The value to write to the stream.
96 * @exception SQLException If an error occurs.
98 void writeInt(int value) throws SQLException;
101 * This method writes the specified Java <code>long</code>
102 * to the SQL stream.
104 * @param value The value to write to the stream.
105 * @exception SQLException If an error occurs.
107 void writeLong(long value) throws SQLException;
110 * This method writes the specified Java <code>float</code>
111 * to the SQL stream.
113 * @param value The value to write to the stream.
114 * @exception SQLException If an error occurs.
116 void writeFloat(float value) throws SQLException;
119 * This method writes the specified Java <code>double</code>
120 * to the SQL stream.
122 * @param value The value to write to the stream.
123 * @exception SQLException If an error occurs.
125 void writeDouble(double value) throws SQLException;
128 * This method writes the specified Java <code>BigDecimal</code>
129 * to the SQL stream.
131 * @param value The value to write to the stream.
132 * @exception SQLException If an error occurs.
134 void writeBigDecimal(BigDecimal value) throws SQLException;
137 * This method writes the specified Java <code>byte</code> array
138 * to the SQL stream.
140 * @param value The value to write to the stream.
141 * @exception SQLException If an error occurs.
143 void writeBytes(byte[] value) throws SQLException;
146 * This method writes the specified Java <code>java.sql.Date</code>
147 * to the SQL stream.
149 * @param value The value to write to the stream.
150 * @exception SQLException If an error occurs.
152 void writeDate(Date value) throws SQLException;
155 * This method writes the specified Java <code>java.sql.Time</code>
156 * to the SQL stream.
158 * @param value The value to write to the stream.
159 * @exception SQLException If an error occurs.
161 void writeTime(Time value) throws SQLException;
164 * This method writes the specified Java <code>java.sql.Timestamp</code>
165 * to the SQL stream.
167 * @param value The value to write to the stream.
168 * @exception SQLException If an error occurs.
170 void writeTimestamp(Timestamp value) throws SQLException;
173 * This method writes the specified Java character stream
174 * to the SQL stream.
176 * @param stream The stream that holds the character data to write.
177 * @exception SQLException If an error occurs.
179 void writeCharacterStream(Reader stream) throws SQLException;
182 * This method writes the specified ASCII text stream
183 * to the SQL stream.
185 * @param stream The stream that holds the ASCII data to write.
186 * @exception SQLException If an error occurs.
188 void writeAsciiStream(InputStream stream) throws SQLException;
191 * This method writes the specified uninterpreted binary byte stream
192 * to the SQL stream.
194 * @param stream The stream that holds the binary data to write.
195 * @exception SQLException If an error occurs.
197 void writeBinaryStream(InputStream stream) throws SQLException;
200 * This method writes the specified Java <code>SQLData</code> object
201 * to the SQL stream.
203 * @param value The value to write to the stream.
204 * @exception SQLException If an error occurs.
206 void writeObject(SQLData value) throws SQLException;
209 * This method writes the specified Java SQL <code>Ref</code> object
210 * to the SQL stream.
212 * @param value The <code>Ref</code> object to write to the stream.
213 * @exception SQLException If an error occurs.
214 * @see Ref
216 void writeRef(Ref value) throws SQLException;
220 * This method writes the specified Java SQL <code>Blob</code> object
221 * to the SQL stream.
223 * @param value The <code>Blob</code> object to write to the stream.
224 * @exception SQLException If an error occurs.
225 * @see Blob
227 void writeBlob(Blob value) throws SQLException;
230 * This method writes the specified Java SQL <code>Clob</code> object
231 * to the SQL stream.
233 * @param value The <code>Clob</code> object to write to the stream.
234 * @exception SQLException If an error occurs.
235 * @see Clob
237 void writeClob(Clob value) throws SQLException;
240 * This method writes the specified Java SQL <code>Struct</code> object
241 * to the SQL stream.
243 * @param value The <code>Struct</code> object to write to the stream.
244 * @exception SQLException If an error occurs.
245 * @see Struct
247 void writeStruct(Struct value) throws SQLException;
250 * This method writes the specified Java SQL <code>Array</code> object
251 * to the SQL stream.
253 * @param value The value to write to the stream.
254 * @exception SQLException If an error occurs.
256 void writeArray(Array value) throws SQLException;
259 * This method writes the specified <code>java.net.URL</code> object to the
260 * SQL stream.
262 * @param value The value to write to the stream.
263 * @exception SQLException If an error occurs.
264 * @since 1.4
266 void writeURL(URL value) throws SQLException;