xref: /aoo41x/main/offapi/com/sun/star/sdbc/XSQLOutput.idl (revision d1766043)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XSQLOutput_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdbc_XSQLOutput_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_util_Date_idl__
31cdf0e10cSrcweir#include <com/sun/star/util/Date.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_util_DateTime_idl__
35cdf0e10cSrcweir#include <com/sun/star/util/DateTime.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_util_Time_idl__
39cdf0e10cSrcweir#include <com/sun/star/util/Time.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir module com {  module sun {  module star {  module io {
43cdf0e10cSrcweir published interface XInputStream;
44cdf0e10cSrcweir};};};};
45cdf0e10cSrcweir
46cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
47cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
48cdf0e10cSrcweir#endif
49cdf0e10cSrcweir
50cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
51cdf0e10cSrcweir
52cdf0e10cSrcweir published interface XRef;
53cdf0e10cSrcweir published interface XArray;
54cdf0e10cSrcweir published interface XBlob;
55cdf0e10cSrcweir published interface XClob;
56cdf0e10cSrcweir published interface XStruct;
57cdf0e10cSrcweir published interface XSQLData;
58cdf0e10cSrcweir
59cdf0e10cSrcweir
60cdf0e10cSrcweir/** is used as an output stream for writing the attributes of a user-defined
61cdf0e10cSrcweir	type back to the database.  This interface, used only for custom mapping,
62cdf0e10cSrcweir	is used by the driver, and its methods are never directly invoked
63cdf0e10cSrcweir	by a programmer.
64cdf0e10cSrcweir
65cdf0e10cSrcweir
66cdf0e10cSrcweir	<p>
67cdf0e10cSrcweir	When an object of a class implementing interface
68cdf0e10cSrcweir	<type scope="com::sun::star::sdbc">XSQLData</type>
69cdf0e10cSrcweir	is passed as an argument to a SQL statement, the JDBC driver calls
70cdf0e10cSrcweir	<method scope="com::sun::star::sdbc">SQLData::getSQLType</method>
71cdf0e10cSrcweir	to determine the kind of SQL datum being passed to the database.
72cdf0e10cSrcweir	<br/>
73cdf0e10cSrcweir	The driver then creates an instance of
74cdf0e10cSrcweir	<code>XSQLOutput</code>
75cdf0e10cSrcweir	and passes it to the method
76cdf0e10cSrcweir	<method scope="com::sun::star::sdbc">XSQLData::writeSQL</method>
77cdf0e10cSrcweir	. The method
78cdf0e10cSrcweir	<code>writeSQL</code>
79cdf0e10cSrcweir	in turn calls the appropriate
80cdf0e10cSrcweir	<code>XSQLOutput.writeXXX</code>
81cdf0e10cSrcweir	methods to write data from the
82cdf0e10cSrcweir	<type scope="com::sun::star::sdbc">XSQLData</type>
83cdf0e10cSrcweir	object to the
84cdf0e10cSrcweir	<code>XSQLOutput</code>
85cdf0e10cSrcweir	output stream as the representation of a SQL user-defined type.</p>
86cdf0e10cSrcweir */
87cdf0e10cSrcweirpublished interface XSQLOutput: com::sun::star::uno::XInterface
88cdf0e10cSrcweir{
89cdf0e10cSrcweir
90cdf0e10cSrcweir	/** writes the next attribute to the stream as a string.
91cdf0e10cSrcweir		@param x
92cdf0e10cSrcweir			the value to pass to the database.
93cdf0e10cSrcweir		@throws SQLException
94cdf0e10cSrcweir			if a database access error occurs.
95cdf0e10cSrcweir	 */
96cdf0e10cSrcweir	void writeString([in]string x) raises (SQLException);
97cdf0e10cSrcweir  	//-------------------------------------------------------------------------
98cdf0e10cSrcweir
99cdf0e10cSrcweir	/** writes the next attribute to the stream as boolean.
100cdf0e10cSrcweir		@param x
101cdf0e10cSrcweir			the value to pass to the database.
102cdf0e10cSrcweir		@throws SQLException
103cdf0e10cSrcweir			if a database access error occurs.
104cdf0e10cSrcweir	 */
105cdf0e10cSrcweir	void writeBoolean([in]boolean x) raises (SQLException);
106cdf0e10cSrcweir  	//-------------------------------------------------------------------------
107cdf0e10cSrcweir
108cdf0e10cSrcweir	/** writes the next attribute to the stream as byte.
109cdf0e10cSrcweir		@param x
110cdf0e10cSrcweir			the value to pass to the database.
111cdf0e10cSrcweir		@throws SQLException
112cdf0e10cSrcweir			if a database access error occurs.
113cdf0e10cSrcweir	 */
114cdf0e10cSrcweir	void writeByte([in]byte x) raises (SQLException);
115cdf0e10cSrcweir  	//-------------------------------------------------------------------------
116cdf0e10cSrcweir
117cdf0e10cSrcweir	/** writes the next attribute to the stream as short.
118cdf0e10cSrcweir		@param x
119cdf0e10cSrcweir			the value to pass to the database.
120cdf0e10cSrcweir		@throws SQLException
121cdf0e10cSrcweir			if a database access error occurs.
122cdf0e10cSrcweir	 */
123cdf0e10cSrcweir	void writeShort([in]short x) raises (SQLException);
124cdf0e10cSrcweir  	//-------------------------------------------------------------------------
125cdf0e10cSrcweir
126cdf0e10cSrcweir	/** writes the next attribute to the stream as long.
127cdf0e10cSrcweir		@param x
128cdf0e10cSrcweir			the value to pass to the database.
129cdf0e10cSrcweir		@throws SQLException
130cdf0e10cSrcweir			if a database access error occurs.
131cdf0e10cSrcweir	 */
132cdf0e10cSrcweir	void writeInt([in]long x) raises (SQLException);
133cdf0e10cSrcweir  	//-------------------------------------------------------------------------
134cdf0e10cSrcweir
135cdf0e10cSrcweir	/** writes the next attribute to the stream as hyper.
136cdf0e10cSrcweir		@param x
137cdf0e10cSrcweir			the value to pass to the database.
138cdf0e10cSrcweir		@throws SQLException
139cdf0e10cSrcweir			if a database access error occurs.
140cdf0e10cSrcweir	 */
141cdf0e10cSrcweir	void writeLong([in]hyper x) raises (SQLException);
142cdf0e10cSrcweir  	//-------------------------------------------------------------------------
143cdf0e10cSrcweir
144cdf0e10cSrcweir	/** writes the next attribute to the stream as float.
145cdf0e10cSrcweir		@param x
146cdf0e10cSrcweir			the value to pass to the database.
147cdf0e10cSrcweir		@throws SQLException
148cdf0e10cSrcweir			if a database access error occurs.
149cdf0e10cSrcweir	 */
150cdf0e10cSrcweir	void writeFloat([in]float x) raises (SQLException);
151cdf0e10cSrcweir  	//-------------------------------------------------------------------------
152cdf0e10cSrcweir
153cdf0e10cSrcweir	/** writes the next attribute to the stream as double.
154cdf0e10cSrcweir		@param x
155cdf0e10cSrcweir			the value to pass to the database.
156cdf0e10cSrcweir		@throws SQLException
157cdf0e10cSrcweir			if a database access error occurs.
158cdf0e10cSrcweir	 */
159cdf0e10cSrcweir	void writeDouble([in]double x) raises (SQLException);
160cdf0e10cSrcweir  	//-------------------------------------------------------------------------
161cdf0e10cSrcweir
162cdf0e10cSrcweir	/** writes the next attribute to the stream as byte sequence.
163cdf0e10cSrcweir		@param x
164cdf0e10cSrcweir			the value to pass to the database.
165cdf0e10cSrcweir		@throws SQLException
166cdf0e10cSrcweir			if a database access error occurs.
167cdf0e10cSrcweir	 */
168cdf0e10cSrcweir	void writeBytes([in]sequence<byte> x) raises (SQLException);
169cdf0e10cSrcweir  	//-------------------------------------------------------------------------
170cdf0e10cSrcweir
171cdf0e10cSrcweir	/** writes the next attribute to the stream as a date.
172cdf0e10cSrcweir		@param x
173cdf0e10cSrcweir			the value to pass to the database.
174cdf0e10cSrcweir		@throws SQLException
175cdf0e10cSrcweir			if a database access error occurs.
176cdf0e10cSrcweir	 */
177cdf0e10cSrcweir	void writeDate([in]com::sun::star::util::Date x) raises (SQLException);
178cdf0e10cSrcweir  	//-------------------------------------------------------------------------
179cdf0e10cSrcweir
180cdf0e10cSrcweir	/** writes the next attribute to the stream as a time.
181cdf0e10cSrcweir		@param x
182cdf0e10cSrcweir			the value to pass to the database.
183cdf0e10cSrcweir		@throws SQLException
184cdf0e10cSrcweir			if a database access error occurs.
185cdf0e10cSrcweir	 */
186cdf0e10cSrcweir	void writeTime([in]com::sun::star::util::Time x) raises (SQLException);
187cdf0e10cSrcweir  	//-------------------------------------------------------------------------
188cdf0e10cSrcweir
189cdf0e10cSrcweir	/** writes the next attribute to the stream as a datetime.
190cdf0e10cSrcweir		@param x
191cdf0e10cSrcweir			the value to pass to the database.
192cdf0e10cSrcweir		@throws SQLException
193cdf0e10cSrcweir			if a database access error occurs.
194cdf0e10cSrcweir	 */
195cdf0e10cSrcweir	void writeTimestamp([in]com::sun::star::util::DateTime x)
196cdf0e10cSrcweir		raises (SQLException);
197cdf0e10cSrcweir  	//-------------------------------------------------------------------------
198cdf0e10cSrcweir
199cdf0e10cSrcweir	/** writes the next attribute to the stream as a stream of uninterpreted
200cdf0e10cSrcweir		bytes.
201cdf0e10cSrcweir		@param x
202cdf0e10cSrcweir			the value to pass to the database.
203cdf0e10cSrcweir		@throws SQLException
204cdf0e10cSrcweir			if a database access error occurs.
205cdf0e10cSrcweir	 */
206cdf0e10cSrcweir	void writeBinaryStream([in]com::sun::star::io::XInputStream x)
207cdf0e10cSrcweir		raises (SQLException);
208cdf0e10cSrcweir  	//-------------------------------------------------------------------------
209cdf0e10cSrcweir
210cdf0e10cSrcweir	/** writes the next attribute to the stream as a stream of unicode string.
211cdf0e10cSrcweir		@param x
212cdf0e10cSrcweir			the value to pass to the database.
213cdf0e10cSrcweir		@throws SQLException
214cdf0e10cSrcweir			if a database access error occurs.
215cdf0e10cSrcweir	 */
216cdf0e10cSrcweir	void writeCharacterStream([in]com::sun::star::io::XInputStream x)
217cdf0e10cSrcweir		raises (SQLException);
218cdf0e10cSrcweir	//-------------------------------------------------------------------------
219cdf0e10cSrcweir
220cdf0e10cSrcweir	/** writes to the stream the data contained in the given
221cdf0e10cSrcweir		<code>XSQLData</code> object.
222cdf0e10cSrcweir
223cdf0e10cSrcweir
224cdf0e10cSrcweir		<p
225cdf0e10cSrcweir		>When the
226cdf0e10cSrcweir		<code>XSQLData</code>
227cdf0e10cSrcweir		object is
228cdf0e10cSrcweir		<NULL/>
229cdf0e10cSrcweir		, this method writes an SQL NULL to the stream.
230cdf0e10cSrcweir		Otherwise, it calls the
231cdf0e10cSrcweir		<member scope="com::sun::star::sdbc">XSQLData::writeSQL()</member>
232cdf0e10cSrcweir		method of the given object, which
233cdf0e10cSrcweir		writes the object's attributes to the stream.
234cdf0e10cSrcweir		The implementation of the method
235cdf0e10cSrcweir		<code>XSQLData::writeSQL()</code>
236cdf0e10cSrcweir		calls the appropriate
237cdf0e10cSrcweir		<code>XSQLOutput.writeXXX</code>
238cdf0e10cSrcweir		method(s) for writing each of the object's attributes in order.
239cdf0e10cSrcweir		<br/>
240cdf0e10cSrcweir		The attributes must be read from an
241cdf0e10cSrcweir		<type scope="com::sun::star::sdbc">XSQLInput</type>
242cdf0e10cSrcweir		input stream and written to an
243cdf0e10cSrcweir		<code>XSQLOutput</code>
244cdf0e10cSrcweir		output stream in the same order in which they were
245cdf0e10cSrcweir		listed in the SQL definition of the user-defined type.
246cdf0e10cSrcweir		</p>
247cdf0e10cSrcweir		@param x
248cdf0e10cSrcweir			the value to pass to the database.
249cdf0e10cSrcweir		@throws SQLException
250cdf0e10cSrcweir			if a database access error occurs.
251cdf0e10cSrcweir	 */
252cdf0e10cSrcweir	void writeObject([in]XSQLData x) raises (SQLException);
253cdf0e10cSrcweir  	//-------------------------------------------------------------------------
254cdf0e10cSrcweir
255cdf0e10cSrcweir	/** writes a REF(&amp;lt;structured-type&amp;gt;) to the stream.
256cdf0e10cSrcweir		@param x
257cdf0e10cSrcweir			the value to pass to the database.
258cdf0e10cSrcweir		@throws SQLException
259cdf0e10cSrcweir			if a database access error occurs.
260cdf0e10cSrcweir	 */
261cdf0e10cSrcweir	void writeRef([in]XRef x) raises (SQLException);
262cdf0e10cSrcweir  	//-------------------------------------------------------------------------
263cdf0e10cSrcweir
264cdf0e10cSrcweir	/** writes a BLOB to the stream.
265cdf0e10cSrcweir		@param x
266cdf0e10cSrcweir			the value to pass to the database.
267cdf0e10cSrcweir		@throws SQLException
268cdf0e10cSrcweir			if a database access error occurs.
269cdf0e10cSrcweir	 */
270cdf0e10cSrcweir	void writeBlob([in]XBlob x) raises (SQLException);
271cdf0e10cSrcweir	//-------------------------------------------------------------------------
272cdf0e10cSrcweir
273cdf0e10cSrcweir	/** writes a CLOB to the stream.
274cdf0e10cSrcweir		@param x
275cdf0e10cSrcweir			the value to pass to the database.
276cdf0e10cSrcweir		@throws SQLException
277cdf0e10cSrcweir			if a database access error occurs.
278cdf0e10cSrcweir	 */
279cdf0e10cSrcweir	void writeClob([in]XClob x) raises (SQLException);
280cdf0e10cSrcweir	//-------------------------------------------------------------------------
281cdf0e10cSrcweir
282cdf0e10cSrcweir	/** writes a structured-type to the stream.
283cdf0e10cSrcweir		@param x
284cdf0e10cSrcweir			the value to pass to the database.
285cdf0e10cSrcweir		@throws SQLException
286cdf0e10cSrcweir			if a database access error occurs.
287cdf0e10cSrcweir	 */
288cdf0e10cSrcweir	void writeStruct([in]XStruct x) raises (SQLException);
289cdf0e10cSrcweir	//-------------------------------------------------------------------------
290cdf0e10cSrcweir
291cdf0e10cSrcweir	/** writes an array to the stream.
292cdf0e10cSrcweir		@param x
293cdf0e10cSrcweir			the value to pass to the database.
294cdf0e10cSrcweir		@throws SQLException
295cdf0e10cSrcweir			if a database access error occurs.
296cdf0e10cSrcweir	 */
297cdf0e10cSrcweir	void writeArray([in]XArray x) raises (SQLException);
298cdf0e10cSrcweir};
299cdf0e10cSrcweir
300cdf0e10cSrcweir//=============================================================================
301cdf0e10cSrcweir
302cdf0e10cSrcweir}; }; }; };
303cdf0e10cSrcweir
304cdf0e10cSrcweir/*===========================================================================
305cdf0e10cSrcweir===========================================================================*/
306cdf0e10cSrcweir#endif
307