LibreOffice: XConnectionTools Interface Reference

LibreOffice LibreOffice 7.6 SDK API Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XConnectionTools Interface Reference

encapsulates various useful functionality around a com::sun::star::sdb::Connection More...

Inheritance diagram for XConnectionTools:

## Public Member Functions
XTableName | createTableName ()
| creates an instance supporting the XTableName interface, which can be used to manipulate table names for various purposes.
XObjectNames | getObjectNames ()
| returns an instance supporting the XObjectNames interface, which provides access to functionality around table and query names.
XDataSourceMetaData | getDataSourceMetaData ()
| provides access to the application-level data source meta data
::com::sun::star::container::XNameAccess | getFieldsByCommandDescriptor ([in] long commandType, [in] string command, [out] ::com::sun::star::lang::XComponent keepFieldsAlive) raises ( com::sun::star::sdbc::SQLException )
| get fields for a result set given by a "command descriptor"
::com::sun::star::sdb::XSingleSelectQueryComposer | getComposer ([in] long commandType,[in] string command)
| get the composer initialized with a command and command type.

## Detailed Description

encapsulates various useful functionality around a com::sun::star::sdb::Connection

Most of the functionality provided here is meaningful only relative to a given database connection. For instance, for quoting table names, you need the meta data instance of the connection. Thus, the entry point for obtaining a XConnectionTools instance is the com::sun::star::sdb::Connection service.

Note that nearly all functionality provided by this interface is also available by other means, it's only provided here for convenience purposes.

Since
  OOo 2.0.4

## Member Function Documentation

## ◆ createTableName()

XTableName createTableName | ( |  | ) |

creates an instance supporting the XTableName interface, which can be used to manipulate table names for various purposes.

The returned object is guaranteed to not be `NULL`.

## ◆ getComposer()

::com::sun::star::sdb::XSingleSelectQueryComposer getComposer | ( | [in] long | commandType,
|  | [in] string | command
| ) |  |

get the composer initialized with a command and command type.

Parameters

  commandType | the type of the object
  command | the object. This may be a table name, a query name, or an SQL statement, depending on the value of _nCommandType

Returns
  the composer filled with command and command type.

## ◆ getDataSourceMetaData()

XDataSourceMetaData getDataSourceMetaData | ( |  | ) |

provides access to the application-level data source meta data

## ◆ getFieldsByCommandDescriptor()

::com::sun::star::container::XNameAccess getFieldsByCommandDescriptor | ( | [in] long | commandType,
|  | [in] string | command,
|  | [out] ::com::sun::star::lang::XComponent | keepFieldsAlive
| ) |  |
raises | ( | com::sun::star::sdbc::SQLException
| ) |  |

get fields for a result set given by a "command descriptor"

A command descriptor here means:

- a SDB-level connection (com.sun.star.sdb::Connection
- a string specifying the name of an object relative to the connection
- a com.sun.star.sdb::CommandType value specifying the type of the object

Parameters

  commandType | the type of the object
  command | the object. This may be a table name, a query name, or an SQL statement, depending on the value of _nCommandType
  keepFieldsAlive | If (and only if) CommandType is CommandType.COMMAND, the fields collection which is returned by this function here is a temporary object. It is kept alive by another object, which is to be created temporarily, too. To ensure that the fields you get are valid as long as you need them, the owner which controls their life time is transferred to this parameter upon return. Your fields live as long as this component lives. Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore. It depends on the connection's implementation if this is necessary, but the is no guarantee, so to be on the safe side with respect to resource leaks, you should dispose the component.

Returns
  the container of the columns (aka fields) of the object

## ◆ getObjectNames()

XObjectNames getObjectNames | ( |  | ) |

returns an instance supporting the XObjectNames interface, which provides access to functionality around table and query names.

The returned object is guaranteed to not be `NULL`.

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

- com/sun/star/sdb/tools/XConnectionTools.idl