|
LibreOffice
LibreOffice 5.3 SDK API Reference
|
is used for executing a static SQL statement and obtaining the results produced by it. More...
import"XStatement.idl";
Public Member Functions | |
| XResultSet | executeQuery ([in]string sql) raises (SQLException) |
| executes a SQL statement that returns a single ResultSet. More... | |
| long | executeUpdate ([in]string sql) raises (SQLException) |
| executes an SQL INSERT, UPDATE, or DELETE statement. More... | |
| boolean | execute ([in]string sql) raises (SQLException) |
| executes a SQL statement that may return multiple results. More... | |
| XConnection | getConnection () raises (SQLException) |
returns the com::sun::star::sdbc::Connection object that produced this Statement object. More... | |
Public Member Functions inherited from XInterface | |
| any | queryInterface ([in] type aType) |
| queries for a new interface to an existing UNO object. More... | |
| void | acquire () |
| increases the reference counter by one. More... | |
| void | release () |
| decreases the reference counter by one. More... | |
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.
| boolean execute | ( | [in] string | sql | ) | |
| raises | ( | SQLException | |||
| ) | |||||
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 com::sun::star::sdbc::XMultipleResults.
The execute method executes a SQL statement and indicates the form of the first result. You can then use com::sun::star::sdbc::XMultipleResults::getResultSet() or com::sun::star::sdbc::XMultipleResults::getUpdateCount() to retrieve the result, and com::sun::star::sdbc::XMultipleResults::getMoreResults() to move to any subsequent result(s).
| sql | any SQL statement |
TRUE if the next result is a ResultSet; FALSE if it is an update count or there are no more results | SQLException | if a database access error occurs. |
| XResultSet executeQuery | ( | [in] string | sql | ) | |
| raises | ( | SQLException | |||
| ) | |||||
executes a SQL statement that returns a single ResultSet.
| sql | the SQL statement which should be executed |
NULL | SQLException | if a database access error occurs. |
| long executeUpdate | ( | [in] string | sql | ) | |
| raises | ( | SQLException | |||
| ) | |||||
executes an SQL INSERT, UPDATE, or DELETE statement.
In addition, SQL statements that return nothing, such as SQL DDL statements, can be executed.
| sql | a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing |
| SQLException | if a database access error occurs. |
| XConnection getConnection | ( | ) | ||
| raises | ( | SQLException | ||
| ) | ||||
returns the com::sun::star::sdbc::Connection object that produced this Statement object.
| SQLException | if a database access error occurs. |
1.8.13