Get Database Connection with Transaction

Establishes a connection to a database using a specific transaction programming model.

Inputs

Connection pool name
A String that specifies the name of a valid connection pool.

Implicit transaction
A boolean value to indicate the transaction programming model to use for the database associated with the connection. Valid values are:

true
Database uses implicit transaction bracketing

false
Database uses explicit transaction bracketing

Output

Returns a CwDBConnection object.

Exceptions

The Get Database Connection With Transaction function block can throw the CwDBConnectionFactoryException exception if an error occurs while trying to establish the database connection.

Notes

The Get Database Connection function block obtains a connection from the connection pool that the Connection Pool Name input specifies. This connection provides a way to perform queries and updates to the database associated with the connection. All connections in a particular connection pool as associated with the same database. The function block returns a CwDBConnection object through which you can execute queries and manage transactions.

The connection is released when the collaboration object finishes execution. You can explicitly close this connection with the Release function block. You can determine whether a connection has been released with the Is Active function block. For more information, see "Releasing a connection".

Related information

This function block is based on the BaseCollaboration.getDBConnection() method. For more information, see getDBConnection().

Copyright IBM Corp. 2004