Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / sdbc / XSQLOutput.idl
blobc454ecaee47f0519f1d3eb61b873fda708156a99
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_sdbc_XSQLOutput_idl__
20 #define __com_sun_star_sdbc_XSQLOutput_idl__
22 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/util/Date.idl>
26 #include <com/sun/star/util/DateTime.idl>
28 #include <com/sun/star/util/Time.idl>
30 module com { module sun { module star { module io {
31 published interface XInputStream;
32 };};};};
34 #include <com/sun/star/sdbc/SQLException.idl>
36 module com { module sun { module star { module sdbc {
38 published interface XRef;
39 published interface XArray;
40 published interface XBlob;
41 published interface XClob;
42 published interface XStruct;
43 published interface XSQLData;
46 /** is used as an output stream for writing the attributes of a user-defined
47 type back to the database. This interface, used only for custom mapping,
48 is used by the driver, and its methods are never directly invoked
49 by a programmer.
52 <p>
53 When an object of a class implementing interface
54 com::sun::star::sdbc::XSQLData
55 is passed as an argument to a SQL statement, the JDBC driver calls
56 com::sun::star::sdbc::SQLData::getSQLType()
57 to determine the kind of SQL datum being passed to the database.
58 <br/>
59 The driver then creates an instance of
60 <code>XSQLOutput</code>
61 and passes it to the method
62 com::sun::star::sdbc::XSQLData::writeSQL()
63 . The method
64 <code>writeSQL</code>
65 in turn calls the appropriate
66 <code>XSQLOutput.writeXXX</code>
67 methods to write data from the
68 com::sun::star::sdbc::XSQLData
69 object to the
70 <code>XSQLOutput</code>
71 output stream as the representation of a SQL user-defined type.</p>
73 published interface XSQLOutput: com::sun::star::uno::XInterface
76 /** writes the next attribute to the stream as a string.
77 @param x
78 the value to pass to the database.
79 @throws SQLException
80 if a database access error occurs.
82 void writeString([in]string x) raises (SQLException);
84 /** writes the next attribute to the stream as boolean.
85 @param x
86 the value to pass to the database.
87 @throws SQLException
88 if a database access error occurs.
90 void writeBoolean([in]boolean x) raises (SQLException);
92 /** writes the next attribute to the stream as byte.
93 @param x
94 the value to pass to the database.
95 @throws SQLException
96 if a database access error occurs.
98 void writeByte([in]byte x) raises (SQLException);
100 /** writes the next attribute to the stream as short.
101 @param x
102 the value to pass to the database.
103 @throws SQLException
104 if a database access error occurs.
106 void writeShort([in]short x) raises (SQLException);
108 /** writes the next attribute to the stream as long.
109 @param x
110 the value to pass to the database.
111 @throws SQLException
112 if a database access error occurs.
114 void writeInt([in]long x) raises (SQLException);
116 /** writes the next attribute to the stream as hyper.
117 @param x
118 the value to pass to the database.
119 @throws SQLException
120 if a database access error occurs.
122 void writeLong([in]hyper x) raises (SQLException);
124 /** writes the next attribute to the stream as float.
125 @param x
126 the value to pass to the database.
127 @throws SQLException
128 if a database access error occurs.
130 void writeFloat([in]float x) raises (SQLException);
132 /** writes the next attribute to the stream as double.
133 @param x
134 the value to pass to the database.
135 @throws SQLException
136 if a database access error occurs.
138 void writeDouble([in]double x) raises (SQLException);
140 /** writes the next attribute to the stream as byte sequence.
141 @param x
142 the value to pass to the database.
143 @throws SQLException
144 if a database access error occurs.
146 void writeBytes([in]sequence<byte> x) raises (SQLException);
148 /** writes the next attribute to the stream as a date.
149 @param x
150 the value to pass to the database.
151 @throws SQLException
152 if a database access error occurs.
154 void writeDate([in]com::sun::star::util::Date x) raises (SQLException);
156 /** writes the next attribute to the stream as a time.
157 @param x
158 the value to pass to the database.
159 @throws SQLException
160 if a database access error occurs.
162 void writeTime([in]com::sun::star::util::Time x) raises (SQLException);
164 /** writes the next attribute to the stream as a datetime.
165 @param x
166 the value to pass to the database.
167 @throws SQLException
168 if a database access error occurs.
170 void writeTimestamp([in]com::sun::star::util::DateTime x)
171 raises (SQLException);
173 /** writes the next attribute to the stream as a stream of uninterpreted
174 bytes.
175 @param x
176 the value to pass to the database.
177 @throws SQLException
178 if a database access error occurs.
180 void writeBinaryStream([in]com::sun::star::io::XInputStream x)
181 raises (SQLException);
183 /** writes the next attribute to the stream as a stream of Unicode string.
184 @param x
185 the value to pass to the database.
186 @throws SQLException
187 if a database access error occurs.
189 void writeCharacterStream([in]com::sun::star::io::XInputStream x)
190 raises (SQLException);
192 /** writes to the stream the data contained in the given
193 <code>XSQLData</code> object.
197 >When the
198 <code>XSQLData</code>
199 object is
200 `NULL`
201 , this method writes an SQL NULL to the stream.
202 Otherwise, it calls the
203 com::sun::star::sdbc::XSQLData::writeSQL()
204 method of the given object, which
205 writes the object's attributes to the stream.
206 The implementation of the method
207 <code>XSQLData::writeSQL()</code>
208 calls the appropriate
209 <code>XSQLOutput.writeXXX</code>
210 method(s) for writing each of the object's attributes in order.
211 <br/>
212 The attributes must be read from an
213 com::sun::star::sdbc::XSQLInput
214 input stream and written to an
215 <code>XSQLOutput</code>
216 output stream in the same order in which they were
217 listed in the SQL definition of the user-defined type.
218 </p>
219 @param x
220 the value to pass to the database.
221 @throws SQLException
222 if a database access error occurs.
224 void writeObject([in]XSQLData x) raises (SQLException);
226 /** writes a REF(&amp;lt;structured-type&amp;gt;) to the stream.
227 @param x
228 the value to pass to the database.
229 @throws SQLException
230 if a database access error occurs.
232 void writeRef([in]XRef x) raises (SQLException);
234 /** writes a BLOB to the stream.
235 @param x
236 the value to pass to the database.
237 @throws SQLException
238 if a database access error occurs.
240 void writeBlob([in]XBlob x) raises (SQLException);
242 /** writes a CLOB to the stream.
243 @param x
244 the value to pass to the database.
245 @throws SQLException
246 if a database access error occurs.
248 void writeClob([in]XClob x) raises (SQLException);
250 /** writes a structured-type 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 writeStruct([in]XStruct x) raises (SQLException);
258 /** writes an array to the stream.
259 @param x
260 the value to pass to the database.
261 @throws SQLException
262 if a database access error occurs.
264 void writeArray([in]XArray x) raises (SQLException);
268 }; }; }; };
270 /*===========================================================================
271 ===========================================================================*/
272 #endif
274 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */