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
;
32 /** represents an input stream that contains a stream of values representing an
33 instance of a SQL structured or distinct type.
37 This interface, used only for custom mapping, is used by the driver
38 behind the scenes, and a programmer never directly invokes
44 <code>getObject</code>
45 is called with an object of a service implementing the interface
47 , the SDBC driver calls the method
48 com::sun::star::sdbc::XSQLData::getSQLType()
49 to determine the SQL type of the user-defined type (UDT) being custom mapped.
50 The driver creates an instance of
51 com::sun::star::sdbc::XSQLInput
53 populating it with the attributes of the UDT. The driver then passes the input
55 com::sun::star::sdbc::XSQLData::readSQL()
56 , which in turn calls the
57 <code>XSQLInput.readXXX</code>
58 methods in its implementation for reading the attributes from the input stream.
61 published
interface XSQLInput
: com
::sun
::star
::uno
::XInterface
64 /** reads the next attribute in the stream as string.
66 the attribute; if the value is SQL NULL, return null.
68 if a database access error occurs.
70 string readString
() raises
(SQLException
);
72 /** reads the next attribute in the stream as boolean.
74 the attribute; if the value is SQL NULL, return null.
76 if a database access error occurs.
78 boolean readBoolean
() raises
(SQLException
);
80 /** reads the next attribute in the stream as byte.
82 the attribute; if the value is SQL NULL, return null.
84 if a database access error occurs.
86 byte readByte
() raises
(SQLException
);
88 /** reads the next attribute in the stream as short.
90 the attribute; if the value is SQL NULL, return null.
92 if a database access error occurs.
94 short readShort
() raises
(SQLException
);
96 /** reads the next attribute in the stream as long.
98 the attribute; if the value is SQL NULL, return null.
100 if a database access error occurs.
102 long readInt
() raises
(SQLException
);
104 /** reads the next attribute in the stream as hyper.
106 the attribute; if the value is SQL NULL, return null.
108 if a database access error occurs.
110 hyper readLong
() raises
(SQLException
);
112 /** reads the next attribute in the stream as float.
114 the attribute; if the value is SQL NULL, return null.
116 if a database access error occurs.
118 float readFloat
() raises
(SQLException
);
120 /** reads the next attribute in the stream as double.
122 the attribute; if the value is SQL NULL, return null.
124 if a database access error occurs.
126 double readDouble
() raises
(SQLException
);
128 /** reads the next attribute in the stream as sequence of bytes.
130 the attribute; if the value is SQL NULL, return null.
132 if a database access error occurs.
134 sequence
<byte> readBytes
() raises
(SQLException
);
136 /** reads the next attribute in the stream as date.
138 the attribute; if the value is SQL NULL, return null.
140 if a database access error occurs.
142 com
::sun
::star
::util
::Date readDate
() raises
(SQLException
);
144 /** reads the next attribute in the stream as time.
146 the attribute; if the value is SQL NULL, return null.
148 if a database access error occurs.
150 com
::sun
::star
::util
::Time readTime
() raises
(SQLException
);
152 /** reads the next attribute in the stream as datetime.
154 the attribute; if the value is SQL NULL, return null.
156 if a database access error occurs.
158 com
::sun
::star
::util
::DateTime readTimestamp
() raises
(SQLException
);
160 /** reads the next attribute in the stream as sequence of bytes.
162 the attribute; if the value is SQL NULL, return null.
164 if a database access error occurs.
166 com
::sun
::star
::io
::XInputStream readBinaryStream
() raises
(SQLException
);
168 /** reads the next attribute in the stream as a Unicode string.
170 the attribute; if the value is SQL NULL, return null.
172 if a database access error occurs.
174 com
::sun
::star
::io
::XInputStream readCharacterStream
() raises
(SQLException
);
176 /** returns the datum at the head of the stream as an any.
180 The actual type of the any returned is determined by the default
181 type mapping, and any customizations present in this stream's type map.
184 A type map is registered with the stream by the SDBC driver before the
185 stream is passed to the application.
188 When the datum at the head of the stream is a SQL NULL,
189 the method returns `VOID`. If the datum is a SQL structured or distinct
190 type, it determines the SQL type of the datum at the head of the stream,
191 constructs an object of the appropriate service, and calls the method
192 com::sun::star::sdbc::XSQLData::readSQL()
193 on that object, which reads additional data
194 from the stream using the protocol described for that method.
198 the attribute; if the value is SQL NULL, return null.
200 if a database access error occurs.
202 any readObject
() raises
(SQLException
);
204 /** reads a REF(&lt;structured-type&gt;) from the stream.
206 the attribute; if the value is SQL NULL, return null.
208 if a database access error occurs.
210 XRef readRef
() raises
(SQLException
);
212 /** reads a BLOB from the stream.
214 the attribute; if the value is SQL NULL, return null.
216 if a database access error occurs.
218 XBlob readBlob
() raises
(SQLException
);
220 /** reads a CLOB from the stream.
222 the attribute; if the value is SQL NULL, return null.
224 if a database access error occurs.
226 XClob readClob
() raises
(SQLException
);
228 /** reads an array from the stream.
230 the attribute; if the value is SQL NULL, return null.
232 if a database access error occurs.
234 XArray readArray
() raises
(SQLException
);
236 /** determines whether the last value read was null.
238 `TRUE` if the most recently gotten SQL value was null; otherwise, `FALSE`
240 if a database access error occurs.
242 boolean wasNull
() raises
(SQLException
);
248 /*===========================================================================
249 ===========================================================================*/
251 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */