Update ooo320-m1
[ooovba.git] / offapi / com / sun / star / sdbc / XSQLOutput.idl
blobcf6e78194deaba108b756ae31ad6959140138e92
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSQLOutput.idl,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_sdbc_XSQLOutput_idl__
31 #define __com_sun_star_sdbc_XSQLOutput_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include <com/sun/star/uno/XInterface.idl>
35 #endif
37 #ifndef __com_sun_star_util_Date_idl__
38 #include <com/sun/star/util/Date.idl>
39 #endif
41 #ifndef __com_sun_star_util_DateTime_idl__
42 #include <com/sun/star/util/DateTime.idl>
43 #endif
45 #ifndef __com_sun_star_util_Time_idl__
46 #include <com/sun/star/util/Time.idl>
47 #endif
49 module com { module sun { module star { module io {
50 published interface XInputStream;
51 };};};};
53 #ifndef __com_sun_star_sdbc_SQLException_idl__
54 #include <com/sun/star/sdbc/SQLException.idl>
55 #endif
57 module com { module sun { module star { module sdbc {
59 published interface XRef;
60 published interface XArray;
61 published interface XBlob;
62 published interface XClob;
63 published interface XStruct;
64 published interface XSQLData;
67 /** is used as an output stream for writing the attributes of a user-defined
68 type back to the database. This interface, used only for custom mapping,
69 is used by the driver, and its methods are never directly invoked
70 by a programmer.
73 <p>
74 When an object of a class implementing interface
75 <type scope="com::sun::star::sdbc">XSQLData</type>
76 is passed as an argument to a SQL statement, the JDBC driver calls
77 <method scope="com::sun::star::sdbc">SQLData::getSQLType</method>
78 to determine the kind of SQL datum being passed to the database.
79 <br/>
80 The driver then creates an instance of
81 <code>XSQLOutput</code>
82 and passes it to the method
83 <method scope="com::sun::star::sdbc">XSQLData::writeSQL</method>
84 . The method
85 <code>writeSQL</code>
86 in turn calls the appropriate
87 <code>XSQLOutput.writeXXX</code>
88 methods to write data from the
89 <type scope="com::sun::star::sdbc">XSQLData</type>
90 object to the
91 <code>XSQLOutput</code>
92 output stream as the representation of a SQL user-defined type.</p>
94 published interface XSQLOutput: com::sun::star::uno::XInterface
97 /** writes the next attribute to the stream as a string.
98 @param x
99 the value to pass to the database.
100 @throws SQLException
101 if a database access error occurs.
103 void writeString([in]string x) raises (SQLException);
104 //-------------------------------------------------------------------------
106 /** writes the next attribute to the stream as boolean.
107 @param x
108 the value to pass to the database.
109 @throws SQLException
110 if a database access error occurs.
112 void writeBoolean([in]boolean x) raises (SQLException);
113 //-------------------------------------------------------------------------
115 /** writes the next attribute to the stream as byte.
116 @param x
117 the value to pass to the database.
118 @throws SQLException
119 if a database access error occurs.
121 void writeByte([in]byte x) raises (SQLException);
122 //-------------------------------------------------------------------------
124 /** writes the next attribute to the stream as short.
125 @param x
126 the value to pass to the database.
127 @throws SQLException
128 if a database access error occurs.
130 void writeShort([in]short x) raises (SQLException);
131 //-------------------------------------------------------------------------
133 /** writes the next attribute to the stream as long.
134 @param x
135 the value to pass to the database.
136 @throws SQLException
137 if a database access error occurs.
139 void writeInt([in]long x) raises (SQLException);
140 //-------------------------------------------------------------------------
142 /** writes the next attribute to the stream as hyper.
143 @param x
144 the value to pass to the database.
145 @throws SQLException
146 if a database access error occurs.
148 void writeLong([in]hyper x) raises (SQLException);
149 //-------------------------------------------------------------------------
151 /** writes the next attribute to the stream as float.
152 @param x
153 the value to pass to the database.
154 @throws SQLException
155 if a database access error occurs.
157 void writeFloat([in]float x) raises (SQLException);
158 //-------------------------------------------------------------------------
160 /** writes the next attribute to the stream as double.
161 @param x
162 the value to pass to the database.
163 @throws SQLException
164 if a database access error occurs.
166 void writeDouble([in]double x) raises (SQLException);
167 //-------------------------------------------------------------------------
169 /** writes the next attribute to the stream as byte sequence.
170 @param x
171 the value to pass to the database.
172 @throws SQLException
173 if a database access error occurs.
175 void writeBytes([in]sequence<byte> x) raises (SQLException);
176 //-------------------------------------------------------------------------
178 /** writes the next attribute to the stream as a date.
179 @param x
180 the value to pass to the database.
181 @throws SQLException
182 if a database access error occurs.
184 void writeDate([in]com::sun::star::util::Date x) raises (SQLException);
185 //-------------------------------------------------------------------------
187 /** writes the next attribute to the stream as a time.
188 @param x
189 the value to pass to the database.
190 @throws SQLException
191 if a database access error occurs.
193 void writeTime([in]com::sun::star::util::Time x) raises (SQLException);
194 //-------------------------------------------------------------------------
196 /** writes the next attribute to the stream as a datetime.
197 @param x
198 the value to pass to the database.
199 @throws SQLException
200 if a database access error occurs.
202 void writeTimestamp([in]com::sun::star::util::DateTime x)
203 raises (SQLException);
204 //-------------------------------------------------------------------------
206 /** writes the next attribute to the stream as a stream of uninterpreted
207 bytes.
208 @param x
209 the value to pass to the database.
210 @throws SQLException
211 if a database access error occurs.
213 void writeBinaryStream([in]com::sun::star::io::XInputStream x)
214 raises (SQLException);
215 //-------------------------------------------------------------------------
217 /** writes the next attribute to the stream as a stream of unicode string.
218 @param x
219 the value to pass to the database.
220 @throws SQLException
221 if a database access error occurs.
223 void writeCharacterStream([in]com::sun::star::io::XInputStream x)
224 raises (SQLException);
225 //-------------------------------------------------------------------------
227 /** writes to the stream the data contained in the given
228 <code>XSQLData</code> object.
232 >When the
233 <code>XSQLData</code>
234 object is
235 <NULL/>
236 , this method writes an SQL NULL to the stream.
237 Otherwise, it calls the
238 <member scope="com::sun::star::sdbc">XSQLData::writeSQL()</member>
239 method of the given object, which
240 writes the object's attributes to the stream.
241 The implementation of the method
242 <code>XSQLData::writeSQL()</code>
243 calls the appropriate
244 <code>XSQLOutput.writeXXX</code>
245 method(s) for writing each of the object's attributes in order.
246 <br/>
247 The attributes must be read from an
248 <type scope="com::sun::star::sdbc">XSQLInput</type>
249 input stream and written to an
250 <code>XSQLOutput</code>
251 output stream in the same order in which they were
252 listed in the SQL definition of the user-defined type.
253 </p>
254 @param x
255 the value to pass to the database.
256 @throws SQLException
257 if a database access error occurs.
259 void writeObject([in]XSQLData x) raises (SQLException);
260 //-------------------------------------------------------------------------
262 /** writes a REF(&amp;lt;structured-type&amp;gt;) to the stream.
263 @param x
264 the value to pass to the database.
265 @throws SQLException
266 if a database access error occurs.
268 void writeRef([in]XRef x) raises (SQLException);
269 //-------------------------------------------------------------------------
271 /** writes a BLOB to the stream.
272 @param x
273 the value to pass to the database.
274 @throws SQLException
275 if a database access error occurs.
277 void writeBlob([in]XBlob x) raises (SQLException);
278 //-------------------------------------------------------------------------
280 /** writes a CLOB to the stream.
281 @param x
282 the value to pass to the database.
283 @throws SQLException
284 if a database access error occurs.
286 void writeClob([in]XClob x) raises (SQLException);
287 //-------------------------------------------------------------------------
289 /** writes a structured-type to the stream.
290 @param x
291 the value to pass to the database.
292 @throws SQLException
293 if a database access error occurs.
295 void writeStruct([in]XStruct x) raises (SQLException);
296 //-------------------------------------------------------------------------
298 /** writes an array to the stream.
299 @param x
300 the value to pass to the database.
301 @throws SQLException
302 if a database access error occurs.
304 void writeArray([in]XArray x) raises (SQLException);
307 //=============================================================================
309 }; }; }; };
311 /*===========================================================================
312 ===========================================================================*/
313 #endif