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: XSQLInput.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_XSQLInput_idl__
31 #define __com_sun_star_sdbc_XSQLInput_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
;
65 /** represents an input stream that contains a stream of values representing an
66 instance of a SQL structured or distinct type.
70 This interface, used only for custom mapping, is used by the driver
71 behind the scenes, and a programmer never directly invokes
77 <code>getObject</code>
78 is called with an object of a service implementing the interface
80 , the SDBC driver calls the method
81 <member scope="com::sun::star::sdbc">XSQLData::getSQLType()</member>
82 to determine the SQL type of the user-defined type (UDT) being custom mapped.
83 The driver creates an instance of
84 <type scope="com::sun::star::sdbc">XSQLInput</type>
86 populating it with the attributes of the UDT. The driver then passes the input
88 <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
89 , which in turn calls the
90 <code>XSQLInput.readXXX</code>
91 methods in its implementation for reading the attributes from the input stream.
94 published
interface XSQLInput
: com
::sun
::star
::uno
::XInterface
97 /** reads the next attribute in the stream as string.
99 the attribute; if the value is SQL NULL, return null.
101 if a database access error occurs.
103 string readString
() raises
(SQLException
);
104 //-------------------------------------------------------------------------
106 /** reads the next attribute in the stream as boolean.
108 the attribute; if the value is SQL NULL, return null.
110 if a database access error occurs.
112 boolean readBoolean
() raises
(SQLException
);
113 //-------------------------------------------------------------------------
115 /** reads the next attribute in the stream as byte.
117 the attribute; if the value is SQL NULL, return null.
119 if a database access error occurs.
121 byte readByte
() raises
(SQLException
);
122 //-------------------------------------------------------------------------
124 /** reads the next attribute in the stream as short.
126 the attribute; if the value is SQL NULL, return null.
128 if a database access error occurs.
130 short readShort
() raises
(SQLException
);
131 //-------------------------------------------------------------------------
133 /** reads the next attribute in the stream as long.
135 the attribute; if the value is SQL NULL, return null.
137 if a database access error occurs.
139 long readInt
() raises
(SQLException
);
140 //-------------------------------------------------------------------------
142 /** reads the next attribute in the stream as hyper.
144 the attribute; if the value is SQL NULL, return null.
146 if a database access error occurs.
148 hyper readLong
() raises
(SQLException
);
149 //-------------------------------------------------------------------------
151 /** reads the next attribute in the stream as float.
153 the attribute; if the value is SQL NULL, return null.
155 if a database access error occurs.
157 float readFloat
() raises
(SQLException
);
158 //-------------------------------------------------------------------------
160 /** reads the next attribute in the stream as double.
162 the attribute; if the value is SQL NULL, return null.
164 if a database access error occurs.
166 double readDouble
() raises
(SQLException
);
167 //-------------------------------------------------------------------------
169 /** reads the next attribute in the stream as sequence of bytes.
171 the attribute; if the value is SQL NULL, return null.
173 if a database access error occurs.
175 sequence
<byte> readBytes
() raises
(SQLException
);
176 //-------------------------------------------------------------------------
178 /** reads the next attribute in the stream as date.
180 the attribute; if the value is SQL NULL, return null.
182 if a database access error occurs.
184 com
::sun
::star
::util
::Date readDate
() raises
(SQLException
);
185 //-------------------------------------------------------------------------
187 /** reads the next attribute in the stream as time.
189 the attribute; if the value is SQL NULL, return null.
191 if a database access error occurs.
193 com
::sun
::star
::util
::Time readTime
() raises
(SQLException
);
194 //-------------------------------------------------------------------------
196 /** reads the next attribute in the stream as datetime.
198 the attribute; if the value is SQL NULL, return null.
200 if a database access error occurs.
202 com
::sun
::star
::util
::DateTime readTimestamp
() raises
(SQLException
);
203 //-------------------------------------------------------------------------
205 /** reads the next attribute in the stream as sequence of bytes.
207 the attribute; if the value is SQL NULL, return null.
209 if a database access error occurs.
211 com
::sun
::star
::io
::XInputStream readBinaryStream
() raises
(SQLException
);
212 //-------------------------------------------------------------------------
214 /** reads the next attribute in the stream as a unicode string.
216 the attribute; if the value is SQL NULL, return null.
218 if a database access error occurs.
220 com
::sun
::star
::io
::XInputStream readCharacterStream
() raises
(SQLException
);
221 //-------------------------------------------------------------------------
223 /** returns the datum at the head of the stream as an any.
227 The actual type of the any returned is determined by the default
228 type mapping, and any customizations present in this stream's type map.
231 A type map is registered with the stream by the SDBC driver before the
232 stream is passed to the application.
235 When the datum at the head of the stream is a SQL NULL,
236 the method returns <void/>. If the datum is a SQL structured or distinct
237 type, it determines the SQL type of the datum at the head of the stream,
238 constructs an object of the appropriate service, and calls the method
239 <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
240 on that object, which reads additional data
241 from the stream using the protocol described for that method.
245 the attribute; if the value is SQL NULL, return null.
247 if a database access error occurs.
249 any readObject
() raises
(SQLException
);
250 //-------------------------------------------------------------------------
252 /** reads a REF(&lt;structured-type&gt;) from the stream.
254 the attribute; if the value is SQL NULL, return null.
256 if a database access error occurs.
258 XRef readRef
() raises
(SQLException
);
259 //-------------------------------------------------------------------------
261 /** reads a BLOB from the stream.
263 the attribute; if the value is SQL NULL, return null.
265 if a database access error occurs.
267 XBlob readBlob
() raises
(SQLException
);
268 //-------------------------------------------------------------------------
270 /** reads a CLOB from the stream.
272 the attribute; if the value is SQL NULL, return null.
274 if a database access error occurs.
276 XClob readClob
() raises
(SQLException
);
277 //-------------------------------------------------------------------------
279 /** reads an array from the stream.
281 the attribute; if the value is SQL NULL, return null.
283 if a database access error occurs.
285 XArray readArray
() raises
(SQLException
);
286 //-------------------------------------------------------------------------
288 /** determines whether the last value read was null.
290 <TRUE/> if the most recently gotten SQL value was null; otherwise, <FALSE/>
292 if a database access error occurs.
294 boolean wasNull
() raises
(SQLException
);
297 //=============================================================================
301 /*===========================================================================
302 ===========================================================================*/