xref: /trunk/main/offapi/com/sun/star/sdbc/XRow.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_sdbc_XRow_idl__
28#define __com_sun_star_sdbc_XRow_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_util_Date_idl__
35#include <com/sun/star/util/Date.idl>
36#endif
37
38#ifndef __com_sun_star_util_DateTime_idl__
39#include <com/sun/star/util/DateTime.idl>
40#endif
41
42#ifndef __com_sun_star_util_Time_idl__
43#include <com/sun/star/util/Time.idl>
44#endif
45
46 module com {  module sun {  module star {  module io {
47 published interface XInputStream;
48};};};};
49
50 module com {  module sun {  module star {  module container {
51 published interface XNameAccess;
52};};};};
53
54#ifndef __com_sun_star_sdbc_SQLException_idl__
55#include <com/sun/star/sdbc/SQLException.idl>
56#endif
57
58 module com {  module sun {  module star {  module sdbc {
59
60 published interface XRef;
61 published interface XArray;
62 published interface XBlob;
63 published interface XClob;
64
65
66/** is used to access data which is collected in a row.
67	All methods raise a
68	<type scope="com::sun::star::sdbc">SQLException</type>
69	if a database access error occurs.
70 */
71published interface XRow: com::sun::star::uno::XInterface
72{
73	//-------------------------------------------------------------------------
74
75	/** reports whether the last column read had a value of SQL NULL.
76		Note that you must first call getXXX on a column to try to read
77		its value and then call wasNull() to see if the value read was
78		SQL NULL.
79
80		@returns
81			<TRUE/> if last column read was SQL NULL and <FALSE/> otherwise
82		@throws SQLException
83				if a database access error occurs.
84	 */
85	boolean wasNull() raises (SQLException);
86	//-------------------------------------------------------------------------
87
88	/** gets the value of a column in the current row as a string.
89		@param columnIndex
90			the first column is 1, the second is 2,
91		@returns
92			the column value; if the value is SQL NULL, the result is null
93		@throws SQLException
94				if a database access error occurs.
95	 */
96	string getString([in]long columnIndex) raises (SQLException);
97	//-------------------------------------------------------------------------
98
99	/** gets the value of a column in the current row as boolean.
100		@param columnIndex
101			the first column is 1, the second is 2,
102		@returns
103			the column value; if the value is SQL NULL, the result is null
104		@throws SQLException
105				if a database access error occurs.
106	 */
107	boolean getBoolean([in]long columnIndex) raises (SQLException);
108	//-------------------------------------------------------------------------
109
110	/** get the value of a column in the current row as a byte.
111		@param columnIndex
112			the first column is 1, the second is 2,
113		@returns
114			the column value; if the value is SQL NULL, the result is null
115		@throws SQLException
116				if a database access error occurs.
117	 */
118	byte getByte([in]long columnIndex) raises (SQLException);
119	//-------------------------------------------------------------------------
120
121	/** gets the value of a column in the current row as a short.
122		@param columnIndex
123			the first column is 1, the second is 2,
124		@returns
125			the column value; if the value is SQL NULL, the result is null
126		@throws SQLException
127				if a database access error occurs.
128	 */
129	short getShort([in]long columnIndex) raises (SQLException);
130	//-------------------------------------------------------------------------
131
132	/** get the value of a column in the current row as an integer.
133		@param columnIndex
134			the first column is 1, the second is 2,
135		@returns
136			the column value; if the value is SQL NULL, the result is null
137		@throws SQLException
138				if a database access error occurs.
139	 */
140	long getInt([in]long columnIndex) raises (SQLException);
141	//-------------------------------------------------------------------------
142
143	/** get the value of a column in the current row as a long.
144		@param columnIndex
145			the first column is 1, the second is 2,
146		@returns
147			the column value; if the value is SQL NULL, the result is null
148		@throws SQLException
149				if a database access error occurs.
150	 */
151	hyper getLong([in]long columnIndex) raises (SQLException);
152	//-------------------------------------------------------------------------
153
154	/** gets the value of a column in the current row as a float.
155		@param columnIndex
156			the first column is 1, the second is 2,
157		@returns
158			the column value; if the value is SQL NULL, the result is null
159		@throws SQLException
160				if a database access error occurs.
161	 */
162	float getFloat([in]long columnIndex) raises (SQLException);
163	//-------------------------------------------------------------------------
164
165	/** gets the value of a column in the current row as a double.
166		@param columnIndex
167			the first column is 1, the second is 2,
168		@returns
169			the column value; if the value is SQL NULL, the result is null
170		@throws SQLException
171				if a database access error occurs.
172	 */
173	double getDouble([in]long columnIndex) raises (SQLException);
174	//-------------------------------------------------------------------------
175
176	/** gets the value of a column in the current row as a byte array.
177		     The bytes represent the raw values returned by the driver.
178			 @param columnIndex
179				the first column is 1, the second is 2, ...
180		     @returns
181				the column value; if the value is SQL NULL, the result is empty.
182		     @throws SQLException
183				if a database access error occurs.
184	 */
185	sequence<byte> getBytes([in]long columnIndex) raises (SQLException);
186	//-------------------------------------------------------------------------
187
188	/** gets the value of a column in the current row as a date object.
189		@param columnIndex
190			the first column is 1, the second is 2,
191		@returns
192			the column value; if the value is SQL NULL, the result is null
193		@throws SQLException
194				if a database access error occurs.
195	 */
196	com::sun::star::util::Date getDate([in]long columnIndex)
197		raises (SQLException);
198	//-------------------------------------------------------------------------
199
200	/** gets the value of a column in the current row as a time object.
201		@param columnIndex
202			the first column is 1, the second is 2,
203		@returns
204			the column value; if the value is SQL NULL, the result is null
205		@throws SQLException
206				if a database access error occurs.
207	 */
208	com::sun::star::util::Time getTime([in]long columnIndex)
209		raises (SQLException);
210	//-------------------------------------------------------------------------
211
212	/** gets the value of a column in the current row as a datetime object.
213		@param columnIndex
214			the first column is 1, the second is 2,
215		@returns
216			the column value; if the value is SQL NULL, the result is null
217		@throws SQLException
218				if a database access error occurs.
219	 */
220	com::sun::star::util::DateTime getTimestamp([in]long columnIndex)
221		raises (SQLException);
222	//-------------------------------------------------------------------------
223
224	/** gets the value of a column in the current row as a stream of
225		uninterpreted bytes. The value can then be read in chunks from the
226		stream. This method is particularly suitable for retrieving large
227		LONGVARBINARY values.
228
229
230		<p>
231		<b>Note:</b> All the data in the returned stream must be
232		read prior to getting the value of any other column. The next
233		call to a get method implicitly closes the stream. Also, a
234		stream may return 0 when the method
235		<member scope="com::sun::star::io">XInputStream::available()</member>
236		is called whether there is data
237		available or not.
238		</p>
239		@param columnIndex
240			the first column is 1, the second is 2,
241		@returns
242			the column value; if the value is SQL NULL, the result is null
243		@throws SQLException
244				if a database access error occurs.
245	 */
246	com::sun::star::io::XInputStream getBinaryStream([in]long columnIndex)
247        raises (SQLException);
248	//-------------------------------------------------------------------------
249
250	/** gets the value of a column in the current row as a stream of
251		uninterpreted bytes. The value can then be read in chunks from the
252		stream. This method is particularly suitable for retrieving large
253		LONGVARBINARY or LONGVARCHAR values.
254
255
256		<p>
257		<b>Note:</b> All the data in the returned stream must be
258		read prior to getting the value of any other column. The next
259		call to a get method implicitly closes the stream. Also, a
260		stream may return 0 when the method
261		<member scope="com::sun::star::io">XInputStream::available()</member>
262		is called whether there is data
263		available or not.
264		</p>
265		@param columnIndex
266			the first column is 1, the second is 2,
267		@returns
268			the column value; if the value is SQL NULL, the result is null
269		@throws SQLException
270				if a database access error occurs.
271	 */
272	com::sun::star::io::XInputStream getCharacterStream([in]long columnIndex)
273        raises (SQLException);
274	//-------------------------------------------------------------------------
275
276	/** returns the value of a column in the current row as an object.
277		This method uses the given
278		<code>Map</code>
279		object for the custom mapping of the SQL structure or distinct type
280		that is being retrieved.
281		@param columnIndex
282			the first column is 1, the second is 2,
283		@param typeMap
284			the map of types which should be used to get the column value
285		@returns
286			the column value; if the value is SQL NULL, the result is null
287		@throws SQLException
288				if a database access error occurs.
289	 */
290	any getObject([in]long columnIndex,
291			      [in]com::sun::star::container::XNameAccess typeMap)
292		raises (SQLException);
293    //-------------------------------------------------------------------------
294
295	/** gets a REF(&amp;lt;structured-type&amp;gt;) column value from the current row.
296		@param columnIndex
297			the first column is 1, the second is 2,
298		@returns
299			the column value; if the value is SQL NULL, the result is null
300		@throws SQLException
301				if a database access error occurs.
302	 */
303	XRef getRef([in]long columnIndex) raises (SQLException);
304	//-------------------------------------------------------------------------
305
306	/** gets a BLOB value in the current row.
307		@param columnIndex
308			the first column is 1, the second is 2,
309		@returns
310			the column value; if the value is SQL NULL, the result is null
311		@throws SQLException
312				if a database access error occurs.
313	 */
314	XBlob getBlob([in]long columnIndex) raises (SQLException);
315	//-------------------------------------------------------------------------
316
317	/** gets a CLOB value in the current row of this
318		<code>ResultSet</code>
319		object.
320		@param columnIndex
321			the first column is 1, the second is 2,
322		@returns
323			the column value; if the value is SQL NULL, the result is null
324		@throws SQLException
325			if a database access error occurs.
326	 */
327	XClob getClob([in]long columnIndex) raises (SQLException);
328	//-------------------------------------------------------------------------
329
330	/** gets a SQL ARRAY value from the current row of this
331		<code>ResultSet</code>
332		object.
333		@param columnIndex
334			the first column is 1, the second is 2,
335		@returns
336			the column value; if the value is SQL NULL, the result is null
337		@throws SQLException
338				if a database access error occurs.
339	 */
340	XArray getArray([in]long columnIndex) raises (SQLException);
341};
342
343//=============================================================================
344
345}; }; }; };
346
347/*===========================================================================
348===========================================================================*/
349#endif
350