LibreOffice: Statement Service Reference

LibreOffice LibreOffice 7.4 SDK API Reference

Loading...
Searching...
No Matches
Exported Interfaces | Public Attributes | List of all members
Statement Service Referencepublished

is used for executing a static SQL statement and obtaining the results produced by it. More...

Inheritance diagram for Statement:

## Exported Interfaces
interface | com::sun::star::lang::XComponent
| optional for implementation, controls the releasing of resources and the notification of registered listeners.
interface | XCloseable
| freeing all resources of a statement.
interface | com::sun::star::beans::XPropertySet
interface | com::sun::star::util::XCancellable
| could be used for canceling the execution of SQL statements if both the DBMS and the driver support aborting an SQL statement.
interface | XStatement
| is the interface for executing SQL commands.
interface | XBatchExecution
| provides the ability of batch execution.
interface | XWarningsSupplier
| controls the chaining of warnings, which may occur on every call to the connected database.
interface | XMultipleResults
| covers the handling of multiple results after executing an SQL command.

## Public Attributes
long | QueryTimeOut
| retrieves the number of seconds the driver will wait for a Statement to execute.
long | MaxFieldSize
| returns the maximum number of bytes allowed for any column value.
long | MaxRows
| retrieves the maximum number of rows that a ResultSet can contain.
string | CursorName
| defines the SQL cursor name that will be used by subsequent Statement `execute` methods.
long | ResultSetConcurrency
| retrieves the result set concurrency.
long | ResultSetType
| determine the result set type.
long | FetchDirection
| retrieves the direction for fetching rows from database tables that is the default for result sets generated from this `Statement` object.
long | FetchSize
| retrieves the number of result set rows that is the default fetch size for result sets generated from this `Statement` object.
boolean | EscapeProcessing
| returns if escape processing is on or off.

