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