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_PreparedStatement_idl__
20 #define __com_sun_star_sdbc_PreparedStatement_idl__
22 #include
<com
/sun
/star
/lang
/XComponent.idl
>
24 #include
<com
/sun
/star
/beans
/XPropertySet.idl
>
26 #include
<com
/sun
/star
/util
/XCancellable.idl
>
28 module com
{ module sun
{ module star
{ module sdbc
{
30 published
interface XPreparedStatement
;
31 published
interface XPreparedBatchExecution
;
32 published
interface XParameters
;
33 published
interface XWarningsSupplier
;
34 published
interface XMultipleResults
;
35 published
interface XResultSetMetaDataSupplier
;
36 published
interface XCloseable
;
39 /** represents a precompiled SQL statement.
41 A SQL statement is pre-compiled and stored in a PreparedStatement object.
42 This object can then be used to efficiently execute this statement multiple
51 methods for setting IN parameter values
52 must specify types that are compatible with the defined SQL type of
53 the input parameter. For instance, if the IN parameter has SQL type
54 Integer, then the method
55 com::sun::star::sdbc::XParameters::setInt()
59 If arbitrary parameter type conversions are required, the method
60 com::sun::star::sdbc::XParameters::setObject()
61 should be used with a target SQL type.
64 Example of setting a parameter; <code>con</code> is an active connection.
66 pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?")
67 pstmt.setDouble(1, 153833.00)
68 pstmt.setLong(2, 110592)
73 com::sun::star::sdbc::ResultSet
75 com::sun::star::sdbc::Statement
76 can be open at any point in
77 time. Therefore, if the reading of one ResultSet is interleaved
78 with the reading of another, each must have been generated by
79 different Statements. All statement
81 methods implicitly close a statement's current ResultSet if an open one exists.
84 published service PreparedStatement
87 /** optional for implementation, controls the releasing of resources
88 and the notification of registered listeners.
90 [optional] interface com
::sun
::star
::lang
::XComponent
;
93 /** freeing all resources of a statement. A related result set will be
98 // gives access to the properties.
99 interface com
::sun
::star
::beans
::XPropertySet
;
101 /** could be used for canceling the execution of SQL statements, if both
102 the DBMS and the driver support aborting an SQL statement.
103 The implementation is optional.
105 [optional] interface com
::sun
::star
::util
::XCancellable
;
107 /** is the interface for executing SQL prepared commands.
109 interface XPreparedStatement
;
112 /** provides access to the description of the result set which would be generated by executing the
115 interface XResultSetMetaDataSupplier
;
118 /** is used for setting parameters before execution of the precompiled
121 interface XParameters
;
124 /** provides the ability of batch execution. This interface is optional
127 A driver implementing batch execution must return
130 com::sun::star::sdbc::XDatabaseMetaData::supportsBatchUpdates()
133 [optional] interface XPreparedBatchExecution
;
136 /** controls the chaining of warnings, which may occur on every call
137 to the connected database. Chained warnings from previous calls will be
138 cleared before processing a new call.
140 interface XWarningsSupplier
;
143 /** covers the handling of multiple results after executing an SQL command.
145 interface XMultipleResults
;
148 /** retrieves the number of seconds the driver will wait for a Statement
149 to execute. If the limit is exceeded, a SQLException is thrown.
150 There is no limitation, if set to zero.
152 [property
] long QueryTimeOut
;
155 /** returns the maximum number of bytes allowed for any column value.
157 This limit is the maximum number of bytes that can be returned
158 for any column value. The limit applies only to
159 com::sun::star::sdbc::DataType::BINARY
161 com::sun::star::sdbc::DataType::VARBINARY
163 com::sun::star::sdbc::DataType::LONGVARBINARY
165 com::sun::star::sdbc::DataType::CHAR
167 com::sun::star::sdbc::DataType::VARCHAR
170 com::sun::star::sdbc::DataType::LONGVARCHAR
172 If the limit is exceeded, the excess data is silently discarded.
175 There is no limitation, if set to zero.
178 [property
] long MaxFieldSize
;
181 /** retrieves the maximum number of rows that a ResultSet can contain.
182 If the limit is exceeded, the excess rows are silently dropped.
183 <br>There is no limitation, if set to zero.
185 [property
] long MaxRows
;
188 /** defines the SQL cursor name that will be used by subsequent Statement
192 This name can then be used in SQL positioned update/delete statements to
193 identify the current row in the ResultSet generated by this statement. If
194 the database does not support positioned update/delete, this property is
195 a noop. To insure that a cursor has the proper isolation level to support
196 updates, the cursor's SELECT statement should be of the form
197 "select for update ...". If the "for update" phrase is omitted,
198 positioned updates may fail.
204 By definition, positioned update/delete
205 execution must be done by a different Statement than the one
206 which generated the ResultSet being used for positioning. Also,
207 cursor names must be unique within a connection.
210 [property
] string CursorName
;
213 /** retrieves the result set concurrency.
214 @see com::sun::star::sdbc::ResultSetConcurrency
216 [property
] long ResultSetConcurrency
;
219 /** Determine the result set type.
220 @see com::sun::star::sdbc::ResultSetType
222 [property
] long ResultSetType
;
225 /** retrieves the direction for fetching rows from database tables
226 that is the default for result sets generated from this
227 <code>Statement</code>
231 <code>Statement</code>
232 object has not set a fetch direction,
233 the return value is implementation-specific.
236 [property
] long FetchDirection
;
239 /** retrieves the number of result set rows that is the default fetch size
240 for result sets generated from this
241 <code>Statement</code>
245 <code>Statement</code>
246 object has not set a fetch size,
247 the return value is implementation-specific.
250 [property
] long FetchSize
;
258 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */