Bump for 3.6-28
[LibreOffice.git] / offapi / com / sun / star / sdbc / XSQLOutput.idl
blob7eae742c1d45ca2a9037f746351c161c9a2e6535
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef __com_sun_star_sdbc_XSQLOutput_idl__
29 #define __com_sun_star_sdbc_XSQLOutput_idl__
31 #include <com/sun/star/uno/XInterface.idl>
33 #include <com/sun/star/util/Date.idl>
35 #include <com/sun/star/util/DateTime.idl>
37 #include <com/sun/star/util/Time.idl>
39 module com { module sun { module star { module io {
40 published interface XInputStream;
41 };};};};
43 #include <com/sun/star/sdbc/SQLException.idl>
45 module com { module sun { module star { module sdbc {
47 published interface XRef;
48 published interface XArray;
49 published interface XBlob;
50 published interface XClob;
51 published interface XStruct;
52 published interface XSQLData;
55 /** is used as an output stream for writing the attributes of a user-defined
56 type back to the database. This interface, used only for custom mapping,
57 is used by the driver, and its methods are never directly invoked
58 by a programmer.
61 <p>
62 When an object of a class implementing interface
63 <type scope="com::sun::star::sdbc">XSQLData</type>
64 is passed as an argument to a SQL statement, the JDBC driver calls
65 <method scope="com::sun::star::sdbc">SQLData::getSQLType</method>
66 to determine the kind of SQL datum being passed to the database.
67 <br/>
68 The driver then creates an instance of
69 <code>XSQLOutput</code>
70 and passes it to the method
71 <method scope="com::sun::star::sdbc">XSQLData::writeSQL</method>
72 . The method
73 <code>writeSQL</code>
74 in turn calls the appropriate
75 <code>XSQLOutput.writeXXX</code>
76 methods to write data from the
77 <type scope="com::sun::star::sdbc">XSQLData</type>
78 object to the
79 <code>XSQLOutput</code>
80 output stream as the representation of a SQL user-defined type.</p>
82 published interface XSQLOutput: com::sun::star::uno::XInterface
85 /** writes the next attribute to the stream as a string.
86 @param x
87 the value to pass to the database.
88 @throws SQLException
89 if a database access error occurs.
91 void writeString([in]string x) raises (SQLException);
92 //-------------------------------------------------------------------------
94 /** writes the next attribute to the stream as boolean.
95 @param x
96 the value to pass to the database.
97 @throws SQLException
98 if a database access error occurs.
100 void writeBoolean([in]boolean x) raises (SQLException);
101 //-------------------------------------------------------------------------
103 /** writes the next attribute to the stream as byte.
104 @param x
105 the value to pass to the database.
106 @throws SQLException
107 if a database access error occurs.
109 void writeByte([in]byte x) raises (SQLException);
110 //-------------------------------------------------------------------------
112 /** writes the next attribute to the stream as short.
113 @param x
114 the value to pass to the database.
115 @throws SQLException
116 if a database access error occurs.
118 void writeShort([in]short x) raises (SQLException);
119 //-------------------------------------------------------------------------
121 /** writes the next attribute to the stream as long.
122 @param x
123 the value to pass to the database.
124 @throws SQLException
125 if a database access error occurs.
127 void writeInt([in]long x) raises (SQLException);
128 //-------------------------------------------------------------------------
130 /** writes the next attribute to the stream as hyper.
131 @param x
132 the value to pass to the database.
133 @throws SQLException
134 if a database access error occurs.
136 void writeLong([in]hyper x) raises (SQLException);
137 //-------------------------------------------------------------------------
139 /** writes the next attribute to the stream as float.
140 @param x
141 the value to pass to the database.
142 @throws SQLException
143 if a database access error occurs.
145 void writeFloat([in]float x) raises (SQLException);
146 //-------------------------------------------------------------------------
148 /** writes the next attribute to the stream as double.
149 @param x
150 the value to pass to the database.
151 @throws SQLException
152 if a database access error occurs.
154 void writeDouble([in]double x) raises (SQLException);
155 //-------------------------------------------------------------------------
157 /** writes the next attribute to the stream as byte sequence.
158 @param x
159 the value to pass to the database.
160 @throws SQLException
161 if a database access error occurs.
163 void writeBytes([in]sequence<byte> x) raises (SQLException);
164 //-------------------------------------------------------------------------
166 /** writes the next attribute to the stream as a date.
167 @param x
168 the value to pass to the database.
169 @throws SQLException
170 if a database access error occurs.
172 void writeDate([in]com::sun::star::util::Date x) raises (SQLException);
173 //-------------------------------------------------------------------------
175 /** writes the next attribute to the stream as a time.
176 @param x
177 the value to pass to the database.
178 @throws SQLException
179 if a database access error occurs.
181 void writeTime([in]com::sun::star::util::Time x) raises (SQLException);
182 //-------------------------------------------------------------------------
184 /** writes the next attribute to the stream as a datetime.
185 @param x
186 the value to pass to the database.
187 @throws SQLException
188 if a database access error occurs.
190 void writeTimestamp([in]com::sun::star::util::DateTime x)
191 raises (SQLException);
192 //-------------------------------------------------------------------------
194 /** writes the next attribute to the stream as a stream of uninterpreted
195 bytes.
196 @param x
197 the value to pass to the database.
198 @throws SQLException
199 if a database access error occurs.
201 void writeBinaryStream([in]com::sun::star::io::XInputStream x)
202 raises (SQLException);
203 //-------------------------------------------------------------------------
205 /** writes the next attribute to the stream as a stream of Unicode string.
206 @param x
207 the value to pass to the database.
208 @throws SQLException
209 if a database access error occurs.
211 void writeCharacterStream([in]com::sun::star::io::XInputStream x)
212 raises (SQLException);
213 //-------------------------------------------------------------------------
215 /** writes to the stream the data contained in the given
216 <code>XSQLData</code> object.
220 >When the
221 <code>XSQLData</code>
222 object is
223 <NULL/>
224 , this method writes an SQL NULL to the stream.
225 Otherwise, it calls the
226 <member scope="com::sun::star::sdbc">XSQLData::writeSQL()</member>
227 method of the given object, which
228 writes the object's attributes to the stream.
229 The implementation of the method
230 <code>XSQLData::writeSQL()</code>
231 calls the appropriate
232 <code>XSQLOutput.writeXXX</code>
233 method(s) for writing each of the object's attributes in order.
234 <br/>
235 The attributes must be read from an
236 <type scope="com::sun::star::sdbc">XSQLInput</type>
237 input stream and written to an
238 <code>XSQLOutput</code>
239 output stream in the same order in which they were
240 listed in the SQL definition of the user-defined type.
241 </p>
242 @param x
243 the value to pass to the database.
244 @throws SQLException
245 if a database access error occurs.
247 void writeObject([in]XSQLData x) raises (SQLException);
248 //-------------------------------------------------------------------------
250 /** writes a REF(&amp;lt;structured-type&amp;gt;) to the stream.
251 @param x
252 the value to pass to the database.
253 @throws SQLException
254 if a database access error occurs.
256 void writeRef([in]XRef x) raises (SQLException);
257 //-------------------------------------------------------------------------
259 /** writes a BLOB 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 writeBlob([in]XBlob x) raises (SQLException);
266 //-------------------------------------------------------------------------
268 /** writes a CLOB 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 writeClob([in]XClob x) raises (SQLException);
275 //-------------------------------------------------------------------------
277 /** writes a structured-type 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 writeStruct([in]XStruct x) raises (SQLException);
284 //-------------------------------------------------------------------------
286 /** writes an array 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 writeArray([in]XArray x) raises (SQLException);
295 //=============================================================================
297 }; }; }; };
299 /*===========================================================================
300 ===========================================================================*/
301 #endif
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */