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