1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_sdbc_XResultSet_idl__
20 #define __com_sun_star_sdbc_XResultSet_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
24 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
26 module com
{ module sun
{ module star
{ module sdbc
{
28 published
interface XStatement
;
31 /** provides the navigation on a table of data. A
32 com::sun::star::sdbc::ResultSet
33 object is usually generated by executing a
34 com::sun::star::sdbc::Statement.
38 A ResultSet maintains a cursor pointing to its current row of
39 data. Initially the cursor is positioned before the first row.
40 The "next" method moves the cursor to the next row.
43 published
interface XResultSet
: com
::sun
::star
::uno
::XInterface
46 /** moves the cursor down one row from its current position.
50 A ResultSet cursor is initially positioned before the first row; the
51 first call to next makes the first row the current row; the
52 second call makes the second row the current row, and so on.
54 <p>If an input stream is open for the current row, a call
57 will implicitly close it.
58 The ResultSet's warning chain is cleared when a new row is read.
63 if a database access error occurs.
65 boolean next
() raises
(SQLException
);
67 /** indicates whether the cursor is before the first row in the result
72 if a database access error occurs.
74 boolean isBeforeFirst
() raises
(SQLException
);
76 /** indicates whether the cursor is after the last row in the result
81 if a database access error occurs.
83 boolean isAfterLast
() raises
(SQLException
);
85 /** indicates whether the cursor is on the first row of the result set.
89 if a database access error occurs.
91 boolean isFirst
() raises
(SQLException
);
93 /** indicates whether the cursor is on the last row of the result set.
101 <code>isAtLast</code>
102 may be expensive because the SDBC driver might need to fetch ahead one row in order
103 to determine whether the current row is the last row in the result set.
108 if a database access error occurs.
110 boolean isLast
() raises
(SQLException
);
112 /** moves the cursor to the front of the result set, just before the
113 first row. Has no effect if the result set contains no rows.
115 if a database access error occurs.
117 void beforeFirst
() raises
(SQLException
);
119 /** moves the cursor to the end of the result set, just after the last
120 row. Has no effect if the result set contains no rows.
122 if a database access error occurs.
124 void afterLast
() raises
(SQLException
);
126 /** moves the cursor to the first row in the result set.
130 if a database access error occurs.
132 boolean first
() raises
(SQLException
);
134 /** moves the cursor to the last row in the result set.
138 if a database access error occurs.
140 boolean last
() raises
(SQLException
);
142 /** retrieves the current row number. The first row is number 1, the
143 second number 2, and so on.
147 if a database access error occurs.
149 long getRow
() raises
(SQLException
);
151 /** moves the cursor to the given row number in the result set.
155 If the row number is positive, the cursor moves to
156 the given row number with respect to the
157 beginning of the result set. The first row is row 1, the second
161 If the given row number is negative, the cursor moves to
162 an absolute row position with respect to
163 the end of the result set. For example, calling
164 <code>absolute(-1)</code>
166 cursor on the last row,
167 <code>absolute(-2)</code>
168 indicates the next-to-last row, and so on.
171 An attempt to position the cursor beyond the first/last row in
172 the result set leaves the cursor before/after the first/last
177 <code>absolute(1)</code>
178 is the same as calling com::sun::star::sdbc::XResultSet::first().
179 Calling <code>moveToPosition(-1)</code> is the same as calling
180 <code>moveToLast()</code>.
183 boolean absolute
([in] long row
) raises
(SQLException
);
185 /** moves the cursor a relative number of rows, either positive or negative.
189 Attempting to move beyond the first/last row in the result set
190 positions the cursor before/after
191 the first/last row. Calling
192 <code>relative(0)</code>
193 is valid, but does not change the cursor position.
197 <code>relative(1)</code>
198 is different from calling
199 com::sun::star::sdbc::XResultSet::next()
200 because is makes sense to call
202 when there is no current row, for example, when the cursor is positioned before
203 the first row or after the last row of the result set.
206 how many rows should be moved relative to the current row
210 if a database access error occurs.
212 boolean relative
([in]long rows
) raises
(SQLException
);
214 /** moves the cursor to the previous row in the result set.
219 <code>previous()</code>
221 <code>relative(-1)</code>
222 because it makes sense to call
223 <code>previous()</code>
224 when there is no current row.
229 if a database access error occurs.
231 boolean previous
() raises
(SQLException
);
233 /** refreshes the current row with its most recent value in
234 the database. Cannot be called when on the insert row.
236 <code>refreshRow</code>
237 method provides a way for an application to
238 explicitly tell the SDBC driver to refetch a row(s) from the
239 database. An application may want to call
240 <code>refreshRow</code>
241 when caching or prefetching is being done by the SDBC driver to
242 fetch the latest value of a row from the database. The SDBC driver
243 may actually refresh multiple rows at once if the fetch size is
245 All values are refetched subject to the transaction isolation
246 level and cursor sensitivity. If
247 <code>refreshRow</code>
248 is called after calling
249 <code>updateXXX</code>
251 com::sun::star::sdbc::XResultSet::updateRow()
252 , then the updates made to the row are lost.
254 <code>refreshRow</code>
255 frequently will likely slow performance.
257 if a database access error occurs.
259 void refreshRow
() raises
(SQLException
);
261 /** indicates whether the current row has been updated. The value returned
262 depends on whether or not the result set can detect updates.
266 if a database access error occurs.
268 boolean rowUpdated
() raises
(SQLException
);
270 /** indicates whether the current row has had an insertion. The value returned
271 depends on whether or not the result set can detect visible inserts.
275 if a database access error occurs.
277 boolean rowInserted
() raises
(SQLException
);
279 /** indicates whether a row has been deleted. A deleted row may leave
280 a visible "hole" in a result set. This method can be used to
281 detect holes in a result set. The value returned depends on whether
282 or not the result set can detect deletions.
286 if a database access error occurs.
288 boolean rowDeleted
() raises
(SQLException
);
290 /** returns the Statement that produced this
291 com::sun::star::sdbc::ResultSet
292 object. If the result set was generated some other way, such as by an
293 com::sun::star::sdbc::XDatabaseMetaData
294 method, this method returns `NULL`.
298 if a database access error occurs.
300 com
::sun
::star
::uno
::XInterface getStatement
() raises
(SQLException
);
306 /*===========================================================================
307 ===========================================================================*/
310 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */