IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services.jdbcservicesinfra
Class JDBCServicesAdministrator

java.lang.Object
  extended bycom.ibm.btt.services.jdbcservicesinfra.JDBCServicesAdministrator
Direct Known Subclasses:
JDBCJournalSchemaGenerator

public class JDBCServicesAdministrator
extends java.lang.Object

The JDBCServicesAdministrator class


Field Summary
static java.lang.String COMPID
          Keeps the component identification that will be used by the traces tool.
static java.util.Hashtable connMgrPool
          Keeps the connection to the database that will be used by the JDBCServicesAdministrator.
static java.sql.Connection databaseConnection
          Keeps the connection to the database that will be used by the JDBCServicesAdministrator.
protected static java.lang.Object getSchemaSem
           
 
Constructor Summary
JDBCServicesAdministrator()
          * This constructor creates a JDBCServicesAdministrator object.
 
Method Summary
 void connect(java.lang.String aDatabaseURL)
          Connects to the database with the aDatabaseURL.
 void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Connects to the database with the URL aDatabaseURL using aUser and aPassword.
 void disconnect()
          Closes the Database connection.
static void dropProcedure(java.lang.String aProcedureName)
          Drops the stored procedure given by aProcedureName.
static JDBCServicesConnectionManager getConnectionManager(java.lang.String connMgrName)
          Get the connection manager from pool.
static StoredProcMetaData getProcedureMetaData(java.lang.String procedureName)
          Obtains the metadata of a specific procedure either from the storedProcsMetaData Hashtable (if it is already there) or from the database.
protected static boolean isRegistered(java.lang.String aProcedureName)
          Checks whether a stored procedure with a specific name is already registered in the database.
protected static boolean isRegistered(java.lang.String schemaName, java.lang.String procName)
          Checks whether a stored procedure with a specific name is already registered in the database.
static void registerProcedure(java.lang.String aStoredProcedure)
          Registers a stored procedure given its SQL definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseConnection

public static java.sql.Connection databaseConnection
Keeps the connection to the database that will be used by the JDBCServicesAdministrator.


COMPID

public static final java.lang.String COMPID
Keeps the component identification that will be used by the traces tool.

See Also:
Constant Field Values

connMgrPool

public static java.util.Hashtable connMgrPool
Keeps the connection to the database that will be used by the JDBCServicesAdministrator.


getSchemaSem

protected static java.lang.Object getSchemaSem
Constructor Detail

JDBCServicesAdministrator

public JDBCServicesAdministrator()
* This constructor creates a JDBCServicesAdministrator object.

Method Detail

connect

public void connect(java.lang.String aDatabaseURL)
             throws DSEInternalErrorException,
                    DSEInvalidRequestException,
                    DSESQLException
Connects to the database with the aDatabaseURL. The database support must prompt a logon panel to enable the user to enter the user ID and password or a DSESQLException will be thrown if the JDBC Driver being used does not allow a connection without specifying the user information (as is the case with the JDBC DB2 net driver).

Parameters:
aDatabaseURL - java.lang.String - the database URL
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

connect

public void connect(java.lang.String aDatabaseURL,
                    java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException
Connects to the database with the URL aDatabaseURL using aUser and aPassword.

Parameters:
aDatabaseURL - java.lang.String - the database URL
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 SQLException is caught

disconnect

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

Throws:
DSESQLException - if a SQLException occurs

dropProcedure

public static void dropProcedure(java.lang.String aProcedureName)
                          throws DSESQLException,
                                 DSEInvalidRequestException,
                                 DSEInternalErrorException
Drops the stored procedure given by aProcedureName.

Parameters:
aProcedureName - java.lang.String
Throws:
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the procedure has not been registered in the database
DSEInternalErrorException - if an internal error occurs

getProcedureMetaData

public static StoredProcMetaData getProcedureMetaData(java.lang.String procedureName)
                                               throws DSESQLException
Obtains the metadata of a specific procedure either from the storedProcsMetaData Hashtable (if it is already there) or from the database.

Parameters:
procedureName - java.lang.String
Returns:
com.ibm.dse.services.jdbc.StoredProcMetaData
Throws:
DSESQLException

isRegistered

protected static boolean isRegistered(java.lang.String aProcedureName)
                               throws DSEInternalErrorException
Checks whether a stored procedure with a specific name is already registered in the database.

Parameters:
aProcedureName - java.lang.String
Returns:
boolean - True if the procedure is registered
Throws:
DSEInternalErrorException

isRegistered

protected static boolean isRegistered(java.lang.String schemaName,
                                      java.lang.String procName)
                               throws DSEInternalErrorException
Checks whether a stored procedure with a specific name is already registered in the database.

Parameters:
schemaName - java.lang.String
procName - java.lang.String
Returns:
boolean - True if the procedure is registered
Throws:
DSEInternalErrorException

registerProcedure

public static void registerProcedure(java.lang.String aStoredProcedure)
                              throws DSESQLException,
                                     DSEInvalidRequestException,
                                     DSEInternalErrorException
Registers a stored procedure given its SQL definition.

Parameters:
aStoredProcedure - java.lang.String
Throws:
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if a stored procedure with the same name is already registered in the database
DSEInternalErrorException - if an internal program error occurs

getConnectionManager

public static JDBCServicesConnectionManager getConnectionManager(java.lang.String connMgrName)
                                                          throws java.io.IOException
Get the connection manager from pool. If there is no connection manager that matched to name, it will try to get the connection manager from the service.

Returns:
java.util.Hashtable
Throws:
java.io.IOException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005