1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
;
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
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.
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()
65 in turn calls the appropriate
66 <code>XSQLOutput.writeXXX</code>
67 methods to write data from the
68 com::sun::star::sdbc::XSQLData
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.
78 the value to pass to the database.
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.
86 the value to pass to the database.
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.
94 the value to pass to the database.
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.
102 the value to pass to the database.
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.
110 the value to pass to the database.
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.
118 the value to pass to the database.
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.
126 the value to pass to the database.
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.
134 the value to pass to the database.
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.
142 the value to pass to the database.
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.
150 the value to pass to the database.
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.
158 the value to pass to the database.
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.
166 the value to pass to the database.
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
176 the value to pass to the database.
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.
185 the value to pass to the database.
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.
198 <code>XSQLData</code>
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.
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.
220 the value to pass to the database.
222 if a database access error occurs.
224 void writeObject
([in]XSQLData x
) raises
(SQLException
);
226 /** writes a REF(&lt;structured-type&gt;) to the stream.
228 the value to pass to the database.
230 if a database access error occurs.
232 void writeRef
([in]XRef x
) raises
(SQLException
);
234 /** writes a BLOB to the stream.
236 the value to pass to the database.
238 if a database access error occurs.
240 void writeBlob
([in]XBlob x
) raises
(SQLException
);
242 /** writes a CLOB to the stream.
244 the value to pass to the database.
246 if a database access error occurs.
248 void writeClob
([in]XClob x
) raises
(SQLException
);
250 /** writes a structured-type to the stream.
252 the value to pass to the database.
254 if a database access error occurs.
256 void writeStruct
([in]XStruct x
) raises
(SQLException
);
258 /** writes an array to the stream.
260 the value to pass to the database.
262 if a database access error occurs.
264 void writeArray
([in]XArray x
) raises
(SQLException
);
270 /*===========================================================================
271 ===========================================================================*/
274 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */