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
>
34 #ifndef __com_sun_star_util_Date_idl__
35 #include
<com
/sun
/star
/util
/Date.idl
>
38 #ifndef __com_sun_star_util_DateTime_idl__
39 #include
<com
/sun
/star
/util
/DateTime.idl
>
42 #ifndef __com_sun_star_util_Time_idl__
43 #include
<com
/sun
/star
/util
/Time.idl
>
46 module com
{ module sun
{ module star
{ module io
{
47 published
interface XInputStream
;
50 #ifndef __com_sun_star_sdbc_SQLException_idl__
51 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
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
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.
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>
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>
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.
96 the value to pass to the database.
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.
105 the value to pass to the database.
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.
114 the value to pass to the database.
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.
123 the value to pass to the database.
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.
132 the value to pass to the database.
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.
141 the value to pass to the database.
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.
150 the value to pass to the database.
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.
159 the value to pass to the database.
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.
168 the value to pass to the database.
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.
177 the value to pass to the database.
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.
186 the value to pass to the database.
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.
195 the value to pass to the database.
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
206 the value to pass to the database.
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.
216 the value to pass to the database.
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.
230 <code>XSQLData</code>
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.
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.
252 the value to pass to the database.
254 if a database access error occurs.
256 void writeObject
([in]XSQLData x
) raises
(SQLException
);
257 //-------------------------------------------------------------------------
259 /** writes a REF(&lt;structured-type&gt;) to the stream.
261 the value to pass to the database.
263 if a database access error occurs.
265 void writeRef
([in]XRef x
) raises
(SQLException
);
266 //-------------------------------------------------------------------------
268 /** writes a BLOB to the stream.
270 the value to pass to the database.
272 if a database access error occurs.
274 void writeBlob
([in]XBlob x
) raises
(SQLException
);
275 //-------------------------------------------------------------------------
277 /** writes a CLOB to the stream.
279 the value to pass to the database.
281 if a database access error occurs.
283 void writeClob
([in]XClob x
) raises
(SQLException
);
284 //-------------------------------------------------------------------------
286 /** writes a structured-type to the stream.
288 the value to pass to the database.
290 if a database access error occurs.
292 void writeStruct
([in]XStruct x
) raises
(SQLException
);
293 //-------------------------------------------------------------------------
295 /** writes an array to the stream.
297 the value to pass to the database.
299 if a database access error occurs.
301 void writeArray
([in]XArray x
) raises
(SQLException
);
304 //=============================================================================
308 /*===========================================================================
309 ===========================================================================*/