1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XStatement.idl,v $
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
>
37 #ifndef __com_sun_star_sdbc_SQLException_idl__
38 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
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
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
59 close a statement's current ResultSet if an open one exists.
62 published
interface XStatement
: com
::sun
::star
::uno
::XInterface
65 /** executes a SQL statement that returns a single ResultSet.
67 the SQL statement which should be executed
69 a ResultSet that contains the data produced by the query; never <NULL/>
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,
81 a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
83 either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
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.
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>.
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).
117 <TRUE/> if the next result is a ResultSet; <FALSE/> if it is an update count or there are no more results
119 if a database access error occurs.
121 boolean execute
([in]string sql
) raises
(SQLException
);
122 //-------------------------------------------------------------------------
125 <type scope="com::sun::star::sdbc">Connection</type>
128 <code>Statement</code>
131 the connection that produced this statement
134 if a database access error occurs.
136 XConnection getConnection
() raises
(SQLException
);
139 //=============================================================================
143 /*===========================================================================
144 ===========================================================================*/