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 .
20 module com
{ module sun
{ module star
{ module io
{
21 published
interface XInputStream
;
24 module com
{ module sun
{ module star
{ module sdbc
{
26 published
interface XRef
;
27 published
interface XArray
;
28 published
interface XBlob
;
29 published
interface XClob
;
30 published
interface XStruct
;
31 published
interface XSQLData
;
34 /** is used as an output stream for writing the attributes of a user-defined
35 type back to the database. This interface, used only for custom mapping,
36 is used by the driver, and its methods are never directly invoked
41 When an object of a class implementing interface
42 com::sun::star::sdbc::XSQLData
43 is passed as an argument to a SQL statement, the JDBC driver calls
44 com::sun::star::sdbc::SQLData::getSQLType()
45 to determine the kind of SQL datum being passed to the database.
47 The driver then creates an instance of
48 <code>XSQLOutput</code>
49 and passes it to the method
50 com::sun::star::sdbc::XSQLData::writeSQL()
53 in turn calls the appropriate
54 <code>XSQLOutput.writeXXX</code>
55 methods to write data from the
56 com::sun::star::sdbc::XSQLData
58 <code>XSQLOutput</code>
59 output stream as the representation of a SQL user-defined type.</p>
61 published
interface XSQLOutput
: com
::sun
::star
::uno
::XInterface
64 /** writes the next attribute to the stream as a string.
66 the value to pass to the database.
68 if a database access error occurs.
70 void writeString
([in]string x
) raises
(SQLException
);
72 /** writes the next attribute to the stream as boolean.
74 the value to pass to the database.
76 if a database access error occurs.
78 void writeBoolean
([in]boolean x
) raises
(SQLException
);
80 /** writes the next attribute to the stream as byte.
82 the value to pass to the database.
84 if a database access error occurs.
86 void writeByte
([in]byte x
) raises
(SQLException
);
88 /** writes the next attribute to the stream as short.
90 the value to pass to the database.
92 if a database access error occurs.
94 void writeShort
([in]short x
) raises
(SQLException
);
96 /** writes the next attribute to the stream as long.
98 the value to pass to the database.
100 if a database access error occurs.
102 void writeInt
([in]long x
) raises
(SQLException
);
104 /** writes the next attribute to the stream as hyper.
106 the value to pass to the database.
108 if a database access error occurs.
110 void writeLong
([in]hyper x
) raises
(SQLException
);
112 /** writes the next attribute to the stream as float.
114 the value to pass to the database.
116 if a database access error occurs.
118 void writeFloat
([in]float x
) raises
(SQLException
);
120 /** writes the next attribute to the stream as double.
122 the value to pass to the database.
124 if a database access error occurs.
126 void writeDouble
([in]double x
) raises
(SQLException
);
128 /** writes the next attribute to the stream as byte sequence.
130 the value to pass to the database.
132 if a database access error occurs.
134 void writeBytes
([in]sequence
<byte> x
) raises
(SQLException
);
136 /** writes the next attribute to the stream as a date.
138 the value to pass to the database.
140 if a database access error occurs.
142 void writeDate
([in]com
::sun
::star
::util
::Date x
) raises
(SQLException
);
144 /** writes the next attribute to the stream as a time.
146 the value to pass to the database.
148 if a database access error occurs.
150 void writeTime
([in]com
::sun
::star
::util
::Time x
) raises
(SQLException
);
152 /** writes the next attribute to the stream as a datetime.
154 the value to pass to the database.
156 if a database access error occurs.
158 void writeTimestamp
([in]com
::sun
::star
::util
::DateTime x
)
159 raises
(SQLException
);
161 /** writes the next attribute to the stream as a stream of uninterpreted
164 the value to pass to the database.
166 if a database access error occurs.
168 void writeBinaryStream
([in]com
::sun
::star
::io
::XInputStream x
)
169 raises
(SQLException
);
171 /** writes the next attribute to the stream as a stream of Unicode string.
173 the value to pass to the database.
175 if a database access error occurs.
177 void writeCharacterStream
([in]com
::sun
::star
::io
::XInputStream x
)
178 raises
(SQLException
);
180 /** writes to the stream the data contained in the given
181 <code>XSQLData</code> object.
186 <code>XSQLData</code>
189 , this method writes an SQL NULL to the stream.
190 Otherwise, it calls the
191 com::sun::star::sdbc::XSQLData::writeSQL()
192 method of the given object, which
193 writes the object's attributes to the stream.
194 The implementation of the method
195 <code>XSQLData::writeSQL()</code>
196 calls the appropriate
197 <code>XSQLOutput.writeXXX</code>
198 method(s) for writing each of the object's attributes in order.
200 The attributes must be read from an
201 com::sun::star::sdbc::XSQLInput
202 input stream and written to an
203 <code>XSQLOutput</code>
204 output stream in the same order in which they were
205 listed in the SQL definition of the user-defined type.
208 the value to pass to the database.
210 if a database access error occurs.
212 void writeObject
([in]XSQLData x
) raises
(SQLException
);
214 /** writes a REF(&lt;structured-type&gt;) to the stream.
216 the value to pass to the database.
218 if a database access error occurs.
220 void writeRef
([in]XRef x
) raises
(SQLException
);
222 /** writes a BLOB to the stream.
224 the value to pass to the database.
226 if a database access error occurs.
228 void writeBlob
([in]XBlob x
) raises
(SQLException
);
230 /** writes a CLOB to the stream.
232 the value to pass to the database.
234 if a database access error occurs.
236 void writeClob
([in]XClob x
) raises
(SQLException
);
238 /** writes a structured-type to the stream.
240 the value to pass to the database.
242 if a database access error occurs.
244 void writeStruct
([in]XStruct x
) raises
(SQLException
);
246 /** writes an array to the stream.
248 the value to pass to the database.
250 if a database access error occurs.
252 void writeArray
([in]XArray x
) raises
(SQLException
);
258 /*===========================================================================
259 ===========================================================================*/
261 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */