xref: /aoo42x/main/offapi/com/sun/star/sdb/XColumn.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_sdb_XColumn_idl__
28#define __com_sun_star_sdb_XColumn_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_sdbc_SQLException_idl__
35#include <com/sun/star/sdbc/SQLException.idl>
36#endif
37
38#ifndef __com_sun_star_util_Date_idl__
39#include <com/sun/star/util/Date.idl>
40#endif
41
42#ifndef __com_sun_star_util_DateTime_idl__
43#include <com/sun/star/util/DateTime.idl>
44#endif
45
46#ifndef __com_sun_star_util_Time_idl__
47#include <com/sun/star/util/Time.idl>
48#endif
49
50 module com {  module sun {  module star {  module io {
51 published interface XInputStream;
52};};};};
53
54 module com {  module sun {  module star {  module container {
55 published interface XNameAccess;
56};};};};
57
58 module com {  module sun {  module star {  module sdbc {
59 published interface XRef;
60 published interface XArray;
61 published interface XBlob;
62 published interface XClob;
63};};};};
64
65 module com {  module sun {  module star {  module sdb {
66
67
68/** is used to access data which is collected in a row.
69 */
70published interface XColumn: com::sun::star::uno::XInterface
71{
72	//-------------------------------------------------------------------------
73
74	/** reports whether the last column read had a value of SQL NULL.
75		Note that you must first call getXXX on a column to try to read
76		its value and then call
77		<code>wasNull()</code>
78		to see if the value read was SQL NULL.
79		@returns
80			<TRUE/> if so
81		@throws com::sun::star::sdbc::SQLException
82			if a database access error occurs.
83	 */
84	boolean wasNull() raises (com::sun::star::sdbc::SQLException);
85	//-------------------------------------------------------------------------
86
87	/** gets the value of a column in the current row as a String.
88		@returns
89			the column value
90		@throws com::sun::star::sdbc::SQLException
91			if a database access error occurs.
92	 */
93	string getString() raises (com::sun::star::sdbc::SQLException);
94	//-------------------------------------------------------------------------
95
96	/** gets the value of a column in the current row as boolean.
97		@returns
98			the column value
99		@throws com::sun::star::sdbc::SQLException
100			if a database access error occurs.
101	 */
102	boolean getBoolean() raises (com::sun::star::sdbc::SQLException);
103	//-------------------------------------------------------------------------
104
105	/** gets the value of a column in the current row as a byte.
106		@returns
107			the column value
108		@throws com::sun::star::sdbc::SQLException
109			if a database access error occurs.
110	 */
111	byte getByte() raises (com::sun::star::sdbc::SQLException);
112	//-------------------------------------------------------------------------
113
114	/** gets the value of a column in the current row as a short.
115		@returns
116			the column value
117		@throws com::sun::star::sdbc::SQLException
118			if a database access error occurs.
119	 */
120	short getShort() raises (com::sun::star::sdbc::SQLException);
121	//-------------------------------------------------------------------------
122
123	/** gets the value of a column in the current row as a long.
124		@returns
125			the column value
126		@throws com::sun::star::sdbc::SQLException
127			if a database access error occurs.
128	 */
129	long getInt() raises (com::sun::star::sdbc::SQLException);
130	//-------------------------------------------------------------------------
131
132	/** gets the value of a column in the current row as a hyper.
133		@returns
134			the column value
135		@throws com::sun::star::sdbc::SQLException
136			if a database access error occurs.
137	 */
138	hyper getLong() raises (com::sun::star::sdbc::SQLException);
139	//-------------------------------------------------------------------------
140
141	/** gets the value of a column in the current row as a float.
142		@returns
143			the column value
144		@throws com::sun::star::sdbc::SQLException
145			if a database access error occurs.
146	 */
147	float getFloat() raises (com::sun::star::sdbc::SQLException);
148	//-------------------------------------------------------------------------
149
150	/** gets the value of a column in the current row as a double.
151		@returns
152			the column value
153		@throws com::sun::star::sdbc::SQLException
154			if a database access error occurs.
155	 */
156	double getDouble() raises (com::sun::star::sdbc::SQLException);
157	//-------------------------------------------------------------------------
158
159	/** gets the value of a column in the current row as a byte array.
160		     The bytes represent the raw values returned by the driver.
161		     @returns  the column value;
162				if the value is SQL NULL, the result is empty.
163		     @throws com::sun::star::sdbc::SQLException
164				if a database access error occurs.
165	*/
166	sequence<byte> getBytes() raises (com::sun::star::sdbc::SQLException);
167	//-------------------------------------------------------------------------
168
169	/** gets the value of a column in the current row as a date object.
170		@returns
171			the column value
172		@throws com::sun::star::sdbc::SQLException
173			if a database access error occurs.
174	 */
175	com::sun::star::util::Date getDate()
176		raises (com::sun::star::sdbc::SQLException);
177	//-------------------------------------------------------------------------
178
179	/** gets the value of a column in the current row as a time object.
180		@returns
181			the column value
182		@throws com::sun::star::sdbc::SQLException
183			if a database access error occurs.
184	 */
185	com::sun::star::util::Time getTime()
186		raises (com::sun::star::sdbc::SQLException);
187	//-------------------------------------------------------------------------
188
189	/** gets the value of a column in the current row as a datetime object.
190		@returns
191			the column value
192		@throws com::sun::star::sdbc::SQLException
193			if a database access error occurs.
194	 */
195	com::sun::star::util::DateTime getTimestamp()
196		raises (com::sun::star::sdbc::SQLException);
197	//-------------------------------------------------------------------------
198
199	/** gets the value of a column in the current row as a stream of
200		uninterpreted bytes. The value can then be read in chunks from the
201		stream. This method is particularly suitable for retrieving large
202		LONGVARBINARY or LONGVARCHAR values.
203
204
205		<p>
206		<b>Note:</b> All the data in the returned stream must be
207		read prior to getting the value of any other column. The next
208		call to a get method implicitly closes the stream. Also, a
209		stream may return 0 when the method
210		<member scope="com::sun::star::io">XInputStream::available()</member>
211		is called whether there is data available or not.
212		</p>
213			@returns
214			the column value
215		@throws com::sun::star::sdbc::SQLException
216			if a database access error occurs.
217	 */
218	com::sun::star::io::XInputStream getBinaryStream()
219        raises (com::sun::star::sdbc::SQLException);
220	//-------------------------------------------------------------------------
221
222	/** gets the value of a column in the current row as a stream of
223		uninterpreted bytes. The value can then be read in chunks from the
224		stream. This method is particularly suitable for retrieving large
225		LONGVARCHAR values.
226
227		<p>
228		<b>Note:</b> All the data in the returned stream must be
229		read prior to getting the value of any other column. The next
230		call to a get method implicitly closes the stream. Also, a
231		stream may return 0 when the method
232		<member scope="com::sun::star::io">XInputStream::available()</member>
233		is called whether there is data available or not.
234		</p>
235		@returns
236			the column value
237		@throws com::sun::star::sdbc::SQLException
238			if a database access error occurs.
239	 */
240	com::sun::star::io::XInputStream getCharacterStream()
241        raises (com::sun::star::sdbc::SQLException);
242	//-------------------------------------------------------------------------
243
244	/** @returns the value of a column in the current row as an object.
245		This method uses the given
246		<code>Map</code>
247		object
248		for the custom mapping of the SQL structure or distinct type
249		that is being retrieved.
250		@param typeMap
251			the type map is used to fetch the correct type
252		@returns
253			the column value
254		@throws com::sun::star::sdbc::SQLException
255			if a database access error occurs.
256	 */
257	any getObject([in]com::sun::star::container::XNameAccess typeMap)
258		raises (com::sun::star::sdbc::SQLException);
259    //-------------------------------------------------------------------------
260
261	/** gets a REF(&lt;structured-type&gt) column value from the current row.
262
263		@returns
264			the column value
265		@throws com::sun::star::sdbc::SQLException
266			if a database access error occurs.
267	*/
268	com::sun::star::sdbc::XRef getRef() raises (com::sun::star::sdbc::SQLException);
269	//-------------------------------------------------------------------------
270
271	/** gets a BLOB (Binary Large OBject) value in the current row.
272		@returns
273			the column value
274		@throws com::sun::star::sdbc::SQLException
275			if a database access error occurs.
276	 */
277	com::sun::star::sdbc::XBlob getBlob() raises (com::sun::star::sdbc::SQLException);
278	//-------------------------------------------------------------------------
279
280	/** gets a CLOB value in the current row of this <code>ResultSet</code> object.
281		@returns
282			the column value
283		@throws com::sun::star::sdbc::SQLException
284			if a database access error occurs.
285	 */
286	com::sun::star::sdbc::XClob getClob() raises (com::sun::star::sdbc::SQLException);
287	//-------------------------------------------------------------------------
288
289	/** gets a SQL ARRAY value from the current row.
290		@returns
291			the column value
292		@throws com::sun::star::sdbc::SQLException
293			if a database access error occurs.
294	 */
295	com::sun::star::sdbc::XArray getArray() raises (com::sun::star::sdbc::SQLException);
296};
297
298//=============================================================================
299
300}; }; }; };
301
302/*===========================================================================
303===========================================================================*/
304#endif
305