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