IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services.jdbcservicesinfra
Interface DatabaseConnect

All Known Subinterfaces:
JournalService, TableService
All Known Implementing Classes:
JDBCJournal, JDBCJournalImpl, JDBCService, JDBCServiceImpl, JDBCTableService, JDBCTableServiceImpl

public interface DatabaseConnect

The DatabaseConnect interface provides the public abstract methods that are used to get a database connection and release the database connection by all database services.


Method Summary
 void connect(java.lang.String aUser, java.lang.String aPassword)
          Connects to the Database set in the DataSource definition, with user identification aUser and password aPassword.
 void disconnect()
          Closes the Database connection.
 java.lang.String getDataSourceName()
          Returns the dataSourceName attribute value.
 boolean isConnected()
          Returns true if there is a connection to the database or false if there is not.
 boolean isWaitRetry()
          Returns the waitRetry attribute value.
 void setDataSourceName(java.lang.String newDataSourceName)
          Sets the dataSourceName attribute value to newDataSourceName.
 void setWaitRetry(boolean newWaitRetry)
          Sets the waitRetry attribute value to newWaitRetry.
 

Method Detail

connect

public void connect(java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database set in the DataSource definition, with user identification aUser and password aPassword. Can only be used if the connection is requested to a pool of connections implemented as a DataSource with the database URL specified as part of the DataSource definition

Parameters:
aUser - java.lang.String - the user identification
aPassword - java.lang.String - the user password
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

disconnect

public void disconnect()
                throws DSESQLException,
                       DSEException
Closes the Database connection.

Throws:
DSESQLException - if a SQL Exception occurs
DSEException - if an exception is thrown when calling the pool of connections manager

getDataSourceName

public java.lang.String getDataSourceName()
                                   throws DSEException
Returns the dataSourceName attribute value.

Returns:
java.lang.String
Throws:
DSEException

isConnected

public boolean isConnected()
                    throws DSEInvalidRequestException,
                           DSEInternalErrorException,
                           DSESQLException,
                           DSEObjectNotFoundException,
                           DSEException
Returns true if there is a connection to the database or false if there is not. If the autoConnect attribute has been set to true, it creates its own connection to the database if not yet created.

Returns:
boolean
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException
DSEException

isWaitRetry

public boolean isWaitRetry()
                    throws DSEException
Returns the waitRetry attribute value.

Returns:
boolean
Throws:
DSEException

setDataSourceName

public void setDataSourceName(java.lang.String newDataSourceName)
                       throws DSEException
Sets the dataSourceName attribute value to newDataSourceName.

Parameters:
newDataSourceName - java.lang.String
Throws:
DSEException

setWaitRetry

public void setWaitRetry(boolean newWaitRetry)
                  throws DSEException
Sets the waitRetry attribute value to newWaitRetry.

Parameters:
newWaitRetry - boolean
Throws:
DSEException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005