xref: /trunk/main/offapi/com/sun/star/sdbc/XSQLInput.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XSQLInput_idl__
28*cdf0e10cSrcweir#define __com_sun_star_sdbc_XSQLInput_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_util_Date_idl__
35*cdf0e10cSrcweir#include <com/sun/star/util/Date.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_util_DateTime_idl__
39*cdf0e10cSrcweir#include <com/sun/star/util/DateTime.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_util_Time_idl__
43*cdf0e10cSrcweir#include <com/sun/star/util/Time.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir module com {  module sun {  module star {  module io {
47*cdf0e10cSrcweir published interface XInputStream;
48*cdf0e10cSrcweir};};};};
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
51*cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
52*cdf0e10cSrcweir#endif
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
55*cdf0e10cSrcweir
56*cdf0e10cSrcweir published interface XRef;
57*cdf0e10cSrcweir published interface XArray;
58*cdf0e10cSrcweir published interface XBlob;
59*cdf0e10cSrcweir published interface XClob;
60*cdf0e10cSrcweir
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir/** represents an input stream that contains a stream of values representing an
63*cdf0e10cSrcweir    instance of a SQL structured or distinct type.
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir
66*cdf0e10cSrcweir    <p>
67*cdf0e10cSrcweir    This interface, used only for custom mapping, is used by the driver
68*cdf0e10cSrcweir    behind the scenes, and a programmer never directly invokes
69*cdf0e10cSrcweir    <code>SQLInput</code>
70*cdf0e10cSrcweir    methods.
71*cdf0e10cSrcweir    </p>
72*cdf0e10cSrcweir    <p>
73*cdf0e10cSrcweir    When the method
74*cdf0e10cSrcweir    <code>getObject</code>
75*cdf0e10cSrcweir    is called with an object of a service implementing the interface
76*cdf0e10cSrcweir    <code>SQLData</code>
77*cdf0e10cSrcweir    , the SDBC driver calls the method
78*cdf0e10cSrcweir    <member scope="com::sun::star::sdbc">XSQLData::getSQLType()</member>
79*cdf0e10cSrcweir    to determine the SQL type of the user-defined type (UDT) being custom mapped.
80*cdf0e10cSrcweir    The driver creates an instance of
81*cdf0e10cSrcweir    <type scope="com::sun::star::sdbc">XSQLInput</type>
82*cdf0e10cSrcweir    ,
83*cdf0e10cSrcweir    populating it with the attributes of the UDT. The driver then passes the input
84*cdf0e10cSrcweir    stream to the method
85*cdf0e10cSrcweir    <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
86*cdf0e10cSrcweir    , which in turn calls the
87*cdf0e10cSrcweir    <code>XSQLInput.readXXX</code>
88*cdf0e10cSrcweir    methods in its implementation for reading the attributes from the input stream.
89*cdf0e10cSrcweir    </p>
90*cdf0e10cSrcweir */
91*cdf0e10cSrcweirpublished interface XSQLInput: com::sun::star::uno::XInterface
92*cdf0e10cSrcweir{
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir    /** reads the next attribute in the stream as string.
95*cdf0e10cSrcweir        @returns
96*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
97*cdf0e10cSrcweir        @throws SQLException
98*cdf0e10cSrcweir            if a database access error occurs.
99*cdf0e10cSrcweir     */
100*cdf0e10cSrcweir    string readString() raises (SQLException);
101*cdf0e10cSrcweir    //-------------------------------------------------------------------------
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir    /** reads the next attribute in the stream as boolean.
104*cdf0e10cSrcweir        @returns
105*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
106*cdf0e10cSrcweir        @throws SQLException
107*cdf0e10cSrcweir            if a database access error occurs.
108*cdf0e10cSrcweir     */
109*cdf0e10cSrcweir    boolean readBoolean() raises (SQLException);
110*cdf0e10cSrcweir    //-------------------------------------------------------------------------
111*cdf0e10cSrcweir
112*cdf0e10cSrcweir    /** reads the next attribute in the stream as byte.
113*cdf0e10cSrcweir        @returns
114*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
115*cdf0e10cSrcweir        @throws SQLException
116*cdf0e10cSrcweir            if a database access error occurs.
117*cdf0e10cSrcweir     */
118*cdf0e10cSrcweir    byte readByte() raises (SQLException);
119*cdf0e10cSrcweir    //-------------------------------------------------------------------------
120*cdf0e10cSrcweir
121*cdf0e10cSrcweir    /** reads the next attribute in the stream as short.
122*cdf0e10cSrcweir        @returns
123*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
124*cdf0e10cSrcweir        @throws SQLException
125*cdf0e10cSrcweir            if a database access error occurs.
126*cdf0e10cSrcweir     */
127*cdf0e10cSrcweir    short readShort() raises (SQLException);
128*cdf0e10cSrcweir    //-------------------------------------------------------------------------
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir    /** reads the next attribute in the stream as long.
131*cdf0e10cSrcweir        @returns
132*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
133*cdf0e10cSrcweir        @throws SQLException
134*cdf0e10cSrcweir            if a database access error occurs.
135*cdf0e10cSrcweir     */
136*cdf0e10cSrcweir    long readInt() raises (SQLException);
137*cdf0e10cSrcweir    //-------------------------------------------------------------------------
138*cdf0e10cSrcweir
139*cdf0e10cSrcweir    /** reads the next attribute in the stream as hyper.
140*cdf0e10cSrcweir        @returns
141*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
142*cdf0e10cSrcweir        @throws SQLException
143*cdf0e10cSrcweir            if a database access error occurs.
144*cdf0e10cSrcweir     */
145*cdf0e10cSrcweir    hyper readLong() raises (SQLException);
146*cdf0e10cSrcweir    //-------------------------------------------------------------------------
147*cdf0e10cSrcweir
148*cdf0e10cSrcweir    /** reads the next attribute in the stream as float.
149*cdf0e10cSrcweir        @returns
150*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
151*cdf0e10cSrcweir        @throws SQLException
152*cdf0e10cSrcweir            if a database access error occurs.
153*cdf0e10cSrcweir     */
154*cdf0e10cSrcweir    float readFloat() raises (SQLException);
155*cdf0e10cSrcweir    //-------------------------------------------------------------------------
156*cdf0e10cSrcweir
157*cdf0e10cSrcweir    /** reads the next attribute in the stream as double.
158*cdf0e10cSrcweir        @returns
159*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
160*cdf0e10cSrcweir        @throws SQLException
161*cdf0e10cSrcweir            if a database access error occurs.
162*cdf0e10cSrcweir     */
163*cdf0e10cSrcweir    double readDouble() raises (SQLException);
164*cdf0e10cSrcweir    //-------------------------------------------------------------------------
165*cdf0e10cSrcweir
166*cdf0e10cSrcweir    /** reads the next attribute in the stream as sequence of bytes.
167*cdf0e10cSrcweir              @returns
168*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
169*cdf0e10cSrcweir        @throws SQLException
170*cdf0e10cSrcweir            if a database access error occurs.
171*cdf0e10cSrcweir     */
172*cdf0e10cSrcweir    sequence<byte> readBytes() raises (SQLException);
173*cdf0e10cSrcweir    //-------------------------------------------------------------------------
174*cdf0e10cSrcweir
175*cdf0e10cSrcweir    /** reads the next attribute in the stream as date.
176*cdf0e10cSrcweir        @returns
177*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
178*cdf0e10cSrcweir        @throws SQLException
179*cdf0e10cSrcweir            if a database access error occurs.
180*cdf0e10cSrcweir     */
181*cdf0e10cSrcweir    com::sun::star::util::Date readDate() raises (SQLException);
182*cdf0e10cSrcweir    //-------------------------------------------------------------------------
183*cdf0e10cSrcweir
184*cdf0e10cSrcweir    /** reads the next attribute in the stream as time.
185*cdf0e10cSrcweir        @returns
186*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
187*cdf0e10cSrcweir        @throws SQLException
188*cdf0e10cSrcweir            if a database access error occurs.
189*cdf0e10cSrcweir     */
190*cdf0e10cSrcweir    com::sun::star::util::Time readTime() raises (SQLException);
191*cdf0e10cSrcweir    //-------------------------------------------------------------------------
192*cdf0e10cSrcweir
193*cdf0e10cSrcweir    /** reads the next attribute in the stream as datetime.
194*cdf0e10cSrcweir        @returns
195*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
196*cdf0e10cSrcweir        @throws SQLException
197*cdf0e10cSrcweir            if a database access error occurs.
198*cdf0e10cSrcweir     */
199*cdf0e10cSrcweir    com::sun::star::util::DateTime readTimestamp() raises (SQLException);
200*cdf0e10cSrcweir    //-------------------------------------------------------------------------
201*cdf0e10cSrcweir
202*cdf0e10cSrcweir    /** reads the next attribute in the stream as sequence of bytes.
203*cdf0e10cSrcweir        @returns
204*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
205*cdf0e10cSrcweir        @throws SQLException
206*cdf0e10cSrcweir            if a database access error occurs.
207*cdf0e10cSrcweir     */
208*cdf0e10cSrcweir    com::sun::star::io::XInputStream readBinaryStream() raises (SQLException);
209*cdf0e10cSrcweir    //-------------------------------------------------------------------------
210*cdf0e10cSrcweir
211*cdf0e10cSrcweir    /** reads the next attribute in the stream as a unicode string.
212*cdf0e10cSrcweir        @returns
213*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
214*cdf0e10cSrcweir        @throws SQLException
215*cdf0e10cSrcweir            if a database access error occurs.
216*cdf0e10cSrcweir     */
217*cdf0e10cSrcweir    com::sun::star::io::XInputStream readCharacterStream() raises (SQLException);
218*cdf0e10cSrcweir    //-------------------------------------------------------------------------
219*cdf0e10cSrcweir
220*cdf0e10cSrcweir    /** returns the datum at the head of the stream as an any.
221*cdf0e10cSrcweir
222*cdf0e10cSrcweir
223*cdf0e10cSrcweir        <p>
224*cdf0e10cSrcweir        The actual type of the any returned is determined by the default
225*cdf0e10cSrcweir        type mapping, and any customizations present in this stream's type map.
226*cdf0e10cSrcweir
227*cdf0e10cSrcweir        <br/>
228*cdf0e10cSrcweir        A type map is registered with the stream by the SDBC driver before the
229*cdf0e10cSrcweir        stream is passed to the application.
230*cdf0e10cSrcweir
231*cdf0e10cSrcweir        <br/>
232*cdf0e10cSrcweir        When the datum at the head of the stream is a SQL NULL,
233*cdf0e10cSrcweir        the method returns <void/>. If the datum is a SQL structured or distinct
234*cdf0e10cSrcweir        type, it determines the SQL type of the datum at the head of the stream,
235*cdf0e10cSrcweir        constructs an object of the appropriate service, and calls the method
236*cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member>
237*cdf0e10cSrcweir        on that object, which reads additional data
238*cdf0e10cSrcweir        from the stream using the protocol described for that method.
239*cdf0e10cSrcweir
240*cdf0e10cSrcweir        </p>
241*cdf0e10cSrcweir        @returns
242*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
243*cdf0e10cSrcweir        @throws SQLException
244*cdf0e10cSrcweir            if a database access error occurs.
245*cdf0e10cSrcweir     */
246*cdf0e10cSrcweir    any readObject() raises (SQLException);
247*cdf0e10cSrcweir    //-------------------------------------------------------------------------
248*cdf0e10cSrcweir
249*cdf0e10cSrcweir    /** reads a REF(&amp;lt;structured-type&amp;gt;) from the stream.
250*cdf0e10cSrcweir        @returns
251*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
252*cdf0e10cSrcweir        @throws SQLException
253*cdf0e10cSrcweir            if a database access error occurs.
254*cdf0e10cSrcweir     */
255*cdf0e10cSrcweir    XRef readRef() raises (SQLException);
256*cdf0e10cSrcweir    //-------------------------------------------------------------------------
257*cdf0e10cSrcweir
258*cdf0e10cSrcweir    /** reads a BLOB from the stream.
259*cdf0e10cSrcweir        @returns
260*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
261*cdf0e10cSrcweir        @throws SQLException
262*cdf0e10cSrcweir            if a database access error occurs.
263*cdf0e10cSrcweir     */
264*cdf0e10cSrcweir    XBlob readBlob() raises (SQLException);
265*cdf0e10cSrcweir    //-------------------------------------------------------------------------
266*cdf0e10cSrcweir
267*cdf0e10cSrcweir    /** reads a CLOB from the stream.
268*cdf0e10cSrcweir        @returns
269*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
270*cdf0e10cSrcweir        @throws SQLException
271*cdf0e10cSrcweir            if a database access error occurs.
272*cdf0e10cSrcweir     */
273*cdf0e10cSrcweir    XClob readClob() raises (SQLException);
274*cdf0e10cSrcweir    //-------------------------------------------------------------------------
275*cdf0e10cSrcweir
276*cdf0e10cSrcweir    /** reads an array from the stream.
277*cdf0e10cSrcweir        @returns
278*cdf0e10cSrcweir            the attribute; if the value is SQL NULL, return null.
279*cdf0e10cSrcweir        @throws SQLException
280*cdf0e10cSrcweir            if a database access error occurs.
281*cdf0e10cSrcweir     */
282*cdf0e10cSrcweir    XArray readArray() raises (SQLException);
283*cdf0e10cSrcweir    //-------------------------------------------------------------------------
284*cdf0e10cSrcweir
285*cdf0e10cSrcweir    /** determines whether the last value read was null.
286*cdf0e10cSrcweir        @returns
287*cdf0e10cSrcweir            <TRUE/> if the most recently gotten SQL value was null; otherwise, <FALSE/>
288*cdf0e10cSrcweir        @throws SQLException
289*cdf0e10cSrcweir            if a database access error occurs.
290*cdf0e10cSrcweir     */
291*cdf0e10cSrcweir    boolean wasNull() raises (SQLException);
292*cdf0e10cSrcweir};
293*cdf0e10cSrcweir
294*cdf0e10cSrcweir//=============================================================================
295*cdf0e10cSrcweir
296*cdf0e10cSrcweir}; }; }; };
297*cdf0e10cSrcweir
298*cdf0e10cSrcweir/*===========================================================================
299*cdf0e10cSrcweir===========================================================================*/
300*cdf0e10cSrcweir#endif
301