xref: /trunk/main/offapi/com/sun/star/sdbc/ResultSet.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_ResultSet_idl__
28#define __com_sun_star_sdbc_ResultSet_idl__
29
30#ifndef __com_sun_star_lang_XComponent_idl__
31#include <com/sun/star/lang/XComponent.idl>
32#endif
33
34#ifndef __com_sun_star_beans_XPropertySet_idl__
35#include <com/sun/star/beans/XPropertySet.idl>
36#endif
37
38#ifndef __com_sun_star_util_XCancellable_idl__
39#include <com/sun/star/util/XCancellable.idl>
40#endif
41
42 module com {  module sun {  module star {  module sdbc {
43
44 published interface XStatement;
45 published interface XRow;
46 published interface XRowUpdate;
47 published interface XResultSet;
48 published interface XResultSetUpdate;
49 published interface XResultSetMetaDataSupplier;
50 published interface XWarningsSupplier;
51 published interface XColumnLocate;
52 published interface XCloseable;
53
54
55/** provides access to a table of data. A ResultSet
56	object is usually generated by executing a Statement.
57
58
59
60	<p>
61	A ResultSet maintains a cursor pointing to its current row of
62	data. Initially the cursor is positioned before the first row.
63	The 'next' method moves the cursor to the next row.
64	</p>
65	<p>
66	The getXXX methods retrieve column values for the current
67	row. You can retrieve values using either the index number of the
68	column. Columns are numbered from 1.
69	</p>
70	<p>
71	For maximum portability, ResultSet columns within each row should be
72	read in left-to-right order and each column should be read only once.
73	</p>
74	<p>
75	For the getXXX methods, the SDBC driver attempts to convert the
76	underlying data to the specified type and returns a suitable
77	value.
78	</p>
79	<p>
80	Column names used as input to the findColumn method are case
81	insensitive. When several columns have the same name, then the value
82	of the first matching column will be returned. The column name option is
83	designed to be used when column names are used in the SQL
84	query. For columns that are NOT explicitly named in the query, it
85	is best to use column numbers. If column names are used, there is
86	no way for the programmer to guarantee that they actually refer to
87	the intended columns.
88	</p>
89	<p>
90	A ResultSet is automatically closed (disposed) by the Statement that
91	generated it when that Statement is closed, re-executed, or used
92	to retrieve the next result from a sequence of multiple results.
93	</p>
94	<p>
95	The number, types, and properties of a ResultSet's columns are
96	provided by the ResultSetMetaData object returned by the getMetaData
97	method.
98	</p>
99 */
100published service ResultSet
101{
102
103	/** optional for implementation; controls the releasing of resources
104			 and the notification of registered listeners.
105	 */
106	[optional] interface com::sun::star::lang::XComponent;
107
108
109	/** freeing all resources of a result set.
110
111				<p>
112				The creating statement will still be open after disposing.
113				</p>
114
115				<p>
116				This interface is mandatory only for JDBC conformance,
117				otherwise it is optional.
118				</p>
119	 */
120	[optional] interface XCloseable;
121
122	// gives access to the properties.
123	interface com::sun::star::beans::XPropertySet;
124
125
126	/** controls the chaining of warnings, which may occur on every call
127				to the connected database.
128
129			 	<p>
130				Chained warnings from previous calls will be cleared before processing a new call.
131				</p>
132
133				<p>
134				This interface is mandatory only for JDBC conformance, otherwise it is optional.
135				</p>
136	 */
137	[optional] interface XWarningsSupplier;
138
139
140	/** provides the access to the result set description.
141	 */
142	interface XResultSetMetaDataSupplier;
143
144
145	/** is the interface for navigating on the rows on a result set.
146	 */
147	interface XResultSet;
148
149
150	/** is the interface for updating row data to the database.
151
152				<p>
153				The implementation is optional.
154				</p>
155	 */
156	[optional] interface XResultSetUpdate;
157
158
159	/** is the interface for accessing the data of the current row.
160	 */
161	interface XRow;
162
163
164	/** is used for locating a column by it's name.
165	 */
166	interface XColumnLocate;
167
168
169	/** is the interface for updating the data of the current row.
170
171				<p>
172				The implementation is optional.
173				</p>
174	 */
175	[optional] interface XRowUpdate;
176
177
178	/** defines the SQL cursor name that will be used by subsequent Statement
179		<code>execute</code>
180		methods.
181
182
183		<p>
184		This name can then be used in SQL positioned update/delete statements to
185		identify the current row in the ResultSet generated by this statement. If
186		the database doesn't support positioned update/delete, this property is
187		a noop. To insure that a cursor has the proper isolation level to support
188		updates, the cursor's SELECT statement should be of the form
189		'select for update ...'. If the 'for update' phrase is omitted,
190		positioned updates may fail.
191		</p>
192		<p>
193		<b>
194		Note:
195		</b>
196		By definition, positioned update/delete
197		execution must be done by a different Statement than the one
198		which generated the ResultSet being used for positioning. Also,
199		cursor names must be unique within a connection.
200		</p>
201	 */
202	[optional, readonly, property] string CursorName;
203
204
205	/** retrieves the result set concurrency.
206
207		@see com::sun::star::sdbc::ResultSetConcurrency
208	 */
209	[readonly, property] long ResultSetConcurrency;
210
211
212	/** determines the result set type.
213
214		@see com::sun::star::sdbc::ResultSetType
215	 */
216	[readonly, property] long ResultSetType;
217
218
219	/** retrieves the direction for fetching rows from database tables
220		that is the default for result sets generated from this
221		<type scope="com::sun::star::sdbcx">Statement</type>
222		object.
223		<br/>
224		If this <code>Statement</code> object has not set a fetch direction,
225		the return value is implementation-specific.
226	 */
227	[property] long FetchDirection;
228
229
230	/** retrieves the number of result set rows that is the default fetch size
231		for result sets generated from this
232		<type scope="com::sun::star::sdbcx">Statement</type>
233		object.
234		<br/>
235		If this
236		<type scope="com::sun::star::sdbcx">Statement</type>
237		object has not set a fetch size,
238		the return value is implementation-specific.
239	 */
240	[property] long FetchSize;
241};
242
243//=============================================================================
244
245}; }; }; };
246
247/*===========================================================================
248===========================================================================*/
249#endif
250