LibreOffice LibreOffice 24.2 SDK API Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XDataSource Interface Referencepublished

is used for establishing connections via a factory which is identified by its name. More...

`import <XDataSource.idl;`

Inheritance diagram for XDataSource:

## Public Member Functions
XConnection | getConnection ([in]string user, [in]string password) raises (SQLException)
| attempts to establish a database connection.
void | setLoginTimeout ([in]long seconds) raises (SQLException)
| sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
long | getLoginTimeout () raises (SQLException)
| gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
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.

## Detailed Description

is used for establishing connections via a factory which is identified by its name.

A DataSource object is typically registered by a naming service provider.

Developers Guide
  Database Access - Connecting Through a DataSource

## Member Function Documentation

## ◆ getConnection()

XConnection getConnection | ( | [in] string | user,
|  | [in] string | password )
raises | ( | SQLException ) |  |  |

attempts to establish a database connection.

Parameters

  user | the user name
  password | the password

Returns
  the connection object

Exceptions

  SQLException | if a database access error occurs.

## ◆ getLoginTimeout()

long getLoginTimeout | ( |  | ) |
raises | ( | SQLException ) |  |  |

gets the maximum time in seconds that this data source can wait while attempting to connect to a database.

A value of zero means that the timeout is the default system timeout if there is one; otherwise, it means that there is no timeout. When a DataSource object is created the login timeout is initially zero.

Returns
  the login time limit in seconds

Exceptions

  SQLException | if a database access error occurs.

## ◆ setLoginTimeout()

void setLoginTimeout | ( | [in] long | seconds | ) |
raises | ( | SQLException ) |  |  |

sets the maximum time in seconds that this data source will wait while attempting to connect to a database.

A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. When a DataSource object is created the login timeout is initially zero.

Parameters

  seconds | the login time limit in seconds

Exceptions

  SQLException | if a database access error occurs.

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

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