LibreOffice: XPreparedStatement Interface Reference

LibreOffice LibreOffice 6.0 SDK API Reference

Public Member Functions | List of all members
XPreparedStatement Interface Referencepublished

provides the possibility of executing a precompiled SQL statement. More...

`import"XPreparedStatement.idl";`

Inheritance diagram for XPreparedStatement:

## Public Member Functions
XResultSet | executeQuery () raises (SQLException)
| executes the SQL query in this `PreparedStatement` object and returns the result set generated by the query. More...
long | executeUpdate () raises (SQLException)
| executes the SQL INSERT, UPDATE or DELETE statement in this com::sun::star::sdbc::PreparedStatement object. More...
boolean | execute () raises (SQLException)
| executes any kind of SQL statement. More...
XConnection | getConnection () raises (SQLException)
| returns the com::sun::star::sdbc::Connection object that produced this com::sun::star::sdbc::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...

## Detailed Description

provides the possibility of executing a precompiled SQL statement.

A SQL statement is pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

## Member Function Documentation

## ◆ execute()

boolean execute | ( |  | ) |
raises | ( | SQLException
| ) |  |

executes any kind of SQL statement.

Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.

Returns
  `TRUE` if successful

Exceptions

  SQLException | if a database access error occurs.

## ◆ executeQuery()

XResultSet executeQuery | ( |  | ) |
raises | ( | SQLException
| ) |  |

executes the SQL query in this `PreparedStatement` object and returns the result set generated by the query.

Returns
  the ResultSet object

Exceptions

  SQLException | if a database access error occurs.

## ◆ executeUpdate()

long executeUpdate | ( |  | ) |
raises | ( | SQLException
| ) |  |

executes the SQL INSERT, UPDATE or DELETE statement in this com::sun::star::sdbc::PreparedStatement object.

In addition, SQL statements that return nothing, such as SQL DDL statements, can be executed.

Returns
  either the row count for INSERT, UPDATE or DELETE statements; or 0 for SQL statements that return nothing

Exceptions

  SQLException | if a database access error occurs.

## ◆ getConnection()

XConnection getConnection | ( |  | ) |
raises | ( | SQLException
| ) |  |

returns the com::sun::star::sdbc::Connection object that produced this com::sun::star::sdbc::Statement object.

Returns
  the Connection object

Exceptions

  SQLException | if a database access error occurs.

The documentation for this interface was generated from the following file:

- com/sun/star/sdbc/XPreparedStatement.idl