Language
Asturianu (ast)
Català (ca)
Čeština (cs)
Dansk (da)
Deutsch (de)
English [US] (en-US)
Español (es)
Esperanto (eo)
Eesti keel (et)
Euskara (eu)
Français (fr)
Gàidhlig (gd)
Galego (gl)
Italiano (it)
Lietuvių (lt)
Magyar (hu)
Nederlands (nl)
Norsk (no)
Polski (pl)
Português [do Brasil] (pt-BR)
Português [Europeu] (pt)
Română (ro)
Slovenčina (sk)
Slovenščina (sl)
Suomi (fi)
Svenska (sv)
Yкраїнська (uk)
Tiếng Việt (vi)
Türkçe (tr)
ኦሮሚኛ (om)
Հայերեն (hy)
Ελληνικά (el)
български език (bg)
Русский (ru)
Cрпски [ћирилицом] (sr)
עברית (he)
हिन्दी (hi)
ភាសាខ្មែរ (km)
தமிழ் (ta)
ภาษาไทย (th)
简体中文 (zh-CN)
正體中文 (zh-TW)
日本語 (ja)
한국어 (ko)
The Free and Open Productivity Suite
:: com :: sun :: star :: sdbc ::
interface XStatement
Description
is used for executing a static SQL statement and obtaining the results
produced by it.
Only one ResultSet per Statement can be open at any point in
time; therefore, if the reading of one ResultSet is interleaved
with the reading of another, each must have been generated by
different Statements. All statement
execute
methods implicitly
close a statement's current ResultSet if an open one exists.
Methods' Summary
executeQuery
executes a SQL statement that returns a single ResultSet.
executeUpdate
executes an SQL INSERT, UPDATE, or DELETE statement. In addition,
SQL statements that return nothing, such as SQL DDL statements,
can be executed.
execute
executes a SQL statement that may return multiple results.
getConnection
returns the
Connection
object
that produced this
Statement
object.
Methods' Details
executeQuery
Description
executes a SQL statement that returns a single ResultSet.
Parameter sql
the SQL statement which should be executed
Returns
a ResultSet that contains the data produced by the query; never NULL
Throws
SQLException
if a database access error occurs.
executeUpdate
long
executeUpdate (
[in] string
sql )
raises(
SQLException );
Description
executes an SQL INSERT, UPDATE, or DELETE statement. In addition,
SQL statements that return nothing, such as SQL DDL statements,
can be executed.
Parameter sql
a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing
Returns
either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing
Throws
SQLException
if a database access error occurs.
execute
Description
executes a SQL statement that may return multiple results.
Under some (uncommon) situations a single SQL statement may return
multiple result sets and/or update counts. Normally you can ignore
this unless you are (1) executing a stored procedure that you know may
return multiple results or (2) you are dynamically executing an
unknown SQL string. The navigation through multiple results is covered by
XMultipleResults .
The
execute
method executes a SQL statement and indicates
the form of the first result. You can then use
XStatement ::getResultSet()
or
XStatement ::getUpdateCount()
to retrieve the result, and
XStatement ::getMoreResults()
to move to any subsequent result(s).
Parameter sql
any SQL statement
Returns
true if the next result is a ResultSet; false if it is an update count or there are no more results
Throws
SQLException
if a database access error occurs.
getConnection
Description
returns the
Connection
object
that produced this
Statement
object.
Returns
the connection that produced this statement
Throws
SQLException
if a database access error occurs.
Top of Page Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.