xref: /trunk/main/offapi/com/sun/star/sdbc/XResultSetUpdate.idl (revision ffd38472365e95f6a578737bc9a5eb0fac624a86)
1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XResultSetUpdate_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdbc_XResultSetUpdate_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
37*a893be29SPedro Giffuni/** provides the possibility to write changes made on a result set back to
38cdf0e10cSrcweir    database.
39cdf0e10cSrcweir */
40cdf0e10cSrcweirpublished interface XResultSetUpdate: com::sun::star::uno::XInterface
41cdf0e10cSrcweir{
42cdf0e10cSrcweir    //-------------------------------------------------------------------------
43cdf0e10cSrcweir
44cdf0e10cSrcweir    /** inserts the contents of the insert row into the result set and
45cdf0e10cSrcweir        the database. Must be on the insert row when this method is called.
46cdf0e10cSrcweir        @throws SQLException
47cdf0e10cSrcweir                if a database access error occurs.
48cdf0e10cSrcweir     */
49cdf0e10cSrcweir    void insertRow() raises (SQLException);
50cdf0e10cSrcweir    //-------------------------------------------------------------------------
51cdf0e10cSrcweir
52cdf0e10cSrcweir    /** updates the underlying database with the new contents of the
53cdf0e10cSrcweir        current row. Cannot be called when on the insert row.
54cdf0e10cSrcweir        @throws SQLException
55cdf0e10cSrcweir                if a database access error occurs.
56cdf0e10cSrcweir     */
57cdf0e10cSrcweir    void updateRow() raises (SQLException);
58cdf0e10cSrcweir    //-------------------------------------------------------------------------
59cdf0e10cSrcweir
60cdf0e10cSrcweir    /** deletes the current row from the result set and the underlying
61cdf0e10cSrcweir        database. Cannot be called when on the insert row.
62cdf0e10cSrcweir        @throws SQLException
63cdf0e10cSrcweir                if a database access error occurs.
64cdf0e10cSrcweir     */
65cdf0e10cSrcweir    void deleteRow() raises (SQLException);
66cdf0e10cSrcweir    //-------------------------------------------------------------------------
67cdf0e10cSrcweir
68cdf0e10cSrcweir    /** cancels the updates made to a row.
69cdf0e10cSrcweir
70cdf0e10cSrcweir
71cdf0e10cSrcweir        <p>
72cdf0e10cSrcweir        This method may be called after calling an
73cdf0e10cSrcweir        <code>updateXXX</code>
74cdf0e10cSrcweir        method(s) and before calling
75cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XResultSetUpdate::updateRow()</member>
76cdf0e10cSrcweir        to rollback the updates made to a row. If no updates have been made or
77cdf0e10cSrcweir        <code>updateRow</code>
78cdf0e10cSrcweir        has already been called, then this method has no
79cdf0e10cSrcweir        effect.
80cdf0e10cSrcweir        </p>
81cdf0e10cSrcweir        @throws SQLException
82cdf0e10cSrcweir                if a database access error occurs.
83cdf0e10cSrcweir     */
84cdf0e10cSrcweir    void cancelRowUpdates() raises (SQLException);
85cdf0e10cSrcweir    //-------------------------------------------------------------------------
86cdf0e10cSrcweir
87cdf0e10cSrcweir    /** moves the cursor to the insert row.  The current cursor position is
88cdf0e10cSrcweir        remembered while the cursor is positioned on the insert row.
89cdf0e10cSrcweir
90cdf0e10cSrcweir
91cdf0e10cSrcweir        <p>
92cdf0e10cSrcweir        The insert row is a special row associated with an updatable
93cdf0e10cSrcweir        result set. It is essentially a buffer where a new row may
94cdf0e10cSrcweir        be constructed by calling the
95cdf0e10cSrcweir        <code>updateXXX</code>
96cdf0e10cSrcweir        methods prior to
97cdf0e10cSrcweir        inserting the row into the result set.
98cdf0e10cSrcweir        </p>
99cdf0e10cSrcweir        <p>
100cdf0e10cSrcweir        Only the
101cdf0e10cSrcweir        <code>updateXXX</code>
102cdf0e10cSrcweir        ,
103cdf0e10cSrcweir        <code>getXXX</code>
104cdf0e10cSrcweir        ,
105cdf0e10cSrcweir        and
106cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XResultSetUpdate::insertRow()</member>
107cdf0e10cSrcweir        methods may be
108cdf0e10cSrcweir        called when the cursor is on the insert row.  All of the columns in
109cdf0e10cSrcweir        a result set must be given a value each time this method is
110cdf0e10cSrcweir        called before calling
111cdf0e10cSrcweir        <code>insertRow</code>
112cdf0e10cSrcweir        . The method
113cdf0e10cSrcweir        <code>updateXXX</code>
114cdf0e10cSrcweir        must be called before a
115cdf0e10cSrcweir        <code>getXXX</code>
116cdf0e10cSrcweir        method can be called on a column value.
117cdf0e10cSrcweir        </p>
118cdf0e10cSrcweir        @throws SQLException
119cdf0e10cSrcweir                if a database access error occurs.
120cdf0e10cSrcweir     */
121cdf0e10cSrcweir    void moveToInsertRow() raises (SQLException);
122cdf0e10cSrcweir    //-------------------------------------------------------------------------
123cdf0e10cSrcweir
124cdf0e10cSrcweir    /** moves the cursor to the remembered cursor position, usually the
125cdf0e10cSrcweir        current row. This method has no effect if the cursor is not on the insert
126cdf0e10cSrcweir        row.
127cdf0e10cSrcweir        @throws SQLException
128cdf0e10cSrcweir                if a database access error occurs.
129cdf0e10cSrcweir     */
130cdf0e10cSrcweir    void moveToCurrentRow() raises (SQLException);
131cdf0e10cSrcweir};
132cdf0e10cSrcweir
133cdf0e10cSrcweir//=============================================================================
134cdf0e10cSrcweir
135cdf0e10cSrcweir}; }; }; };
136cdf0e10cSrcweir
137cdf0e10cSrcweir/*===========================================================================
138cdf0e10cSrcweir===========================================================================*/
139cdf0e10cSrcweir#endif
140