Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / sdbc / XStatement.idl
blob4d0ac4bad061a20987b41cc3a3342067e599d9f0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_XStatement_idl__
20 #define __com_sun_star_sdbc_XStatement_idl__
22 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/sdbc/SQLException.idl>
26 module com { module sun { module star { module sdbc {
28 published interface XConnection;
29 published interface XResultSet;
32 /** is used for executing a static SQL statement and obtaining the results
33 produced by it.
37 <p>
38 Only one ResultSet per Statement can be open at any point in
39 time; therefore, if the reading of one ResultSet is interleaved
40 with the reading of another, each must have been generated by
41 different Statements. All statement
42 <code>execute</code>
43 methods implicitly
44 close a statement's current ResultSet if an open one exists.
45 </p>
47 published interface XStatement: com::sun::star::uno::XInterface
50 /** executes a SQL statement that returns a single ResultSet.
51 @param sql
52 the SQL statement which should be executed
53 @returns
54 a ResultSet that contains the data produced by the query; never `NULL`
55 @throws SQLException
56 if a database access error occurs.
58 XResultSet executeQuery([in]string sql) raises (SQLException);
60 /** executes an SQL INSERT, UPDATE, or DELETE statement. In addition,
61 SQL statements that return nothing, such as SQL DDL statements,
62 can be executed.
64 @param sql
65 a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
66 @returns
67 either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
68 @throws SQLException
69 if a database access error occurs.
71 long executeUpdate([in]string sql) raises (SQLException);
73 /** executes a SQL statement that may return multiple results.
76 <p>
77 Under some (uncommon) situations a single SQL statement may return
78 multiple result sets and/or update counts. Normally you can ignore
79 this unless you are (1) executing a stored procedure that you know may
80 return multiple results or (2) you are dynamically executing an
81 unknown SQL string. The navigation through multiple results is covered by
82 com::sun::star::sdbc::XMultipleResults.
83 </p>
84 <p>
85 The
86 <code>execute</code>
87 method executes a SQL statement and indicates
88 the form of the first result. You can then use
89 com::sun::star::sdbc::XMultipleResults::getResultSet()
91 com::sun::star::sdbc::XMultipleResults::getUpdateCount()
92 to retrieve the result, and
93 com::sun::star::sdbc::XMultipleResults::getMoreResults()
94 to move to any subsequent result(s).
95 </p>
97 @param sql
98 any SQL statement
99 @returns
100 `TRUE` if the next result is a ResultSet; `FALSE` if it is an update count or there are no more results
101 @throws SQLException
102 if a database access error occurs.
104 boolean execute([in]string sql) raises (SQLException);
106 /** returns the
107 com::sun::star::sdbc::Connection
108 object
109 that produced this
110 <code>Statement</code>
111 object.
112 @returns
113 the connection that produced this statement
115 @throws SQLException
116 if a database access error occurs.
118 XConnection getConnection() raises (SQLException);
122 }; }; }; };
124 /*===========================================================================
125 ===========================================================================*/
126 #endif
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */