xref: /trunk/main/offapi/com/sun/star/sdbc/XResultSet.idl (revision ffd38472365e95f6a578737bc9a5eb0fac624a86)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XResultSet_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdbc_XResultSet_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
31cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
35cdf0e10cSrcweir
36cdf0e10cSrcweir published interface XStatement;
37cdf0e10cSrcweir
38cdf0e10cSrcweir
39cdf0e10cSrcweir/** provides the navigation on a table of data.  A
40cdf0e10cSrcweir    <type scope="com::sun::star::sdbc">ResultSet</type>
41cdf0e10cSrcweir    object is usually generated by executing a
42cdf0e10cSrcweir    <type scope="com::sun::star::sdbc">Statement</type>
43cdf0e10cSrcweir    .
44cdf0e10cSrcweir
45cdf0e10cSrcweir
46cdf0e10cSrcweir    <p>
47cdf0e10cSrcweir    A ResultSet maintains a cursor pointing to its current row of
48cdf0e10cSrcweir    data. Initially the cursor is positioned before the first row.
49cdf0e10cSrcweir    The 'next' method moves the cursor to the next row.
50cdf0e10cSrcweir    </p>
51cdf0e10cSrcweir */
52cdf0e10cSrcweirpublished interface XResultSet: com::sun::star::uno::XInterface
53cdf0e10cSrcweir{
54cdf0e10cSrcweir    //-------------------------------------------------------------------------
55cdf0e10cSrcweir
56cdf0e10cSrcweir    /** moves the cursor down one row from its current position.
57cdf0e10cSrcweir
58cdf0e10cSrcweir
59cdf0e10cSrcweir        <p>
60cdf0e10cSrcweir        A ResultSet cursor is initially positioned before the first row; the
61cdf0e10cSrcweir        first call to next makes the first row the current row; the
62cdf0e10cSrcweir        second call makes the second row the current row, and so on.
63cdf0e10cSrcweir        </p>
64cdf0e10cSrcweir        <p>If an input stream is open for the current row, a call
65cdf0e10cSrcweir        to the method
66cdf0e10cSrcweir        <code>next</code>
67cdf0e10cSrcweir        will implicitly close it.
68cdf0e10cSrcweir        The ResultSet's warning chain is cleared when a new row is read.
69cdf0e10cSrcweir        </p>
70cdf0e10cSrcweir        @returns
71cdf0e10cSrcweir         <TRUE/> if successful
72cdf0e10cSrcweir        @throws SQLException
73cdf0e10cSrcweir            if a database access error occurs.
74cdf0e10cSrcweir     */
75cdf0e10cSrcweir    boolean next() raises (SQLException);
76cdf0e10cSrcweir    //-------------------------------------------------------------------------
77cdf0e10cSrcweir
78cdf0e10cSrcweir    /** indicates whether the cursor is before the first row in the result
79cdf0e10cSrcweir        set.
80cdf0e10cSrcweir        @returns
81cdf0e10cSrcweir         <TRUE/> if so
82cdf0e10cSrcweir        @throws SQLException
83cdf0e10cSrcweir            if a database access error occurs.
84cdf0e10cSrcweir     */
85cdf0e10cSrcweir    boolean isBeforeFirst() raises (SQLException);
86cdf0e10cSrcweir    //-------------------------------------------------------------------------
87cdf0e10cSrcweir
88cdf0e10cSrcweir    /** indicates whether the cursor is after the last row in the result
89cdf0e10cSrcweir        set.
90cdf0e10cSrcweir        @returns
91cdf0e10cSrcweir         <TRUE/> if so
92cdf0e10cSrcweir        @throws SQLException
93cdf0e10cSrcweir            if a database access error occurs.
94cdf0e10cSrcweir     */
95cdf0e10cSrcweir    boolean isAfterLast() raises (SQLException);
96cdf0e10cSrcweir    //-------------------------------------------------------------------------
97cdf0e10cSrcweir
98cdf0e10cSrcweir    /** indicates whether the cursor is on the first row of the result set.
99cdf0e10cSrcweir        @returns
100cdf0e10cSrcweir         <TRUE/> if so
101cdf0e10cSrcweir        @throws SQLException
102cdf0e10cSrcweir            if a database access error occurs.
103cdf0e10cSrcweir     */
104cdf0e10cSrcweir    boolean isFirst() raises (SQLException);
105cdf0e10cSrcweir    //-------------------------------------------------------------------------
106cdf0e10cSrcweir
107cdf0e10cSrcweir    /** indicates whether the cursor is on the last row of the result set.
108cdf0e10cSrcweir
109cdf0e10cSrcweir
110cdf0e10cSrcweir        <p>
111cdf0e10cSrcweir        <B>
112cdf0e10cSrcweir        Note:
113cdf0e10cSrcweir        </B>
114cdf0e10cSrcweir        Calling the method
115cdf0e10cSrcweir        <code>isAtLast</code>
116cdf0e10cSrcweir        may be expensive because the SDBC driver might need to fetch ahead one row in order
117cdf0e10cSrcweir        to determine whether the current row is the last row in the result set.
118cdf0e10cSrcweir        </p>
119cdf0e10cSrcweir        @returns
120cdf0e10cSrcweir         <TRUE/> if so
121cdf0e10cSrcweir        @throws SQLException
122cdf0e10cSrcweir            if a database access error occurs.
123cdf0e10cSrcweir     */
124cdf0e10cSrcweir    boolean isLast() raises (SQLException);
125cdf0e10cSrcweir    //-------------------------------------------------------------------------
126cdf0e10cSrcweir
127cdf0e10cSrcweir    /** moves the cursor to the front of the result set, just before the
128cdf0e10cSrcweir        first row. Has no effect if the result set contains no rows.
129cdf0e10cSrcweir        @throws SQLException
130cdf0e10cSrcweir            if a database access error occurs.
131cdf0e10cSrcweir     */
132cdf0e10cSrcweir    void beforeFirst() raises (SQLException);
133cdf0e10cSrcweir    //-------------------------------------------------------------------------
134cdf0e10cSrcweir
135cdf0e10cSrcweir    /** moves the cursor to the end of the result set, just after the last
136cdf0e10cSrcweir        row. Has no effect if the result set contains no rows.
137cdf0e10cSrcweir        @throws SQLException
138cdf0e10cSrcweir            if a database access error occurs.
139cdf0e10cSrcweir     */
140cdf0e10cSrcweir    void afterLast() raises (SQLException);
141cdf0e10cSrcweir    //-------------------------------------------------------------------------
142cdf0e10cSrcweir
143cdf0e10cSrcweir    /** moves the cursor to the first row in the result set.
144cdf0e10cSrcweir        @returns
145cdf0e10cSrcweir         <TRUE/> if successful
146cdf0e10cSrcweir        @throws SQLException
147cdf0e10cSrcweir            if a database access error occurs.
148cdf0e10cSrcweir     */
149cdf0e10cSrcweir    boolean first() raises (SQLException);
150cdf0e10cSrcweir    //-------------------------------------------------------------------------
151cdf0e10cSrcweir
152cdf0e10cSrcweir    /** moves the cursor to the last row in the result set.
153cdf0e10cSrcweir        @returns
154cdf0e10cSrcweir         <TRUE/> if successful
155cdf0e10cSrcweir        @throws SQLException
156cdf0e10cSrcweir            if a database access error occurs.
157cdf0e10cSrcweir     */
158cdf0e10cSrcweir    boolean last() raises (SQLException);
159cdf0e10cSrcweir    //-------------------------------------------------------------------------
160cdf0e10cSrcweir
161cdf0e10cSrcweir    /** retrieves the current row number. The first row is number 1, the
162cdf0e10cSrcweir        second number 2, and so on.
163cdf0e10cSrcweir        @returns
164cdf0e10cSrcweir         the current position
165cdf0e10cSrcweir        @throws SQLException
166cdf0e10cSrcweir            if a database access error occurs.
167cdf0e10cSrcweir     */
168cdf0e10cSrcweir    long getRow() raises (SQLException);
169cdf0e10cSrcweir    //-------------------------------------------------------------------------
170cdf0e10cSrcweir
171cdf0e10cSrcweir    /** moves the cursor to the given row number in the result set.
172cdf0e10cSrcweir
173cdf0e10cSrcweir
174cdf0e10cSrcweir        <p>
175cdf0e10cSrcweir        If the row number is positive, the cursor moves to
176cdf0e10cSrcweir        the given row number with respect to the
177cdf0e10cSrcweir        beginning of the result set. The first row is row 1, the second
178cdf0e10cSrcweir        is row 2, and so on.
179cdf0e10cSrcweir        </p>
180cdf0e10cSrcweir        <p>
181cdf0e10cSrcweir        If the given row number is negative, the cursor moves to
182cdf0e10cSrcweir        an absolute row position with respect to
183cdf0e10cSrcweir        the end of the result set. For example, calling
184cdf0e10cSrcweir        <code>absolute(-1)</code>
185cdf0e10cSrcweir        positions the
186cdf0e10cSrcweir        cursor on the last row,
187cdf0e10cSrcweir        <code>absolute(-2)</code>
188cdf0e10cSrcweir        indicates the next-to-last row, and so on.
189cdf0e10cSrcweir        </p>
190cdf0e10cSrcweir        <p>
191cdf0e10cSrcweir        An attempt to position the cursor beyond the first/last row in
192cdf0e10cSrcweir        the result set leaves the cursor before/after the first/last
193cdf0e10cSrcweir        row, respectively.
194cdf0e10cSrcweir        </p>
195cdf0e10cSrcweir        <p>
196cdf0e10cSrcweir        Note: Calling
197cdf0e10cSrcweir        <code>absolute(1)</code>
198cdf0e10cSrcweir        is the same
199cdf0e10cSrcweir        as calling
200cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XResultSet::first()</member>
201cdf0e10cSrcweir        .
202cdf0e10cSrcweir        Calling <code>moveToPosition(-1)</code> is the same as calling
203cdf0e10cSrcweir        <code>moveToLast()</code>.
204cdf0e10cSrcweir        </p>
205cdf0e10cSrcweir     */
206cdf0e10cSrcweir    boolean absolute([in] long row ) raises (SQLException);
207cdf0e10cSrcweir    //-------------------------------------------------------------------------
208cdf0e10cSrcweir
209cdf0e10cSrcweir    /** moves the cursor a relative number of rows, either positive or negative.
210cdf0e10cSrcweir
211cdf0e10cSrcweir
212cdf0e10cSrcweir        <p>
213cdf0e10cSrcweir        Attempting to move beyond the first/last row in the result set
214cdf0e10cSrcweir        positions the cursor before/after
215cdf0e10cSrcweir        the first/last row. Calling
216cdf0e10cSrcweir        <code>relative(0)</code>
217cdf0e10cSrcweir        is valid, but does not change the cursor position.
218cdf0e10cSrcweir        </p>
219cdf0e10cSrcweir        <p>
220cdf0e10cSrcweir        Note: Calling
221cdf0e10cSrcweir        <code>relative(1)</code>
222cdf0e10cSrcweir        is different from calling
223cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XResultSet::next()</member>
224cdf0e10cSrcweir        because is makes sense to call
225cdf0e10cSrcweir        <code>next()</code>
226cdf0e10cSrcweir        when there is no current row, for example, when the cursor is positioned before
227cdf0e10cSrcweir        the first row or after the last row of the result set.
228cdf0e10cSrcweir        </p>
229cdf0e10cSrcweir        @param rows
230cdf0e10cSrcweir            how many rows should be moved relative to the current row
231cdf0e10cSrcweir        @returns
232cdf0e10cSrcweir         <TRUE/> if successful
233cdf0e10cSrcweir        @throws SQLException
234cdf0e10cSrcweir            if a database access error occurs.
235cdf0e10cSrcweir     */
236cdf0e10cSrcweir    boolean relative([in]long rows) raises (SQLException);
237cdf0e10cSrcweir    //-------------------------------------------------------------------------
238cdf0e10cSrcweir
239cdf0e10cSrcweir    /** moves the cursor to the previous row in the result set.
240cdf0e10cSrcweir
241cdf0e10cSrcweir
242cdf0e10cSrcweir        <p>
243cdf0e10cSrcweir        Note:
244cdf0e10cSrcweir        <code>previous()</code>
245cdf0e10cSrcweir        is not the same as
246cdf0e10cSrcweir        <code>relative(-1)</code>
247cdf0e10cSrcweir        because it makes sense to call
248cdf0e10cSrcweir        <code>previous()</code>
249cdf0e10cSrcweir        when there is no current row.
250cdf0e10cSrcweir        </p>
251cdf0e10cSrcweir        @returns
252cdf0e10cSrcweir            <TRUE/> if successful
253cdf0e10cSrcweir        @throws SQLException
254cdf0e10cSrcweir            if a database access error occurs.
255cdf0e10cSrcweir     */
256cdf0e10cSrcweir    boolean previous() raises (SQLException);
257cdf0e10cSrcweir    //-------------------------------------------------------------------------
258cdf0e10cSrcweir
259cdf0e10cSrcweir    /** refreshes the current row with its most recent value in
260cdf0e10cSrcweir        the database. Cannot be called when on the insert row.
261cdf0e10cSrcweir        The
262cdf0e10cSrcweir        <code>refreshRow</code>
263cdf0e10cSrcweir        method provides a way for an application to
264cdf0e10cSrcweir        explicitly tell the SDBC driver to refetch a row(s) from the
265cdf0e10cSrcweir        database. An application may want to call
266cdf0e10cSrcweir        <code>refreshRow</code>
267cdf0e10cSrcweir        when caching or prefetching is being done by the SDBC driver to
268cdf0e10cSrcweir        fetch the latest value of a row from the database. The SDBC driver
269cdf0e10cSrcweir        may actually refresh multiple rows at once if the fetch size is
270cdf0e10cSrcweir        greater than one.
271cdf0e10cSrcweir        All values are refetched subject to the transaction isolation
272cdf0e10cSrcweir        level and cursor sensitivity. If
273cdf0e10cSrcweir        <code>refreshRow</code>
274cdf0e10cSrcweir        is called after calling
275cdf0e10cSrcweir        <code>updateXXX</code>
276cdf0e10cSrcweir        , but before calling
277cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XResultSet::updateRow()</member>
278cdf0e10cSrcweir        , then the updates made to the row are lost.
279cdf0e10cSrcweir        Calling the method
280cdf0e10cSrcweir        <code>refreshRow</code>
281cdf0e10cSrcweir        frequently will likely slow performance.
282cdf0e10cSrcweir        @throws SQLException
283cdf0e10cSrcweir            if a database access error occurs.
284cdf0e10cSrcweir     */
285cdf0e10cSrcweir    void refreshRow() raises (SQLException);
286cdf0e10cSrcweir    //-------------------------------------------------------------------------
287cdf0e10cSrcweir
288cdf0e10cSrcweir    /** indicates whether the current row has been updated. The value returned
289cdf0e10cSrcweir        depends on whether or not the result set can detect updates.
290cdf0e10cSrcweir        @returns
291cdf0e10cSrcweir            <TRUE/> if successful
292cdf0e10cSrcweir        @throws SQLException
293cdf0e10cSrcweir            if a database access error occurs.
294cdf0e10cSrcweir     */
295cdf0e10cSrcweir    boolean rowUpdated() raises (SQLException);
296cdf0e10cSrcweir    //-------------------------------------------------------------------------
297cdf0e10cSrcweir
298cdf0e10cSrcweir    /** indicates whether the current row has had an insertion.  The value returned
299cdf0e10cSrcweir        depends on whether or not the result set can detect visible inserts.
300cdf0e10cSrcweir        @returns
301cdf0e10cSrcweir            <TRUE/> if successful
302cdf0e10cSrcweir        @throws SQLException
303cdf0e10cSrcweir            if a database access error occurs.
304cdf0e10cSrcweir     */
305cdf0e10cSrcweir    boolean rowInserted() raises (SQLException);
306cdf0e10cSrcweir    //-------------------------------------------------------------------------
307cdf0e10cSrcweir
308cdf0e10cSrcweir    /** indicates whether a row has been deleted.  A deleted row may leave
309cdf0e10cSrcweir        a visible "hole" in a result set.  This method can be used to
310cdf0e10cSrcweir        detect holes in a result set.  The value returned depends on whether
311cdf0e10cSrcweir        or not the result set can detect deletions.
312cdf0e10cSrcweir        @returns
313cdf0e10cSrcweir            <TRUE/> if successful
314cdf0e10cSrcweir        @throws SQLException
315cdf0e10cSrcweir            if a database access error occurs.
316cdf0e10cSrcweir     */
317cdf0e10cSrcweir    boolean rowDeleted() raises (SQLException);
318cdf0e10cSrcweir    //-------------------------------------------------------------------------
319cdf0e10cSrcweir
320cdf0e10cSrcweir    /** returns the Statement that produced this
321cdf0e10cSrcweir        <type scope="com::sun::star::sdbc">ResultSet</type>
322cdf0e10cSrcweir        object. If the result set was generated some other way, such as by an
323cdf0e10cSrcweir        <type scope="com::sun::star::sdbc">XDatabaseMetaData</type>
324cdf0e10cSrcweir        method, this method returns
325cdf0e10cSrcweir        <NULL/>
326cdf0e10cSrcweir        .
327cdf0e10cSrcweir        @returns
328cdf0e10cSrcweir            the statement object
329cdf0e10cSrcweir        @throws SQLException
330cdf0e10cSrcweir            if a database access error occurs.
331cdf0e10cSrcweir     */
332cdf0e10cSrcweir    com::sun::star::uno::XInterface getStatement() raises (SQLException);
333cdf0e10cSrcweir};
334cdf0e10cSrcweir
335cdf0e10cSrcweir//=============================================================================
336cdf0e10cSrcweir
337cdf0e10cSrcweir}; }; }; };
338cdf0e10cSrcweir
339cdf0e10cSrcweir/*===========================================================================
340cdf0e10cSrcweir===========================================================================*/
341cdf0e10cSrcweir#endif
342