1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSQLOutput.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_sdbc_XSQLOutput_idl__
31 #define __com_sun_star_sdbc_XSQLOutput_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_util_Date_idl__
38 #include
<com
/sun
/star
/util
/Date.idl
>
41 #ifndef __com_sun_star_util_DateTime_idl__
42 #include
<com
/sun
/star
/util
/DateTime.idl
>
45 #ifndef __com_sun_star_util_Time_idl__
46 #include
<com
/sun
/star
/util
/Time.idl
>
49 module com
{ module sun
{ module star
{ module io
{
50 published
interface XInputStream
;
53 #ifndef __com_sun_star_sdbc_SQLException_idl__
54 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
57 module com
{ module sun
{ module star
{ module sdbc
{
59 published
interface XRef
;
60 published
interface XArray
;
61 published
interface XBlob
;
62 published
interface XClob
;
63 published
interface XStruct
;
64 published
interface XSQLData
;
67 /** is used as an output stream for writing the attributes of a user-defined
68 type back to the database. This interface, used only for custom mapping,
69 is used by the driver, and its methods are never directly invoked
74 When an object of a class implementing interface
75 <type scope="com::sun::star::sdbc">XSQLData</type>
76 is passed as an argument to a SQL statement, the JDBC driver calls
77 <method scope="com::sun::star::sdbc">SQLData::getSQLType</method>
78 to determine the kind of SQL datum being passed to the database.
80 The driver then creates an instance of
81 <code>XSQLOutput</code>
82 and passes it to the method
83 <method scope="com::sun::star::sdbc">XSQLData::writeSQL</method>
86 in turn calls the appropriate
87 <code>XSQLOutput.writeXXX</code>
88 methods to write data from the
89 <type scope="com::sun::star::sdbc">XSQLData</type>
91 <code>XSQLOutput</code>
92 output stream as the representation of a SQL user-defined type.</p>
94 published
interface XSQLOutput
: com
::sun
::star
::uno
::XInterface
97 /** writes the next attribute to the stream as a string.
99 the value to pass to the database.
101 if a database access error occurs.
103 void writeString
([in]string x
) raises
(SQLException
);
104 //-------------------------------------------------------------------------
106 /** writes the next attribute to the stream as boolean.
108 the value to pass to the database.
110 if a database access error occurs.
112 void writeBoolean
([in]boolean x
) raises
(SQLException
);
113 //-------------------------------------------------------------------------
115 /** writes the next attribute to the stream as byte.
117 the value to pass to the database.
119 if a database access error occurs.
121 void writeByte
([in]byte x
) raises
(SQLException
);
122 //-------------------------------------------------------------------------
124 /** writes the next attribute to the stream as short.
126 the value to pass to the database.
128 if a database access error occurs.
130 void writeShort
([in]short x
) raises
(SQLException
);
131 //-------------------------------------------------------------------------
133 /** writes the next attribute to the stream as long.
135 the value to pass to the database.
137 if a database access error occurs.
139 void writeInt
([in]long x
) raises
(SQLException
);
140 //-------------------------------------------------------------------------
142 /** writes the next attribute to the stream as hyper.
144 the value to pass to the database.
146 if a database access error occurs.
148 void writeLong
([in]hyper x
) raises
(SQLException
);
149 //-------------------------------------------------------------------------
151 /** writes the next attribute to the stream as float.
153 the value to pass to the database.
155 if a database access error occurs.
157 void writeFloat
([in]float x
) raises
(SQLException
);
158 //-------------------------------------------------------------------------
160 /** writes the next attribute to the stream as double.
162 the value to pass to the database.
164 if a database access error occurs.
166 void writeDouble
([in]double x
) raises
(SQLException
);
167 //-------------------------------------------------------------------------
169 /** writes the next attribute to the stream as byte sequence.
171 the value to pass to the database.
173 if a database access error occurs.
175 void writeBytes
([in]sequence
<byte> x
) raises
(SQLException
);
176 //-------------------------------------------------------------------------
178 /** writes the next attribute to the stream as a date.
180 the value to pass to the database.
182 if a database access error occurs.
184 void writeDate
([in]com
::sun
::star
::util
::Date x
) raises
(SQLException
);
185 //-------------------------------------------------------------------------
187 /** writes the next attribute to the stream as a time.
189 the value to pass to the database.
191 if a database access error occurs.
193 void writeTime
([in]com
::sun
::star
::util
::Time x
) raises
(SQLException
);
194 //-------------------------------------------------------------------------
196 /** writes the next attribute to the stream as a datetime.
198 the value to pass to the database.
200 if a database access error occurs.
202 void writeTimestamp
([in]com
::sun
::star
::util
::DateTime x
)
203 raises
(SQLException
);
204 //-------------------------------------------------------------------------
206 /** writes the next attribute to the stream as a stream of uninterpreted
209 the value to pass to the database.
211 if a database access error occurs.
213 void writeBinaryStream
([in]com
::sun
::star
::io
::XInputStream x
)
214 raises
(SQLException
);
215 //-------------------------------------------------------------------------
217 /** writes the next attribute to the stream as a stream of unicode string.
219 the value to pass to the database.
221 if a database access error occurs.
223 void writeCharacterStream
([in]com
::sun
::star
::io
::XInputStream x
)
224 raises
(SQLException
);
225 //-------------------------------------------------------------------------
227 /** writes to the stream the data contained in the given
228 <code>XSQLData</code> object.
233 <code>XSQLData</code>
236 , this method writes an SQL NULL to the stream.
237 Otherwise, it calls the
238 <member scope="com::sun::star::sdbc">XSQLData::writeSQL()</member>
239 method of the given object, which
240 writes the object's attributes to the stream.
241 The implementation of the method
242 <code>XSQLData::writeSQL()</code>
243 calls the appropriate
244 <code>XSQLOutput.writeXXX</code>
245 method(s) for writing each of the object's attributes in order.
247 The attributes must be read from an
248 <type scope="com::sun::star::sdbc">XSQLInput</type>
249 input stream and written to an
250 <code>XSQLOutput</code>
251 output stream in the same order in which they were
252 listed in the SQL definition of the user-defined type.
255 the value to pass to the database.
257 if a database access error occurs.
259 void writeObject
([in]XSQLData x
) raises
(SQLException
);
260 //-------------------------------------------------------------------------
262 /** writes a REF(&lt;structured-type&gt;) to the stream.
264 the value to pass to the database.
266 if a database access error occurs.
268 void writeRef
([in]XRef x
) raises
(SQLException
);
269 //-------------------------------------------------------------------------
271 /** writes a BLOB to the stream.
273 the value to pass to the database.
275 if a database access error occurs.
277 void writeBlob
([in]XBlob x
) raises
(SQLException
);
278 //-------------------------------------------------------------------------
280 /** writes a CLOB to the stream.
282 the value to pass to the database.
284 if a database access error occurs.
286 void writeClob
([in]XClob x
) raises
(SQLException
);
287 //-------------------------------------------------------------------------
289 /** writes a structured-type to the stream.
291 the value to pass to the database.
293 if a database access error occurs.
295 void writeStruct
([in]XStruct x
) raises
(SQLException
);
296 //-------------------------------------------------------------------------
298 /** writes an array to the stream.
300 the value to pass to the database.
302 if a database access error occurs.
304 void writeArray
([in]XArray x
) raises
(SQLException
);
307 //=============================================================================
311 /*===========================================================================
312 ===========================================================================*/