org.apache.torque.adapter
Class DBFactory

java.lang.Object
  extended by org.apache.torque.adapter.DBFactory

public class DBFactory
extends java.lang.Object

This class creates different DB objects based on specified JDBC driver name.

Version:
$Id: DBFactory.java 476550 2006-11-18 16:08:37Z tfischer $
Author:
Frank Y. Kim, Jon S. Stevens, Brett McLaughlin, Ralf Stranzenbach, Daniel Rall, Henning P. Schmiedehausen

Method Summary
static DB create(java.lang.String key)
          Creates a new instance of the Torque database adapter associated with the specified JDBC driver or adapter key.
static DB create(java.lang.String key, java.lang.String className)
          Creates a new instance of the Torque database adapter associated with the specified JDBC driver or adapter key and the class defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static DB create(java.lang.String key)
                 throws java.lang.InstantiationException
Creates a new instance of the Torque database adapter associated with the specified JDBC driver or adapter key.

Parameters:
key - The fully-qualified name of the JDBC driver or a shorter form adapter key.
Returns:
An instance of a Torque database adapter, or null if no adapter exists for the given key.
Throws:
java.lang.InstantiationException - throws if the adapter could not be instantiated

create

public static DB create(java.lang.String key,
                        java.lang.String className)
                 throws java.lang.InstantiationException
Creates a new instance of the Torque database adapter associated with the specified JDBC driver or adapter key and the class defined.

Parameters:
key - The fully-qualified name of the JDBC driver or a shorter form adapter key.
className - The fully qualified name of the adapter class
Returns:
An instance of a Torque database adapter.
Throws:
java.lang.InstantiationException - throws if the adapter could not be instantiated


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.