uk.org.ogsadai.dataresource
Interface JDBCConnectionProvider

All Known Implementing Classes:
JDBCDataResourceAccessor

public interface JDBCConnectionProvider

Interface providing access to JDBC connections to data resources.

Author:
The OGSA-DAI Project Team

Method Summary
 java.sql.Connection getJDBCConnection(java.lang.String userCredentials)
          Returns a JDBC connection.
 java.lang.String getJDBCDriverClassName()
          Returns the name of the JDBC driver class.
 void releaseJDBCConnection(java.sql.Connection connection)
          Releases a previously obtained JDBC connection.
 

Method Detail

getJDBCDriverClassName

public java.lang.String getJDBCDriverClassName()
Returns the name of the JDBC driver class.

Returns:
the name of the JDBC driver class.

getJDBCConnection

public java.sql.Connection getJDBCConnection(java.lang.String userCredentials)
                                      throws DataResourceAuthorizationException,
                                             JDBCConnectionUseException,
                                             AuthorizationExecutionException
Returns a JDBC connection.

The specified user credential may be used to authorize access to the data resource.

Parameters:
userCredentials - Credentials specifing a user.
Returns:
a JDBC connection.
Throws:
DataResourceAuthorizationException - if the user is not authorized to access the connection.
JDBCConnectionUseException - if there is a problem in using the data resource.
AuthorizationExecutionException - if there is a problem encountered during the authorization.

releaseJDBCConnection

public void releaseJDBCConnection(java.sql.Connection connection)
                           throws JDBCConnectionUseException
Releases a previously obtained JDBC connection.

Once a connection is finished with it should be passed back to this method. This allows connection pooling to be performed under the surface.

Parameters:
connection - JDBC connection to release. If the connection is null or already released then nothing is done.
Throws:
JDBCConnectionUseException - if there is a problem in using the data resource.