com.bowstreet.builders.webapp.methods
Interface SqlDataSource


public interface SqlDataSource

Interface for all builder helper classes that implement runtime functionality to allocate JDBC Connections from a JDBC DataSource. WebApp Variables that have this interface are automatically discovered by the SQL Transaction builder and become choices for the "DataSource Name" input of the transaction steps.

Version:
1.0 9/17/02
Author:
David Gawron

Method Summary
 java.sql.Connection acquireConnection(WebAppAccess webAppAccess)
          Method used to acquire a JDBC Connection from a DataSource.
 java.sql.Connection acquireConnection(WebAppAccess webAppAccess, java.lang.String dataSourceUser, java.lang.String dataSourcePassword)
          Method used to acquire a JDBC connection from a DataSource using the given DataSource name and password (which over-ride any name and password defined by the builder or the DataSource itself).
 void initialize(WebAppAccess webAppAccess)
          Method used to initialize the helper class with the current set of values for the indirect references that were used to define the builder's inputs.
 void releaseConnection(WebAppAccess webAppAccess, java.sql.Connection connection)
          Method used to release a JDBC connection acquired from the DataSource represented by this class.
 

Method Detail

acquireConnection

java.sql.Connection acquireConnection(WebAppAccess webAppAccess)
Method used to acquire a JDBC Connection from a DataSource.

Parameters:
webAppAccess - The WebApp instance for the request.
Returns:
Returns a JDBC Connection that can be used to execute SQL statements against a database. If a valid connection cannot be allocated for this request, then a WebAppRuntimeException will be thrown with a message that indicates why a connection was not allocated.

acquireConnection

java.sql.Connection acquireConnection(WebAppAccess webAppAccess,
                                      java.lang.String dataSourceUser,
                                      java.lang.String dataSourcePassword)
Method used to acquire a JDBC connection from a DataSource using the given DataSource name and password (which over-ride any name and password defined by the builder or the DataSource itself).

Parameters:
webAppAccess - The WebApp instance for the request.
dataSourceUser - The name of the DataSource user on whose behalf the the connection request is being made.
dataSourcePassword - The password of the DataSource user on whose behalf the the connection request is being made.
Returns:
Returns a JDBC Connection that can be used to execute SQL statements against a database. If a valid connection cannot be allocated for this user, then a WebAppRuntimeException will be thrown with a message that indicates why a connection was not allocated.

initialize

void initialize(WebAppAccess webAppAccess)
Method used to initialize the helper class with the current set of values for the indirect references that were used to define the builder's inputs.

Parameters:
webAppAccess - The web app access instance for the request. If NULL, the the class will re-initialize itself with the values it already has.

releaseConnection

void releaseConnection(WebAppAccess webAppAccess,
                       java.sql.Connection connection)
Method used to release a JDBC connection acquired from the DataSource represented by this class.

Parameters:
webAppAccess - The WebApp instance for the request.
connection - The JDBC connection to be released.


Copyright © 2009 IBM. All Rights Reserved.