1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_sdbc_XStatement_idl__
28 #define __com_sun_star_sdbc_XStatement_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
34 #ifndef __com_sun_star_sdbc_SQLException_idl__
35 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
38 module com
{ module sun
{ module star
{ module sdbc
{
40 published
interface XConnection
;
41 published
interface XResultSet
;
44 /** is used for executing a static SQL statement and obtaining the results
50 Only one ResultSet per Statement can be open at any point in
51 time; therefore, if the reading of one ResultSet is interleaved
52 with the reading of another, each must have been generated by
53 different Statements. All statement
56 close a statement's current ResultSet if an open one exists.
59 published
interface XStatement
: com
::sun
::star
::uno
::XInterface
62 /** executes a SQL statement that returns a single ResultSet.
64 the SQL statement which should be executed
66 a ResultSet that contains the data produced by the query; never <NULL/>
68 if a database access error occurs.
70 XResultSet executeQuery
([in]string sql
) raises
(SQLException
);
71 //-------------------------------------------------------------------------
73 /** executes an SQL INSERT, UPDATE, or DELETE statement. In addition,
74 SQL statements that return nothing, such as SQL DDL statements,
78 a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
80 either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
82 if a database access error occurs.
84 long executeUpdate
([in]string sql
) raises
(SQLException
);
85 //-------------------------------------------------------------------------
87 /** executes a SQL statement that may return multiple results.
91 Under some (uncommon) situations a single SQL statement may return
92 multiple result sets and/or update counts. Normally you can ignore
93 this unless you are (1) executing a stored procedure that you know may
94 return multiple results or (2) you are dynamically executing an
95 unknown SQL string. The navigation through multiple results is covered by
96 <type scope="com::sun::star::sdbc">XMultipleResults</type>.
101 method executes a SQL statement and indicates
102 the form of the first result. You can then use
103 <member scope="com::sun::star::sdbc">XStatement::getResultSet()</member>
105 <member scope="com::sun::star::sdbc">XStatement::getUpdateCount()</member>
106 to retrieve the result, and
107 <member scope="com::sun::star::sdbc">XStatement::getMoreResults()</member>
108 to move to any subsequent result(s).
114 <TRUE/> if the next result is a ResultSet; <FALSE/> if it is an update count or there are no more results
116 if a database access error occurs.
118 boolean execute
([in]string sql
) raises
(SQLException
);
119 //-------------------------------------------------------------------------
122 <type scope="com::sun::star::sdbc">Connection</type>
125 <code>Statement</code>
128 the connection that produced this statement
131 if a database access error occurs.
133 XConnection getConnection
() raises
(SQLException
);
136 //=============================================================================
140 /*===========================================================================
141 ===========================================================================*/