com.ibm.db.base
Class JDBCConnectionManager

java.lang.Object
  |
  +--com.ibm.db.base.JDBCConnectionManager

public class JDBCConnectionManager
extends java.lang.Object


Field Summary
private  java.util.Hashtable connections
           
private static java.lang.String copyright
           
private  java.util.Vector drivers
           
(package private) static JDBCConnectionManager singleton
           
private  java.util.Hashtable specs
           
private static java.util.Hashtable sqlTypeTable
           
 
Constructor Summary
JDBCConnectionManager()
          Constructs a new JDBCConnectionManager, sets up the SQLType hashtable, and sets the singleton current to itself
 
Method Summary
private static java.util.Hashtable buildSQLTypeTable()
          This method builds the hashtable that maps the SQLTypes(int) to a field class
protected  DatabaseConnection connectUsingSpec(DatabaseConnectionSpec aConnSpec)
          This method attempt to create a connection using the passed connection spec
 boolean disconnectUsingSpec(DatabaseConnectionSpec aConnSpec)
          Unregisters the connection and disconnects the connection if there are no other registered users for the connection.
 DatabaseConnection getConnectionAtAlias(java.lang.String anAlias)
          This returns the active connection identified by anAlias
static JDBCConnectionManager getJDBCConnectionManager(java.lang.String driverName)
           
static java.util.Hashtable getSQLTypeTable()
          This method was created by a SmartGuide.
protected  void registerConnection(DatabaseConnection aConnection)
          This method registers the active connection aConnection with its alias
protected  void registerDriver(java.lang.String aDriverName)
          Registers the JDBC Driver Name aDriverName after a successful load of this driver.
static JDBCConnectionManager singleton()
          Returns the static singleton instance of the JDBC Connection Manager.
protected  boolean unregisterConnection(DatabaseConnection aConnection)
          This unregisters the active connection identified by its alias
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

sqlTypeTable

private static java.util.Hashtable sqlTypeTable

connections

private java.util.Hashtable connections

specs

private java.util.Hashtable specs

singleton

static JDBCConnectionManager singleton

drivers

private java.util.Vector drivers

copyright

private static final java.lang.String copyright
Constructor Detail

JDBCConnectionManager

public JDBCConnectionManager()
Constructs a new JDBCConnectionManager, sets up the SQLType hashtable, and sets the singleton current to itself
Method Detail

buildSQLTypeTable

private static java.util.Hashtable buildSQLTypeTable()
This method builds the hashtable that maps the SQLTypes(int) to a field class

connectUsingSpec

protected DatabaseConnection connectUsingSpec(DatabaseConnectionSpec aConnSpec)
                                       throws java.sql.SQLException,
                                              DataException
This method attempt to create a connection using the passed connection spec

disconnectUsingSpec

public boolean disconnectUsingSpec(DatabaseConnectionSpec aConnSpec)
                            throws java.sql.SQLException,
                                   DataException,
                                   java.lang.ClassNotFoundException
Unregisters the connection and disconnects the connection if there are no other registered users for the connection.

.Returns false if the DatabaseConnectionSpec does not represent a registered connection. A disconnect is not done for unregistered connections.


getConnectionAtAlias

public DatabaseConnection getConnectionAtAlias(java.lang.String anAlias)
This returns the active connection identified by anAlias

getJDBCConnectionManager

public static JDBCConnectionManager getJDBCConnectionManager(java.lang.String driverName)
                                                      throws java.lang.ClassNotFoundException

getSQLTypeTable

public static java.util.Hashtable getSQLTypeTable()
This method was created by a SmartGuide.
Parameters:
aDRiverName - java.lang.String

registerConnection

protected void registerConnection(DatabaseConnection aConnection)
This method registers the active connection aConnection with its alias

registerDriver

protected void registerDriver(java.lang.String aDriverName)
                       throws java.lang.ClassNotFoundException
Registers the JDBC Driver Name aDriverName after a successful load of this driver.

singleton

public static JDBCConnectionManager singleton()
Returns the static singleton instance of the JDBC Connection Manager.

unregisterConnection

protected boolean unregisterConnection(DatabaseConnection aConnection)
This unregisters the active connection identified by its alias