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
;
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
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.
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>
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>
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.
87 the value to pass to the database.
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.
96 the value to pass to the database.
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.
105 the value to pass to the database.
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.
114 the value to pass to the database.
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.
123 the value to pass to the database.
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.
132 the value to pass to the database.
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.
141 the value to pass to the database.
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.
150 the value to pass to the database.
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.
159 the value to pass to the database.
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.
168 the value to pass to the database.
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.
177 the value to pass to the database.
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.
186 the value to pass to the database.
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
197 the value to pass to the database.
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.
207 the value to pass to the database.
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.
221 <code>XSQLData</code>
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.
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.
243 the value to pass to the database.
245 if a database access error occurs.
247 void writeObject
([in]XSQLData x
) raises
(SQLException
);
248 //-------------------------------------------------------------------------
250 /** writes a REF(&lt;structured-type&gt;) to the stream.
252 the value to pass to the database.
254 if a database access error occurs.
256 void writeRef
([in]XRef x
) raises
(SQLException
);
257 //-------------------------------------------------------------------------
259 /** writes a BLOB to the stream.
261 the value to pass to the database.
263 if a database access error occurs.
265 void writeBlob
([in]XBlob x
) raises
(SQLException
);
266 //-------------------------------------------------------------------------
268 /** writes a CLOB to the stream.
270 the value to pass to the database.
272 if a database access error occurs.
274 void writeClob
([in]XClob x
) raises
(SQLException
);
275 //-------------------------------------------------------------------------
277 /** writes a structured-type to the stream.
279 the value to pass to the database.
281 if a database access error occurs.
283 void writeStruct
([in]XStruct x
) raises
(SQLException
);
284 //-------------------------------------------------------------------------
286 /** writes an array to the stream.
288 the value to pass to the database.
290 if a database access error occurs.
292 void writeArray
([in]XArray x
) raises
(SQLException
);
295 //=============================================================================
299 /*===========================================================================
300 ===========================================================================*/
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */