update dev300-m58
[ooovba.git] / offapi / com / sun / star / sdbc / XStatement.idl
blobc48b7f0da9e05f51bda362266023bcbbca84a670
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XStatement.idl,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_sdbc_XStatement_idl__
31 #define __com_sun_star_sdbc_XStatement_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include <com/sun/star/uno/XInterface.idl>
35 #endif
37 #ifndef __com_sun_star_sdbc_SQLException_idl__
38 #include <com/sun/star/sdbc/SQLException.idl>
39 #endif
41 module com { module sun { module star { module sdbc {
43 published interface XConnection;
44 published interface XResultSet;
47 /** is used for executing a static SQL statement and obtaining the results
48 produced by it.
52 <p>
53 Only one ResultSet per Statement can be open at any point in
54 time; therefore, if the reading of one ResultSet is interleaved
55 with the reading of another, each must have been generated by
56 different Statements. All statement
57 <code>execute</code>
58 methods implicitly
59 close a statement's current ResultSet if an open one exists.
60 </p>
62 published interface XStatement: com::sun::star::uno::XInterface
65 /** executes a SQL statement that returns a single ResultSet.
66 @param sql
67 the SQL statement which should be executed
68 @returns
69 a ResultSet that contains the data produced by the query; never <NULL/>
70 @throws SQLException
71 if a database access error occurs.
73 XResultSet executeQuery([in]string sql) raises (SQLException);
74 //-------------------------------------------------------------------------
76 /** executes an SQL INSERT, UPDATE, or DELETE statement. In addition,
77 SQL statements that return nothing, such as SQL DDL statements,
78 can be executed.
80 @param sql
81 a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
82 @returns
83 either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
84 @throws SQLException
85 if a database access error occurs.
87 long executeUpdate([in]string sql) raises (SQLException);
88 //-------------------------------------------------------------------------
90 /** executes a SQL statement that may return multiple results.
93 <p>
94 Under some (uncommon) situations a single SQL statement may return
95 multiple result sets and/or update counts. Normally you can ignore
96 this unless you are (1) executing a stored procedure that you know may
97 return multiple results or (2) you are dynamically executing an
98 unknown SQL string. The navigation through multiple results is covered by
99 <type scope="com::sun::star::sdbc">XMultipleResults</type>.
100 </p>
102 The
103 <code>execute</code>
104 method executes a SQL statement and indicates
105 the form of the first result. You can then use
106 <member scope="com::sun::star::sdbc">XStatement::getResultSet()</member>
108 <member scope="com::sun::star::sdbc">XStatement::getUpdateCount()</member>
109 to retrieve the result, and
110 <member scope="com::sun::star::sdbc">XStatement::getMoreResults()</member>
111 to move to any subsequent result(s).
112 </p>
114 @param sql
115 any SQL statement
116 @returns
117 <TRUE/> if the next result is a ResultSet; <FALSE/> if it is an update count or there are no more results
118 @throws SQLException
119 if a database access error occurs.
121 boolean execute([in]string sql) raises (SQLException);
122 //-------------------------------------------------------------------------
124 /** returns the
125 <type scope="com::sun::star::sdbc">Connection</type>
126 object
127 that produced this
128 <code>Statement</code>
129 object.
130 @returns
131 the connection that produced this statement
133 @throws SQLException
134 if a database access error occurs.
136 XConnection getConnection() raises (SQLException);
139 //=============================================================================
141 }; }; }; };
143 /*===========================================================================
144 ===========================================================================*/
145 #endif