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_XSQLInput_idl__
28 #define __com_sun_star_sdbc_XSQLInput_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
;
62 /** represents an input stream that contains a stream of values representing an
63 instance of a SQL structured or distinct type.
67 This interface, used only for custom mapping, is used by the driver
68 behind the scenes, and a programmer never directly invokes
74 <code>getObject</code>
75 is called with an object of a service implementing the interface
77 , the SDBC driver calls the method
78 <member scope="com::sun::star::sdbc">XSQLData::getSQLType()</member>
79 to determine the SQL type of the user-defined type (UDT) being custom mapped.
80 The driver creates an instance of
81 <type scope="com::sun::star::sdbc">XSQLInput</type>
83 populating it with the attributes of the UDT. The driver then passes the input
85 <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
86 , which in turn calls the
87 <code>XSQLInput.readXXX</code>
88 methods in its implementation for reading the attributes from the input stream.
91 published
interface XSQLInput
: com
::sun
::star
::uno
::XInterface
94 /** reads the next attribute in the stream as string.
96 the attribute; if the value is SQL NULL, return null.
98 if a database access error occurs.
100 string readString
() raises
(SQLException
);
101 //-------------------------------------------------------------------------
103 /** reads the next attribute in the stream as boolean.
105 the attribute; if the value is SQL NULL, return null.
107 if a database access error occurs.
109 boolean readBoolean
() raises
(SQLException
);
110 //-------------------------------------------------------------------------
112 /** reads the next attribute in the stream as byte.
114 the attribute; if the value is SQL NULL, return null.
116 if a database access error occurs.
118 byte readByte
() raises
(SQLException
);
119 //-------------------------------------------------------------------------
121 /** reads the next attribute in the stream as short.
123 the attribute; if the value is SQL NULL, return null.
125 if a database access error occurs.
127 short readShort
() raises
(SQLException
);
128 //-------------------------------------------------------------------------
130 /** reads the next attribute in the stream as long.
132 the attribute; if the value is SQL NULL, return null.
134 if a database access error occurs.
136 long readInt
() raises
(SQLException
);
137 //-------------------------------------------------------------------------
139 /** reads the next attribute in the stream as hyper.
141 the attribute; if the value is SQL NULL, return null.
143 if a database access error occurs.
145 hyper readLong
() raises
(SQLException
);
146 //-------------------------------------------------------------------------
148 /** reads the next attribute in the stream as float.
150 the attribute; if the value is SQL NULL, return null.
152 if a database access error occurs.
154 float readFloat
() raises
(SQLException
);
155 //-------------------------------------------------------------------------
157 /** reads the next attribute in the stream as double.
159 the attribute; if the value is SQL NULL, return null.
161 if a database access error occurs.
163 double readDouble
() raises
(SQLException
);
164 //-------------------------------------------------------------------------
166 /** reads the next attribute in the stream as sequence of bytes.
168 the attribute; if the value is SQL NULL, return null.
170 if a database access error occurs.
172 sequence
<byte> readBytes
() raises
(SQLException
);
173 //-------------------------------------------------------------------------
175 /** reads the next attribute in the stream as date.
177 the attribute; if the value is SQL NULL, return null.
179 if a database access error occurs.
181 com
::sun
::star
::util
::Date readDate
() raises
(SQLException
);
182 //-------------------------------------------------------------------------
184 /** reads the next attribute in the stream as time.
186 the attribute; if the value is SQL NULL, return null.
188 if a database access error occurs.
190 com
::sun
::star
::util
::Time readTime
() raises
(SQLException
);
191 //-------------------------------------------------------------------------
193 /** reads the next attribute in the stream as datetime.
195 the attribute; if the value is SQL NULL, return null.
197 if a database access error occurs.
199 com
::sun
::star
::util
::DateTime readTimestamp
() raises
(SQLException
);
200 //-------------------------------------------------------------------------
202 /** reads the next attribute in the stream as sequence of bytes.
204 the attribute; if the value is SQL NULL, return null.
206 if a database access error occurs.
208 com
::sun
::star
::io
::XInputStream readBinaryStream
() raises
(SQLException
);
209 //-------------------------------------------------------------------------
211 /** reads the next attribute in the stream as a unicode string.
213 the attribute; if the value is SQL NULL, return null.
215 if a database access error occurs.
217 com
::sun
::star
::io
::XInputStream readCharacterStream
() raises
(SQLException
);
218 //-------------------------------------------------------------------------
220 /** returns the datum at the head of the stream as an any.
224 The actual type of the any returned is determined by the default
225 type mapping, and any customizations present in this stream's type map.
228 A type map is registered with the stream by the SDBC driver before the
229 stream is passed to the application.
232 When the datum at the head of the stream is a SQL NULL,
233 the method returns <void/>. If the datum is a SQL structured or distinct
234 type, it determines the SQL type of the datum at the head of the stream,
235 constructs an object of the appropriate service, and calls the method
236 <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
237 on that object, which reads additional data
238 from the stream using the protocol described for that method.
242 the attribute; if the value is SQL NULL, return null.
244 if a database access error occurs.
246 any readObject
() raises
(SQLException
);
247 //-------------------------------------------------------------------------
249 /** reads a REF(&lt;structured-type&gt;) from the stream.
251 the attribute; if the value is SQL NULL, return null.
253 if a database access error occurs.
255 XRef readRef
() raises
(SQLException
);
256 //-------------------------------------------------------------------------
258 /** reads a BLOB from the stream.
260 the attribute; if the value is SQL NULL, return null.
262 if a database access error occurs.
264 XBlob readBlob
() raises
(SQLException
);
265 //-------------------------------------------------------------------------
267 /** reads a CLOB from the stream.
269 the attribute; if the value is SQL NULL, return null.
271 if a database access error occurs.
273 XClob readClob
() raises
(SQLException
);
274 //-------------------------------------------------------------------------
276 /** reads an array from the stream.
278 the attribute; if the value is SQL NULL, return null.
280 if a database access error occurs.
282 XArray readArray
() raises
(SQLException
);
283 //-------------------------------------------------------------------------
285 /** determines whether the last value read was null.
287 <TRUE/> if the most recently gotten SQL value was null; otherwise, <FALSE/>
289 if a database access error occurs.
291 boolean wasNull
() raises
(SQLException
);
294 //=============================================================================
298 /*===========================================================================
299 ===========================================================================*/