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 .
20 module com
{ module sun
{ module star
{ module sdbc
{
22 published
interface XStatement
;
25 /** provides the navigation on a table of data. A
26 com::sun::star::sdbc::ResultSet
27 object is usually generated by executing a
28 com::sun::star::sdbc::Statement.
32 A ResultSet maintains a cursor pointing to its current row of
33 data. Initially the cursor is positioned before the first row.
34 The "next" method moves the cursor to the next row.
37 published
interface XResultSet
: com
::sun
::star
::uno
::XInterface
40 /** moves the cursor down one row from its current position.
44 A ResultSet cursor is initially positioned before the first row; the
45 first call to next makes the first row the current row; the
46 second call makes the second row the current row, and so on.
48 <p>If an input stream is open for the current row, a call
51 will implicitly close it.
52 The ResultSet's warning chain is cleared when a new row is read.
57 if a database access error occurs.
59 boolean next
() raises
(SQLException
);
61 /** indicates whether the cursor is before the first row in the result
66 if a database access error occurs.
68 boolean isBeforeFirst
() raises
(SQLException
);
70 /** indicates whether the cursor is after the last row in the result
75 if a database access error occurs.
77 boolean isAfterLast
() raises
(SQLException
);
79 /** indicates whether the cursor is on the first row of the result set.
83 if a database access error occurs.
85 boolean isFirst
() raises
(SQLException
);
87 /** indicates whether the cursor is on the last row of the result set.
96 may be expensive because the SDBC driver might need to fetch ahead one row in order
97 to determine whether the current row is the last row in the result set.
102 if a database access error occurs.
104 boolean isLast
() raises
(SQLException
);
106 /** moves the cursor to the front of the result set, just before the
107 first row. Has no effect if the result set contains no rows.
109 if a database access error occurs.
111 void beforeFirst
() raises
(SQLException
);
113 /** moves the cursor to the end of the result set, just after the last
114 row. Has no effect if the result set contains no rows.
116 if a database access error occurs.
118 void afterLast
() raises
(SQLException
);
120 /** moves the cursor to the first row in the result set.
124 if a database access error occurs.
126 boolean first
() raises
(SQLException
);
128 /** moves the cursor to the last row in the result set.
132 if a database access error occurs.
134 boolean last
() raises
(SQLException
);
136 /** retrieves the current row number. The first row is number 1, the
137 second number 2, and so on.
141 if a database access error occurs.
143 long getRow
() raises
(SQLException
);
145 /** moves the cursor to the given row number in the result set.
149 If the row number is positive, the cursor moves to
150 the given row number with respect to the
151 beginning of the result set. The first row is row 1, the second
155 If the given row number is negative, the cursor moves to
156 an absolute row position with respect to
157 the end of the result set. For example, calling
158 <code>absolute(-1)</code>
160 cursor on the last row,
161 <code>absolute(-2)</code>
162 indicates the next-to-last row, and so on.
165 An attempt to position the cursor beyond the first/last row in
166 the result set leaves the cursor before/after the first/last
171 <code>absolute(1)</code>
172 is the same as calling com::sun::star::sdbc::XResultSet::first().
173 Calling <code>moveToPosition(-1)</code> is the same as calling
174 <code>moveToLast()</code>.
177 boolean absolute
([in] long row
) raises
(SQLException
);
179 /** moves the cursor a relative number of rows, either positive or negative.
183 Attempting to move beyond the first/last row in the result set
184 positions the cursor before/after
185 the first/last row. Calling
186 <code>relative(0)</code>
187 is valid, but does not change the cursor position.
191 <code>relative(1)</code>
192 is different from calling
193 com::sun::star::sdbc::XResultSet::next()
194 because is makes sense to call
196 when there is no current row, for example, when the cursor is positioned before
197 the first row or after the last row of the result set.
200 how many rows should be moved relative to the current row
204 if a database access error occurs.
206 boolean relative
([in]long rows
) raises
(SQLException
);
208 /** moves the cursor to the previous row in the result set.
213 <code>previous()</code>
215 <code>relative(-1)</code>
216 because it makes sense to call
217 <code>previous()</code>
218 when there is no current row.
223 if a database access error occurs.
225 boolean previous
() raises
(SQLException
);
227 /** refreshes the current row with its most recent value in
228 the database. Cannot be called when on the insert row.
230 <code>refreshRow</code>
231 method provides a way for an application to
232 explicitly tell the SDBC driver to refetch a row(s) from the
233 database. An application may want to call
234 <code>refreshRow</code>
235 when caching or prefetching is being done by the SDBC driver to
236 fetch the latest value of a row from the database. The SDBC driver
237 may actually refresh multiple rows at once if the fetch size is
239 All values are refetched subject to the transaction isolation
240 level and cursor sensitivity. If
241 <code>refreshRow</code>
242 is called after calling
243 <code>updateXXX</code>
245 com::sun::star::sdbc::XResultSet::updateRow()
246 , then the updates made to the row are lost.
248 <code>refreshRow</code>
249 frequently will likely slow performance.
251 if a database access error occurs.
253 void refreshRow
() raises
(SQLException
);
255 /** indicates whether the current row has been updated. The value returned
256 depends on whether or not the result set can detect updates.
260 if a database access error occurs.
262 boolean rowUpdated
() raises
(SQLException
);
264 /** indicates whether the current row has had an insertion. The value returned
265 depends on whether or not the result set can detect visible inserts.
269 if a database access error occurs.
271 boolean rowInserted
() raises
(SQLException
);
273 /** indicates whether a row has been deleted. A deleted row may leave
274 a visible "hole" in a result set. This method can be used to
275 detect holes in a result set. The value returned depends on whether
276 or not the result set can detect deletions.
280 if a database access error occurs.
282 boolean rowDeleted
() raises
(SQLException
);
284 /** returns the Statement that produced this
285 com::sun::star::sdbc::ResultSet
286 object. If the result set was generated some other way, such as by an
287 com::sun::star::sdbc::XDatabaseMetaData
288 method, this method returns `NULL`.
292 if a database access error occurs.
294 com
::sun
::star
::uno
::XInterface getStatement
() raises
(SQLException
);
300 /*===========================================================================
301 ===========================================================================*/
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */