1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef __com_sun_star_sdbc_XSQLInput_idl__
29 #define __com_sun_star_sdbc_XSQLInput_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
33 #include
<com
/sun
/star
/util
/Date.idl
>
35 #include
<com
/sun
/star
/util
/DateTime.idl
>
37 #include
<com
/sun
/star
/util
/Time.idl
>
39 module com
{ module sun
{ module star
{ module io
{
40 published
interface XInputStream
;
43 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
45 module com
{ module sun
{ module star
{ module sdbc
{
47 published
interface XRef
;
48 published
interface XArray
;
49 published
interface XBlob
;
50 published
interface XClob
;
53 /** represents an input stream that contains a stream of values representing an
54 instance of a SQL structured or distinct type.
58 This interface, used only for custom mapping, is used by the driver
59 behind the scenes, and a programmer never directly invokes
65 <code>getObject</code>
66 is called with an object of a service implementing the interface
68 , the SDBC driver calls the method
69 <member scope="com::sun::star::sdbc">XSQLData::getSQLType()</member>
70 to determine the SQL type of the user-defined type (UDT) being custom mapped.
71 The driver creates an instance of
72 <type scope="com::sun::star::sdbc">XSQLInput</type>
74 populating it with the attributes of the UDT. The driver then passes the input
76 <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
77 , which in turn calls the
78 <code>XSQLInput.readXXX</code>
79 methods in its implementation for reading the attributes from the input stream.
82 published
interface XSQLInput
: com
::sun
::star
::uno
::XInterface
85 /** reads the next attribute in the stream as string.
87 the attribute; if the value is SQL NULL, return null.
89 if a database access error occurs.
91 string readString
() raises
(SQLException
);
92 //-------------------------------------------------------------------------
94 /** reads the next attribute in the stream as boolean.
96 the attribute; if the value is SQL NULL, return null.
98 if a database access error occurs.
100 boolean readBoolean
() raises
(SQLException
);
101 //-------------------------------------------------------------------------
103 /** reads the next attribute in the stream as byte.
105 the attribute; if the value is SQL NULL, return null.
107 if a database access error occurs.
109 byte readByte
() raises
(SQLException
);
110 //-------------------------------------------------------------------------
112 /** reads the next attribute in the stream as short.
114 the attribute; if the value is SQL NULL, return null.
116 if a database access error occurs.
118 short readShort
() raises
(SQLException
);
119 //-------------------------------------------------------------------------
121 /** reads the next attribute in the stream as long.
123 the attribute; if the value is SQL NULL, return null.
125 if a database access error occurs.
127 long readInt
() raises
(SQLException
);
128 //-------------------------------------------------------------------------
130 /** reads the next attribute in the stream as hyper.
132 the attribute; if the value is SQL NULL, return null.
134 if a database access error occurs.
136 hyper readLong
() raises
(SQLException
);
137 //-------------------------------------------------------------------------
139 /** reads the next attribute in the stream as float.
141 the attribute; if the value is SQL NULL, return null.
143 if a database access error occurs.
145 float readFloat
() raises
(SQLException
);
146 //-------------------------------------------------------------------------
148 /** reads the next attribute in the stream as double.
150 the attribute; if the value is SQL NULL, return null.
152 if a database access error occurs.
154 double readDouble
() raises
(SQLException
);
155 //-------------------------------------------------------------------------
157 /** reads the next attribute in the stream as sequence of bytes.
159 the attribute; if the value is SQL NULL, return null.
161 if a database access error occurs.
163 sequence
<byte> readBytes
() raises
(SQLException
);
164 //-------------------------------------------------------------------------
166 /** reads the next attribute in the stream as date.
168 the attribute; if the value is SQL NULL, return null.
170 if a database access error occurs.
172 com
::sun
::star
::util
::Date readDate
() raises
(SQLException
);
173 //-------------------------------------------------------------------------
175 /** reads the next attribute in the stream as time.
177 the attribute; if the value is SQL NULL, return null.
179 if a database access error occurs.
181 com
::sun
::star
::util
::Time readTime
() raises
(SQLException
);
182 //-------------------------------------------------------------------------
184 /** reads the next attribute in the stream as datetime.
186 the attribute; if the value is SQL NULL, return null.
188 if a database access error occurs.
190 com
::sun
::star
::util
::DateTime readTimestamp
() raises
(SQLException
);
191 //-------------------------------------------------------------------------
193 /** reads the next attribute in the stream as sequence of bytes.
195 the attribute; if the value is SQL NULL, return null.
197 if a database access error occurs.
199 com
::sun
::star
::io
::XInputStream readBinaryStream
() raises
(SQLException
);
200 //-------------------------------------------------------------------------
202 /** reads the next attribute in the stream as a Unicode string.
204 the attribute; if the value is SQL NULL, return null.
206 if a database access error occurs.
208 com
::sun
::star
::io
::XInputStream readCharacterStream
() raises
(SQLException
);
209 //-------------------------------------------------------------------------
211 /** returns the datum at the head of the stream as an any.
215 The actual type of the any returned is determined by the default
216 type mapping, and any customizations present in this stream's type map.
219 A type map is registered with the stream by the SDBC driver before the
220 stream is passed to the application.
223 When the datum at the head of the stream is a SQL NULL,
224 the method returns <void/>. If the datum is a SQL structured or distinct
225 type, it determines the SQL type of the datum at the head of the stream,
226 constructs an object of the appropriate service, and calls the method
227 <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
228 on that object, which reads additional data
229 from the stream using the protocol described for that method.
233 the attribute; if the value is SQL NULL, return null.
235 if a database access error occurs.
237 any readObject
() raises
(SQLException
);
238 //-------------------------------------------------------------------------
240 /** reads a REF(&lt;structured-type&gt;) from the stream.
242 the attribute; if the value is SQL NULL, return null.
244 if a database access error occurs.
246 XRef readRef
() raises
(SQLException
);
247 //-------------------------------------------------------------------------
249 /** reads a BLOB from the stream.
251 the attribute; if the value is SQL NULL, return null.
253 if a database access error occurs.
255 XBlob readBlob
() raises
(SQLException
);
256 //-------------------------------------------------------------------------
258 /** reads a CLOB from the stream.
260 the attribute; if the value is SQL NULL, return null.
262 if a database access error occurs.
264 XClob readClob
() raises
(SQLException
);
265 //-------------------------------------------------------------------------
267 /** reads an array from the stream.
269 the attribute; if the value is SQL NULL, return null.
271 if a database access error occurs.
273 XArray readArray
() raises
(SQLException
);
274 //-------------------------------------------------------------------------
276 /** determines whether the last value read was null.
278 <TRUE/> if the most recently gotten SQL value was null; otherwise, <FALSE/>
280 if a database access error occurs.
282 boolean wasNull
() raises
(SQLException
);
285 //=============================================================================
289 /*===========================================================================
290 ===========================================================================*/
293 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */