1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_sdbc_XPreparedStatement_idl__
24#define __com_sun_star_sdbc_XPreparedStatement_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_sdbc_SQLException_idl__
31#include <com/sun/star/sdbc/SQLException.idl>
32#endif
33
34 module com {  module sun {  module star {  module sdbc {
35
36 published interface XConnection;
37 published interface XResultSet;
38
39
40/** provides the possibilty of executing a precompiled SQL statement.
41
42
43	<p>
44	A SQL statement is pre-compiled and stored in a PreparedStatement object.
45	This object can then be used to efficiently execute this statement multiple
46	times.
47	</p>
48 */
49published interface XPreparedStatement: com::sun::star::uno::XInterface
50{
51
52	/** executes the SQL query in this
53		<code>PreparedStatement</code>
54		object and returns the result set generated by the query.
55		@returns
56			the ResultSet object
57		@throws SQLException
58			if a database access error occurs.
59	 */
60	XResultSet executeQuery() raises (SQLException);
61	//-------------------------------------------------------------------------
62
63	/** executes the SQL INSERT, UPDATE or DELETE statement in this
64		<type scope="com::sun::star::sdbc">PreparedStatement</type>
65		object.
66		<br/>
67		In addition, SQL statements that return nothing, such as
68		SQL DDL statements, can be executed.
69		@returns
70			either the row count for INSERT, UPDATE or DELETE statements; or 0 for SQL statements that return nothing
71		@throws SQLException
72			if a database access error occurs.
73	 */
74	long executeUpdate() raises (SQLException);
75	//-------------------------------------------------------------------------
76
77	/** executes any kind of SQL statement.
78
79
80		<p>
81		Some prepared statements return multiple results; the execute
82		method handles these complex statements as well as the simpler
83		form of statements handled by executeQuery and executeUpdate.
84		</p>
85		@returns
86			<TRUE/> if successful
87		@throws SQLException
88			if a database access error occurs.
89	 */
90	boolean execute() raises (SQLException);
91	//-------------------------------------------------------------------------
92
93	/** returns the
94		<type scope="com::sun::star::sdbc">Connection</type>
95		object
96		that produced this
97		<type scope="com::sun::star::sdbc">Statement</type>
98		object.
99		@returns
100			the Connection object
101		@throws SQLException
102			if a database access error occurs.
103	 */
104	XConnection getConnection() raises (SQLException);
105};
106
107//=============================================================================
108
109}; }; }; };
110
111/*===========================================================================
112===========================================================================*/
113#endif
114