xref: /AOO41X/main/offapi/com/sun/star/sdbc/Statement.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_sdbc_Statement_idl__
24#define __com_sun_star_sdbc_Statement_idl__
25
26#ifndef __com_sun_star_lang_XComponent_idl__
27#include <com/sun/star/lang/XComponent.idl>
28#endif
29
30#ifndef __com_sun_star_beans_XPropertySet_idl__
31#include <com/sun/star/beans/XPropertySet.idl>
32#endif
33
34#ifndef __com_sun_star_util_XCancellable_idl__
35#include <com/sun/star/util/XCancellable.idl>
36#endif
37
38 module com {  module sun {  module star {  module sdbc {
39
40 published interface XWarningsSupplier;
41 published interface XStatement;
42 published interface XBatchExecution;
43 published interface XMultipleResults;
44 published interface XCloseable;
45
46
47/** is used for executing a static SQL statement and obtaining the results
48    produced by it.
49
50    <p>
51    Only one ResultSet per Statement can be open at any point in
52    time. Therefore, if the reading of one ResultSet is interleaved
53    with the reading of another, each must have been generated by
54    different Statements. All statement <code>execute</code> methods implicitly
55    close a statement's current ResultSet if an open one exists.
56    </p>
57 */
58published service Statement
59{
60
61    /** optional for implementation, controls the releasing of resources
62             and the notification of registered listeners.
63     */
64    [optional] interface com::sun::star::lang::XComponent;
65
66
67    /** freeing all resources of a statement. A related resultset will be
68             freed as well.
69     */
70    interface XCloseable;
71
72    // gives access to the properties.
73    interface com::sun::star::beans::XPropertySet;
74
75    /** could be used for cancelling the execution of SQL statements if both
76             the DBMS and the driver support aborting an SQL statement.
77             The implementation is optional.
78     */
79    [optional] interface com::sun::star::util::XCancellable;
80
81    /** is the interface for executing SQL commands.
82     */
83    interface XStatement;
84
85
86    /** provides the ability of batch execution. This interface is optional
87             for execution.
88             <p>
89             A driver implementing batch execution must return
90             <TRUE/>
91             for
92             <member scope= "com::sun::star::sdbc"> XDatabaseMetaData::supportsBatchUpdates()</member>
93             </p>
94     */
95    [optional] interface XBatchExecution;
96
97
98    /** controls the chaining of warnings, which may occur on every call
99             to the connected database. Chained warnings from previous calls will be
100             cleared before processing a new call.
101     */
102    interface XWarningsSupplier;
103
104
105    /** covers the handling of multiple results after executing an SQL command.
106                The implementation is optional.
107     */
108    [optional] interface XMultipleResults;
109
110
111    /** retrieves the number of seconds the driver will wait for a Statement
112        to execute. If the limit is exceeded, a SQLException is thrown.
113        There is no limitation, if set to zero.
114     */
115    [property] long QueryTimeOut;
116
117
118    /**  returns the maximum number of bytes allowed for any column value.
119
120        <p>
121        This limit is the maximum number of bytes that can be returned
122        for any column value. The limit applies only to
123        <member scope= "com::sun::star::sdbc">DataType::BINARY</member>
124              ,
125              <member scope= "com::sun::star::sdbc">DataType::VARBINARY</member>
126              ,
127              <member scope= "com::sun::star::sdbc">DataType::LONGVARBINARY</member>
128              ,
129              <member scope= "com::sun::star::sdbc">DataType::CHAR</member>
130              ,
131              <member scope= "com::sun::star::sdbc">DataType::VARCHAR</member>
132              ,
133              and
134              <member scope= "com::sun::star::sdbc">DataType::LONGVARCHAR</member>
135              columns.
136        If the limit is exceeded, the excess data is silently discarded.
137        <br/>
138        There is no limitation, if set to zero.
139        </p>
140     */
141    [property] long MaxFieldSize;
142
143
144    /** retrieves the maximum number of rows that a ResultSet can contain.
145        If the limit is exceeded, the excess rows are silently dropped.
146        <br/>
147        There is no limitation, if set to zero.
148     */
149    [property] long MaxRows;
150
151
152    /** defines the SQL cursor name that will be used by subsequent Statement
153        <code>execute</code>
154        methods.
155
156        <p>
157        This name can then be used in SQL positioned update/delete statements to
158        identify the current row in the ResultSet generated by this statement. If
159        the database does not support positioned update/delete, this property is
160        a noop. To insure that a cursor has the proper isolation level to support
161        updates, the cursor's SELECT statement should be of the form
162        'select for update ...'. If the 'for update' phrase is omitted,
163        positioned updates may fail.
164        </p>
165        <p>
166        <b>
167        Note:
168        </b>
169        By definition, positioned update/delete
170        execution must be done by a different Statement than the one
171        which generated the ResultSet being used for positioning. Also,
172        cursor names must be unique within a connection.
173        </p>
174     */
175    [property] string CursorName;
176
177
178    /** retrieves the result set concurrency.
179
180        @see com::sun::star::sdbc::ResultSetConcurrency
181     */
182    [property] long ResultSetConcurrency;
183
184
185    /** determine the result set type.
186
187        @see com::sun::star::sdbc::ResultSetType
188     */
189    [property] long ResultSetType;
190
191
192    /** retrieves the direction for fetching rows from database tables
193        that is the default for result sets generated from this
194        <code>Statement</code>
195        object.
196        <br/>
197        If this
198        <code>Statement</code>
199        object has not set a fetch direction,
200        the return value is implementation-specific.
201     */
202    [property] long FetchDirection;
203
204
205    /** retrieves the number of result set rows that is the default fetch size
206        for result sets generated from this
207        <code>Statement</code>
208        object.
209        <br/>
210        If this
211        <code>Statement</code>
212        object has not set a fetch size,
213        the return value is implementation-specific.
214     */
215    [property] long FetchSize;
216
217
218    /** returns if escape processing is on or off.
219        If escape scanning is on (the default), the driver will do
220        escape substitution before sending the SQL to the database.
221     */
222    [property] boolean EscapeProcessing;
223};
224
225//=============================================================================
226
227}; }; }; };
228
229#endif
230