1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_sdbc_XResultSet_idl__
28 #define __com_sun_star_sdbc_XResultSet_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
34 #ifndef __com_sun_star_sdbc_SQLException_idl__
35 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
38 module com
{ module sun
{ module star
{ module sdbc
{
40 published
interface XStatement
;
43 /** provides the navigation on a table of data. A
44 <type scope="com::sun::star::sdbc">ResultSet</type>
45 object is usually generated by executing a
46 <type scope="com::sun::star::sdbc">Statement</type>
51 A ResultSet maintains a cursor pointing to its current row of
52 data. Initially the cursor is positioned before the first row.
53 The 'next' method moves the cursor to the next row.
56 published
interface XResultSet
: com
::sun
::star
::uno
::XInterface
58 //-------------------------------------------------------------------------
60 /** moves the cursor down one row from its current position.
64 A ResultSet cursor is initially positioned before the first row; the
65 first call to next makes the first row the current row; the
66 second call makes the second row the current row, and so on.
68 <p>If an input stream is open for the current row, a call
71 will implicitly close it.
72 The ResultSet's warning chain is cleared when a new row is read.
77 if a database access error occurs.
79 boolean next
() raises
(SQLException
);
80 //-------------------------------------------------------------------------
82 /** indicates whether the cursor is before the first row in the result
87 if a database access error occurs.
89 boolean isBeforeFirst
() raises
(SQLException
);
90 //-------------------------------------------------------------------------
92 /** indicates whether the cursor is after the last row in the result
97 if a database access error occurs.
99 boolean isAfterLast
() raises
(SQLException
);
100 //-------------------------------------------------------------------------
102 /** indicates whether the cursor is on the first row of the result set.
106 if a database access error occurs.
108 boolean isFirst
() raises
(SQLException
);
109 //-------------------------------------------------------------------------
111 /** indicates whether the cursor is on the last row of the result set.
119 <code>isAtLast</code>
120 may be expensive because the SDBC driver might need to fetch ahead one row in order
121 to determine whether the current row is the last row in the result set.
126 if a database access error occurs.
128 boolean isLast
() raises
(SQLException
);
129 //-------------------------------------------------------------------------
131 /** moves the cursor to the front of the result set, just before the
132 first row. Has no effect if the result set contains no rows.
134 if a database access error occurs.
136 void beforeFirst
() raises
(SQLException
);
137 //-------------------------------------------------------------------------
139 /** moves the cursor to the end of the result set, just after the last
140 row. Has no effect if the result set contains no rows.
142 if a database access error occurs.
144 void afterLast
() raises
(SQLException
);
145 //-------------------------------------------------------------------------
147 /** moves the cursor to the first row in the result set.
149 <TRUE/> if successful
151 if a database access error occurs.
153 boolean first
() raises
(SQLException
);
154 //-------------------------------------------------------------------------
156 /** moves the cursor to the last row in the result set.
158 <TRUE/> if successful
160 if a database access error occurs.
162 boolean last
() raises
(SQLException
);
163 //-------------------------------------------------------------------------
165 /** retrieves the current row number. The first row is number 1, the
166 second number 2, and so on.
170 if a database access error occurs.
172 long getRow
() raises
(SQLException
);
173 //-------------------------------------------------------------------------
175 /** moves the cursor to the given row number in the result set.
179 If the row number is positive, the cursor moves to
180 the given row number with respect to the
181 beginning of the result set. The first row is row 1, the second
185 If the given row number is negative, the cursor moves to
186 an absolute row position with respect to
187 the end of the result set. For example, calling
188 <code>absolute(-1)</code>
190 cursor on the last row,
191 <code>absolute(-2)</code>
192 indicates the next-to-last row, and so on.
195 An attempt to position the cursor beyond the first/last row in
196 the result set leaves the cursor before/after the first/last
201 <code>absolute(1)</code>
204 <member scope="com::sun::star::sdbc">XResultSet::first()</member>
206 Calling <code>moveToPosition(-1)</code> is the same as calling
207 <code>moveToLast()</code>.
210 boolean absolute
([in] long row
) raises
(SQLException
);
211 //-------------------------------------------------------------------------
213 /** moves the cursor a relative number of rows, either positive or negative.
217 Attempting to move beyond the first/last row in the result set
218 positions the cursor before/after
219 the first/last row. Calling
220 <code>relative(0)</code>
221 is valid, but does not change the cursor position.
225 <code>relative(1)</code>
226 is different from calling
227 <member scope="com::sun::star::sdbc">XResultSet::next()</member>
228 because is makes sense to call
230 when there is no current row, for example, when the cursor is positioned before
231 the first row or after the last row of the result set.
234 how many rows should be moved relative to the current row
236 <TRUE/> if successful
238 if a database access error occurs.
240 boolean relative
([in]long rows
) raises
(SQLException
);
241 //-------------------------------------------------------------------------
243 /** moves the cursor to the previous row in the result set.
248 <code>previous()</code>
250 <code>relative(-1)</code>
251 because it makes sense to call
252 <code>previous()</code>
253 when there is no current row.
256 <TRUE/> if successful
258 if a database access error occurs.
260 boolean previous
() raises
(SQLException
);
261 //-------------------------------------------------------------------------
263 /** refreshes the current row with its most recent value in
264 the database. Cannot be called when on the insert row.
266 <code>refreshRow</code>
267 method provides a way for an application to
268 explicitly tell the SDBC driver to refetch a row(s) from the
269 database. An application may want to call
270 <code>refreshRow</code>
271 when caching or prefetching is being done by the SDBC driver to
272 fetch the latest value of a row from the database. The SDBC driver
273 may actually refresh multiple rows at once if the fetch size is
275 All values are refetched subject to the transaction isolation
276 level and cursor sensitivity. If
277 <code>refreshRow</code>
278 is called after calling
279 <code>updateXXX</code>
281 <member scope="com::sun::star::sdbc">XResultSet::updateRow()</member>
282 , then the updates made to the row are lost.
284 <code>refreshRow</code>
285 frequently will likely slow performance.
287 if a database access error occurs.
289 void refreshRow
() raises
(SQLException
);
290 //-------------------------------------------------------------------------
292 /** indicates whether the current row has been updated. The value returned
293 depends on whether or not the result set can detect updates.
295 <TRUE/> if successful
297 if a database access error occurs.
299 boolean rowUpdated
() raises
(SQLException
);
300 //-------------------------------------------------------------------------
302 /** indicates whether the current row has had an insertion. The value returned
303 depends on whether or not the result set can detect visible inserts.
305 <TRUE/> if successful
307 if a database access error occurs.
309 boolean rowInserted
() raises
(SQLException
);
310 //-------------------------------------------------------------------------
312 /** indicates whether a row has been deleted. A deleted row may leave
313 a visible "hole" in a result set. This method can be used to
314 detect holes in a result set. The value returned depends on whether
315 or not the result set can detect deletions.
317 <TRUE/> if successful
319 if a database access error occurs.
321 boolean rowDeleted
() raises
(SQLException
);
322 //-------------------------------------------------------------------------
324 /** returns the Statement that produced this
325 <type scope="com::sun::star::sdbc">ResultSet</type>
326 object. If the result set was generated some other way, such as by an
327 <type scope="com::sun::star::sdbc">XDatabaseMetaData</type>
328 method, this method returns
334 if a database access error occurs.
336 com
::sun
::star
::uno
::XInterface getStatement
() raises
(SQLException
);
339 //=============================================================================
343 /*===========================================================================
344 ===========================================================================*/