## Additional Inherited Members
Public Member Functions inherited from XCloseable
void | close () raises (SQLException)
| releases all resources connected to an object.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.
Public Member Functions inherited from XPropertySet
com::sun::star::beans::XPropertySetInfo | getPropertySetInfo ()
void | setPropertyValue ([in] string aPropertyName, [in] any aValue) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::WrappedTargetException )
| sets the value of the property with the specified name.
any | getPropertyValue ([in] string PropertyName) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
void | addPropertyChangeListener ([in] string aPropertyName, [in] com::sun::star::beans::XPropertyChangeListener xListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| adds an XPropertyChangeListener to the specified property.
void | removePropertyChangeListener ([in] string aPropertyName, [in] com::sun::star::beans::XPropertyChangeListener aListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| removes an XPropertyChangeListener from the listener list.
void | addVetoableChangeListener ([in] string PropertyName, [in] com::sun::star::beans::XVetoableChangeListener aListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| adds an XVetoableChangeListener to the specified property with the name PropertyName.
void | removeVetoableChangeListener ([in] string PropertyName, [in] com::sun::star::beans::XVetoableChangeListener aListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| removes an XVetoableChangeListener from the listener list.
Public Member Functions inherited from XStatement
XResultSet | executeQuery ([in]string sql) raises (SQLException)
| executes a SQL statement that returns a single ResultSet.
long | executeUpdate ([in]string sql) raises (SQLException)
| executes an SQL INSERT, UPDATE, or DELETE statement.
boolean | execute ([in]string sql) raises (SQLException)
| executes a SQL statement that may return multiple results.
XConnection | getConnection () raises (SQLException)
| returns the com::sun::star::sdbc::Connection object that produced this `Statement` object.
Public Member Functions inherited from XWarningsSupplier
any | getWarnings () raises (SQLException)
| returns the first warning reported by calls on an object that supports the usage of warnings.
void | clearWarnings () raises (SQLException)
| clears all warnings reported for the object implementing the interface.
Protected Member Functions inherited from XComponent
void | dispose ()
| The owner of an object calls this method to explicitly free all resources kept by this object and thus break cyclic references.
void | addEventListener ([in] XEventListener xListener)
| adds an event listener to the object.
void | removeEventListener ([in] XEventListener aListener)
| removes an event listener from the listener list.
Protected Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.
Protected Member Functions inherited from XCloseable
void | close () raises (SQLException)
| releases all resources connected to an object.
Protected Member Functions inherited from XPropertySet
com::sun::star::beans::XPropertySetInfo | getPropertySetInfo ()
void | setPropertyValue ([in] string aPropertyName, [in] any aValue) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::WrappedTargetException )
| sets the value of the property with the specified name.
any | getPropertyValue ([in] string PropertyName) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
void | addPropertyChangeListener ([in] string aPropertyName, [in] com::sun::star::beans::XPropertyChangeListener xListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| adds an XPropertyChangeListener to the specified property.
void | removePropertyChangeListener ([in] string aPropertyName, [in] com::sun::star::beans::XPropertyChangeListener aListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| removes an XPropertyChangeListener from the listener list.
void | addVetoableChangeListener ([in] string PropertyName, [in] com::sun::star::beans::XVetoableChangeListener aListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| adds an XVetoableChangeListener to the specified property with the name PropertyName.
void | removeVetoableChangeListener ([in] string PropertyName, [in] com::sun::star::beans::XVetoableChangeListener aListener) raises ( com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException )
| removes an XVetoableChangeListener from the listener list.
Protected Member Functions inherited from XCancellable
void | cancel ()
| cancels the current job of the object.
Protected Member Functions inherited from XStatement
XResultSet | executeQuery ([in]string sql) raises (SQLException)
| executes a SQL statement that returns a single ResultSet.
long | executeUpdate ([in]string sql) raises (SQLException)
| executes an SQL INSERT, UPDATE, or DELETE statement.
boolean | execute ([in]string sql) raises (SQLException)
| executes a SQL statement that may return multiple results.
XConnection | getConnection () raises (SQLException)
| returns the com::sun::star::sdbc::Connection object that produced this `Statement` object.
Protected Member Functions inherited from XBatchExecution
void | addBatch ([in]string sql) raises (SQLException)
| adds a SQL command to the current batch of commands for the statement object.
void | clearBatch () raises (SQLException)
| makes the set of commands in the current batch empty.
sequence< long > | executeBatch () raises (SQLException)
| submits a batch of commands to the database for execution.
Protected Member Functions inherited from XWarningsSupplier
any | getWarnings () raises (SQLException)
| returns the first warning reported by calls on an object that supports the usage of warnings.
void | clearWarnings () raises (SQLException)
| clears all warnings reported for the object implementing the interface.
Protected Member Functions inherited from XMultipleResults
XResultSet | getResultSet () raises (SQLException)
| returns the current result as a com::sun::star::sdbc::ResultSet object.
long | getUpdateCount () raises (SQLException)
| returns the current result as an update count.
boolean | getMoreResults () raises (SQLException)
| moves to a Statement's next result.

## Detailed 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.

Developers Guide
  Database Access - Creating Statements

## Exported Interfaces

## ◆ com::sun::star::beans::XPropertySet

interface com::sun::star::beans::XPropertySet

## ◆ com::sun::star::lang::XComponent

interface com::sun::star::lang::XComponent
| optional

optional for implementation, controls the releasing of resources and the notification of registered listeners.

## ◆ com::sun::star::util::XCancellable

interface com::sun::star::util::XCancellable
| optional

could be used for canceling the execution of SQL statements if both the DBMS and the driver support aborting an SQL statement.

The implementation is optional.

## ◆ XBatchExecution

interface XBatchExecution
| optional

provides the ability of batch execution.

This interface is optional for execution.

A driver implementing batch execution must return `TRUE` for com::sun::star::sdbc:: XDatabaseMetaData::supportsBatchUpdates()

## ◆ XCloseable

interface XCloseable

freeing all resources of a statement.

A related result set will be freed as well.

## ◆ XMultipleResults

interface XMultipleResults
| optional

covers the handling of multiple results after executing an SQL command.

The implementation is optional.

## ◆ XStatement

interface XStatement

is the interface for executing SQL commands.

## ◆ XWarningsSupplier

interface XWarningsSupplier

controls the chaining of warnings, which may occur on every call to the connected database.

Chained warnings from previous calls will be cleared before processing a new call.

## Member Data Documentation

## ◆ CursorName

string CursorName
| property

defines the SQL cursor name that will be used by subsequent Statement `execute` methods.

This name can then be used in SQL positioned update/delete statements to identify the current row in the ResultSet generated by this statement. If the database does not support positioned update/delete, this property is a noop. To ensure that a cursor has the proper isolation level to support updates, the cursor's SELECT statement should be of the form "select for update ...". If the "for update" phrase is omitted, positioned updates may fail.

Note: By definition, positioned update/delete execution must be done by a different Statement than the one which generated the ResultSet being used for positioning. Also, cursor names must be unique within a connection.

## ◆ EscapeProcessing

boolean EscapeProcessing
| property

returns if escape processing is on or off.

If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.

## ◆ FetchDirection

long FetchDirection
| property

retrieves the direction for fetching rows from database tables that is the default for result sets generated from this `Statement` object.

If this `Statement` object has not set a fetch direction, the return value is implementation-specific.

## ◆ FetchSize

long FetchSize
| property

retrieves the number of result set rows that is the default fetch size for result sets generated from this `Statement` object.

If this `Statement` object has not set a fetch size, the return value is implementation-specific.

## ◆ MaxFieldSize

long MaxFieldSize
| property

returns the maximum number of bytes allowed for any column value.

This limit is the maximum number of bytes that can be returned for any column value. The limit applies only to com::sun::star::sdbc::DataType::BINARY , com::sun::star::sdbc::DataType::VARBINARY , com::sun::star::sdbc::DataType::LONGVARBINARY , com::sun::star::sdbc::DataType::CHAR , com::sun::star::sdbc::DataType::VARCHAR , and com::sun::star::sdbc::DataType::LONGVARCHAR columns. If the limit is exceeded, the excess data is silently discarded.
There is no limitation, if set to zero.

## ◆ MaxRows

long MaxRows
| property

retrieves the maximum number of rows that a ResultSet can contain.

If the limit is exceeded, the excess rows are silently dropped.
There is no limitation, if set to zero.

## ◆ QueryTimeOut

long QueryTimeOut
| property

retrieves the number of seconds the driver will wait for a Statement to execute.

If the limit is exceeded, a SQLException is thrown. There is no limitation, if set to zero.

## ◆ ResultSetConcurrency

long ResultSetConcurrency
| property

retrieves the result set concurrency.

See also
  com::sun::star::sdbc::ResultSetConcurrency

## ◆ ResultSetType

long ResultSetType
| property

determine the result set type.

See also
  com::sun::star::sdbc::ResultSetType

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

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