com.ibm.dse.services.jdbc
Class JDBCServicesAdministrator

java.lang.Object
  |
  +--com.ibm.dse.services.jdbc.JDBCServicesAdministrator
Direct Known Subclasses:
JDBCJournalSchemaGenerator, JDBCStoreSchemaGenerator

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.
protected static java.sql.Connection databaseConnection
          Keeps the connection to the database that will be used by the JDBCServicesAdministrator.
 
Constructor Summary
JDBCServicesAdministrator()
          * This constructor creates a JDBCServicesAdministrator object.
 
Method Summary
 void connect(java.lang.String aDatabaseURL)
          Connects to the database with URL aDatabaseURL.
 void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Connects to the database with the URL aDatabaseURL, user identification aUser, and password aPassword.
 void disconnect()
          Closes the Database connection.
static void dropProcedure(java.lang.String aProcedureName)
          Drops the stored procedure given by aProcedureName.
protected 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 if 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 if 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

protected 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.
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 URL aDatabaseURL. The database support must prompt a logon panel to enter the user identification 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 in the case of 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, user identification aUser, and password 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

protected 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

isRegistered

protected static boolean isRegistered(java.lang.String aProcedureName)
                               throws DSEInternalErrorException
Checks if a stored procedure with a specific name is already registered in the database
Parameters:
procedureName - java.lang.String
Returns:
boolean

isRegistered

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

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