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_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
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
44 close a statement's current ResultSet if an open one exists.
47 published
interface XStatement
: com
::sun
::star
::uno
::XInterface
50 /** executes a SQL statement that returns a single ResultSet.
52 the SQL statement which should be executed
54 a ResultSet that contains the data produced by the query; never `NULL`
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,
65 a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
67 either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
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.
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.
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).
100 `TRUE` if the next result is a ResultSet; `FALSE` if it is an update count or there are no more results
102 if a database access error occurs.
104 boolean execute
([in]string sql
) raises
(SQLException
);
107 com::sun::star::sdbc::Connection
110 <code>Statement</code>
113 the connection that produced this statement
116 if a database access error occurs.
118 XConnection getConnection
() raises
(SQLException
);
124 /*===========================================================================
125 ===========================================================================*/
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */