org.apache.turbine.util.db.adapter
Class DBFactory

java.lang.Object
  |
  +--org.apache.turbine.util.db.adapter.DBFactory

public class DBFactory
extends java.lang.Object

This class creates different DB objects based on the database driver that is provided.

Version:
$Id$
Author:
Frank Y. Kim, Jon S. Stevens, Brett McLaughlin, Ralf Stranzenbach

Field Summary
private static java.util.Hashtable drivers
           
 
Constructor Summary
DBFactory()
           
 
Method Summary
(package private) static void ()
           
static DB create(java.lang.String driver)
          Creates an instance of the Turbine database adapter associated with the specified JDBC driver.
private static void registerDriver(java.lang.String driver, java.lang.Class dc)
          Try to register the class of a database driver at the factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

drivers

private static java.util.Hashtable drivers
Constructor Detail

DBFactory

public DBFactory()
Method Detail

static void ()

registerDriver

private static void registerDriver(java.lang.String driver,
                                   java.lang.Class dc)
Try to register the class of a database driver at the factory. This concept allows for dynamically adding new database drivers using the configuration files instead of changing the codebase.
Parameters:
driver - The fully-qualified name of the JDBC driver to create.
dc - The named JDBC driver.

create

public static DB create(java.lang.String driver)
                 throws java.lang.InstantiationException
Creates an instance of the Turbine database adapter associated with the specified JDBC driver. NOTE: This method used to be protected. I'd like to try to get it back that way ASAP. I had to change its access level since it is called by ConnectionPool, and these two classes are no longer in the same package. -Daniel
Parameters:
driver - The fully-qualified name of the JDBC driver to create.
Returns:
An instance of a Turbine database adapter.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.