1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XResultSet.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_sdbc_XResultSet_idl__
31 #define __com_sun_star_sdbc_XResultSet_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_sdbc_SQLException_idl__
38 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
41 module com
{ module sun
{ module star
{ module sdbc
{
43 published
interface XStatement
;
46 /** provides the navigation on a table of data. A
47 <type scope="com::sun::star::sdbc">ResultSet</type>
48 object is usually generated by executing a
49 <type scope="com::sun::star::sdbc">Statement</type>
54 A ResultSet maintains a cursor pointing to its current row of
55 data. Initially the cursor is positioned before the first row.
56 The 'next' method moves the cursor to the next row.
59 published
interface XResultSet
: com
::sun
::star
::uno
::XInterface
61 //-------------------------------------------------------------------------
63 /** moves the cursor down one row from its current position.
67 A ResultSet cursor is initially positioned before the first row; the
68 first call to next makes the first row the current row; the
69 second call makes the second row the current row, and so on.
71 <p>If an input stream is open for the current row, a call
74 will implicitly close it.
75 The ResultSet's warning chain is cleared when a new row is read.
80 if a database access error occurs.
82 boolean next
() raises
(SQLException
);
83 //-------------------------------------------------------------------------
85 /** indicates whether the cursor is before the first row in the result
90 if a database access error occurs.
92 boolean isBeforeFirst
() raises
(SQLException
);
93 //-------------------------------------------------------------------------
95 /** indicates whether the cursor is after the last row in the result
100 if a database access error occurs.
102 boolean isAfterLast
() raises
(SQLException
);
103 //-------------------------------------------------------------------------
105 /** indicates whether the cursor is on the first row of the result set.
109 if a database access error occurs.
111 boolean isFirst
() raises
(SQLException
);
112 //-------------------------------------------------------------------------
114 /** indicates whether the cursor is on the last row of the result set.
122 <code>isAtLast</code>
123 may be expensive because the SDBC driver might need to fetch ahead one row in order
124 to determine whether the current row is the last row in the result set.
129 if a database access error occurs.
131 boolean isLast
() raises
(SQLException
);
132 //-------------------------------------------------------------------------
134 /** moves the cursor to the front of the result set, just before the
135 first row. Has no effect if the result set contains no rows.
137 if a database access error occurs.
139 void beforeFirst
() raises
(SQLException
);
140 //-------------------------------------------------------------------------
142 /** moves the cursor to the end of the result set, just after the last
143 row. Has no effect if the result set contains no rows.
145 if a database access error occurs.
147 void afterLast
() raises
(SQLException
);
148 //-------------------------------------------------------------------------
150 /** moves the cursor to the first row in the result set.
152 <TRUE/> if successful
154 if a database access error occurs.
156 boolean first
() raises
(SQLException
);
157 //-------------------------------------------------------------------------
159 /** moves the cursor to the last row in the result set.
161 <TRUE/> if successful
163 if a database access error occurs.
165 boolean last
() raises
(SQLException
);
166 //-------------------------------------------------------------------------
168 /** retrieves the current row number. The first row is number 1, the
169 second number 2, and so on.
173 if a database access error occurs.
175 long getRow
() raises
(SQLException
);
176 //-------------------------------------------------------------------------
178 /** moves the cursor to the given row number in the result set.
182 If the row number is positive, the cursor moves to
183 the given row number with respect to the
184 beginning of the result set. The first row is row 1, the second
188 If the given row number is negative, the cursor moves to
189 an absolute row position with respect to
190 the end of the result set. For example, calling
191 <code>absolute(-1)</code>
193 cursor on the last row,
194 <code>absolute(-2)</code>
195 indicates the next-to-last row, and so on.
198 An attempt to position the cursor beyond the first/last row in
199 the result set leaves the cursor before/after the first/last
204 <code>absolute(1)</code>
207 <member scope="com::sun::star::sdbc">XResultSet::first()</member>
209 Calling <code>moveToPosition(-1)</code> is the same as calling
210 <code>moveToLast()</code>.
213 boolean absolute
([in] long row
) raises
(SQLException
);
214 //-------------------------------------------------------------------------
216 /** moves the cursor a relative number of rows, either positive or negative.
220 Attempting to move beyond the first/last row in the result set
221 positions the cursor before/after
222 the first/last row. Calling
223 <code>relative(0)</code>
224 is valid, but does not change the cursor position.
228 <code>relative(1)</code>
229 is different from calling
230 <member scope="com::sun::star::sdbc">XResultSet::next()</member>
231 because is makes sense to call
233 when there is no current row, for example, when the cursor is positioned before
234 the first row or after the last row of the result set.
237 how many rows should be moved relative to the current row
239 <TRUE/> if successful
241 if a database access error occurs.
243 boolean relative
([in]long rows
) raises
(SQLException
);
244 //-------------------------------------------------------------------------
246 /** moves the cursor to the previous row in the result set.
251 <code>previous()</code>
253 <code>relative(-1)</code>
254 because it makes sense to call
255 <code>previous()</code>
256 when there is no current row.
259 <TRUE/> if successful
261 if a database access error occurs.
263 boolean previous
() raises
(SQLException
);
264 //-------------------------------------------------------------------------
266 /** refreshes the current row with its most recent value in
267 the database. Cannot be called when on the insert row.
269 <code>refreshRow</code>
270 method provides a way for an application to
271 explicitly tell the SDBC driver to refetch a row(s) from the
272 database. An application may want to call
273 <code>refreshRow</code>
274 when caching or prefetching is being done by the SDBC driver to
275 fetch the latest value of a row from the database. The SDBC driver
276 may actually refresh multiple rows at once if the fetch size is
278 All values are refetched subject to the transaction isolation
279 level and cursor sensitivity. If
280 <code>refreshRow</code>
281 is called after calling
282 <code>updateXXX</code>
284 <member scope="com::sun::star::sdbc">XResultSet::updateRow()</member>
285 , then the updates made to the row are lost.
287 <code>refreshRow</code>
288 frequently will likely slow performance.
290 if a database access error occurs.
292 void refreshRow
() raises
(SQLException
);
293 //-------------------------------------------------------------------------
295 /** indicates whether the current row has been updated. The value returned
296 depends on whether or not the result set can detect updates.
298 <TRUE/> if successful
300 if a database access error occurs.
302 boolean rowUpdated
() raises
(SQLException
);
303 //-------------------------------------------------------------------------
305 /** indicates whether the current row has had an insertion. The value returned
306 depends on whether or not the result set can detect visible inserts.
308 <TRUE/> if successful
310 if a database access error occurs.
312 boolean rowInserted
() raises
(SQLException
);
313 //-------------------------------------------------------------------------
315 /** indicates whether a row has been deleted. A deleted row may leave
316 a visible "hole" in a result set. This method can be used to
317 detect holes in a result set. The value returned depends on whether
318 or not the result set can detect deletions.
320 <TRUE/> if successful
322 if a database access error occurs.
324 boolean rowDeleted
() raises
(SQLException
);
325 //-------------------------------------------------------------------------
327 /** returns the Statement that produced this
328 <type scope="com::sun::star::sdbc">ResultSet</type>
329 object. If the result set was generated some other way, such as by an
330 <type scope="com::sun::star::sdbc">XDatabaseMetaData</type>
331 method, this method returns
337 if a database access error occurs.
339 com
::sun
::star
::uno
::XInterface getStatement
() raises
(SQLException
);
342 //=============================================================================
346 /*===========================================================================
347 ===========================================================================*/