xref: /trunk/main/offapi/com/sun/star/sdb/XColumn.idl (revision d1766043)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_sdb_XColumn_idl__
24#define __com_sun_star_sdb_XColumn_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_sdbc_SQLException_idl__
31#include <com/sun/star/sdbc/SQLException.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 module com {  module sun {  module star {  module sdbc {
55 published interface XRef;
56 published interface XArray;
57 published interface XBlob;
58 published interface XClob;
59};};};};
60
61 module com {  module sun {  module star {  module sdb {
62
63
64/** is used to access data which is collected in a row.
65 */
66published interface XColumn: com::sun::star::uno::XInterface
67{
68	//-------------------------------------------------------------------------
69
70	/** reports whether the last column read had a value of SQL NULL.
71		Note that you must first call getXXX on a column to try to read
72		its value and then call
73		<code>wasNull()</code>
74		to see if the value read was SQL NULL.
75		@returns
76			<TRUE/> if so
77		@throws com::sun::star::sdbc::SQLException
78			if a database access error occurs.
79	 */
80	boolean wasNull() raises (com::sun::star::sdbc::SQLException);
81	//-------------------------------------------------------------------------
82
83	/** gets the value of a column in the current row as a String.
84		@returns
85			the column value
86		@throws com::sun::star::sdbc::SQLException
87			if a database access error occurs.
88	 */
89	string getString() raises (com::sun::star::sdbc::SQLException);
90	//-------------------------------------------------------------------------
91
92	/** gets the value of a column in the current row as boolean.
93		@returns
94			the column value
95		@throws com::sun::star::sdbc::SQLException
96			if a database access error occurs.
97	 */
98	boolean getBoolean() raises (com::sun::star::sdbc::SQLException);
99	//-------------------------------------------------------------------------
100
101	/** gets the value of a column in the current row as a byte.
102		@returns
103			the column value
104		@throws com::sun::star::sdbc::SQLException
105			if a database access error occurs.
106	 */
107	byte getByte() raises (com::sun::star::sdbc::SQLException);
108	//-------------------------------------------------------------------------
109
110	/** gets the value of a column in the current row as a short.
111		@returns
112			the column value
113		@throws com::sun::star::sdbc::SQLException
114			if a database access error occurs.
115	 */
116	short getShort() raises (com::sun::star::sdbc::SQLException);
117	//-------------------------------------------------------------------------
118
119	/** gets the value of a column in the current row as a long.
120		@returns
121			the column value
122		@throws com::sun::star::sdbc::SQLException
123			if a database access error occurs.
124	 */
125	long getInt() raises (com::sun::star::sdbc::SQLException);
126	//-------------------------------------------------------------------------
127
128	/** gets the value of a column in the current row as a hyper.
129		@returns
130			the column value
131		@throws com::sun::star::sdbc::SQLException
132			if a database access error occurs.
133	 */
134	hyper getLong() raises (com::sun::star::sdbc::SQLException);
135	//-------------------------------------------------------------------------
136
137	/** gets the value of a column in the current row as a float.
138		@returns
139			the column value
140		@throws com::sun::star::sdbc::SQLException
141			if a database access error occurs.
142	 */
143	float getFloat() raises (com::sun::star::sdbc::SQLException);
144	//-------------------------------------------------------------------------
145
146	/** gets the value of a column in the current row as a double.
147		@returns
148			the column value
149		@throws com::sun::star::sdbc::SQLException
150			if a database access error occurs.
151	 */
152	double getDouble() raises (com::sun::star::sdbc::SQLException);
153	//-------------------------------------------------------------------------
154
155	/** gets the value of a column in the current row as a byte array.
156		     The bytes represent the raw values returned by the driver.
157		     @returns  the column value;
158				if the value is SQL NULL, the result is empty.
159		     @throws com::sun::star::sdbc::SQLException
160				if a database access error occurs.
161	*/
162	sequence<byte> getBytes() raises (com::sun::star::sdbc::SQLException);
163	//-------------------------------------------------------------------------
164
165	/** gets the value of a column in the current row as a date object.
166		@returns
167			the column value
168		@throws com::sun::star::sdbc::SQLException
169			if a database access error occurs.
170	 */
171	com::sun::star::util::Date getDate()
172		raises (com::sun::star::sdbc::SQLException);
173	//-------------------------------------------------------------------------
174
175	/** gets the value of a column in the current row as a time object.
176		@returns
177			the column value
178		@throws com::sun::star::sdbc::SQLException
179			if a database access error occurs.
180	 */
181	com::sun::star::util::Time getTime()
182		raises (com::sun::star::sdbc::SQLException);
183	//-------------------------------------------------------------------------
184
185	/** gets the value of a column in the current row as a datetime object.
186		@returns
187			the column value
188		@throws com::sun::star::sdbc::SQLException
189			if a database access error occurs.
190	 */
191	com::sun::star::util::DateTime getTimestamp()
192		raises (com::sun::star::sdbc::SQLException);
193	//-------------------------------------------------------------------------
194
195	/** gets the value of a column in the current row as a stream of
196		uninterpreted bytes. The value can then be read in chunks from the
197		stream. This method is particularly suitable for retrieving large
198		LONGVARBINARY or LONGVARCHAR values.
199
200
201		<p>
202		<b>Note:</b> All the data in the returned stream must be
203		read prior to getting the value of any other column. The next
204		call to a get method implicitly closes the stream. Also, a
205		stream may return 0 when the method
206		<member scope="com::sun::star::io">XInputStream::available()</member>
207		is called whether there is data available or not.
208		</p>
209			@returns
210			the column value
211		@throws com::sun::star::sdbc::SQLException
212			if a database access error occurs.
213	 */
214	com::sun::star::io::XInputStream getBinaryStream()
215        raises (com::sun::star::sdbc::SQLException);
216	//-------------------------------------------------------------------------
217
218	/** gets the value of a column in the current row as a stream of
219		uninterpreted bytes. The value can then be read in chunks from the
220		stream. This method is particularly suitable for retrieving large
221		LONGVARCHAR values.
222
223		<p>
224		<b>Note:</b> All the data in the returned stream must be
225		read prior to getting the value of any other column. The next
226		call to a get method implicitly closes the stream. Also, a
227		stream may return 0 when the method
228		<member scope="com::sun::star::io">XInputStream::available()</member>
229		is called whether there is data available or not.
230		</p>
231		@returns
232			the column value
233		@throws com::sun::star::sdbc::SQLException
234			if a database access error occurs.
235	 */
236	com::sun::star::io::XInputStream getCharacterStream()
237        raises (com::sun::star::sdbc::SQLException);
238	//-------------------------------------------------------------------------
239
240	/** @returns the value of a column in the current row as an object.
241		This method uses the given
242		<code>Map</code>
243		object
244		for the custom mapping of the SQL structure or distinct type
245		that is being retrieved.
246		@param typeMap
247			the type map is used to fetch the correct type
248		@returns
249			the column value
250		@throws com::sun::star::sdbc::SQLException
251			if a database access error occurs.
252	 */
253	any getObject([in]com::sun::star::container::XNameAccess typeMap)
254		raises (com::sun::star::sdbc::SQLException);
255    //-------------------------------------------------------------------------
256
257	/** gets a REF(&lt;structured-type&gt) column value from the current row.
258
259		@returns
260			the column value
261		@throws com::sun::star::sdbc::SQLException
262			if a database access error occurs.
263	*/
264	com::sun::star::sdbc::XRef getRef() raises (com::sun::star::sdbc::SQLException);
265	//-------------------------------------------------------------------------
266
267	/** gets a BLOB (Binary Large OBject) value in the current row.
268		@returns
269			the column value
270		@throws com::sun::star::sdbc::SQLException
271			if a database access error occurs.
272	 */
273	com::sun::star::sdbc::XBlob getBlob() raises (com::sun::star::sdbc::SQLException);
274	//-------------------------------------------------------------------------
275
276	/** gets a CLOB value in the current row of this <code>ResultSet</code> object.
277		@returns
278			the column value
279		@throws com::sun::star::sdbc::SQLException
280			if a database access error occurs.
281	 */
282	com::sun::star::sdbc::XClob getClob() raises (com::sun::star::sdbc::SQLException);
283	//-------------------------------------------------------------------------
284
285	/** gets a SQL ARRAY value from the current row.
286		@returns
287			the column value
288		@throws com::sun::star::sdbc::SQLException
289			if a database access error occurs.
290	 */
291	com::sun::star::sdbc::XArray getArray() raises (com::sun::star::sdbc::SQLException);
292};
293
294//=============================================================================
295
296}; }; }; };
297
298/*===========================================================================
299===========================================================================*/
300#endif
301