liquibase.database
Class DatabaseFactory

java.lang.Object
  extended by liquibase.database.DatabaseFactory

public class DatabaseFactory
extends Object


Method Summary
 void clearRegistry()
          Removes all registered databases, even built in ones.
 Database findCorrectDatabaseImplementation(DatabaseConnection connection)
           
 String findDefaultDriver(String url)
           
 Database getDatabase(String shortName)
           
 List<Database> getImplementedDatabases()
          Returns instances of all implemented database types.
static DatabaseFactory getInstance()
           
 List<Database> getInternalDatabases()
          Returns instances of all "internal" database types.
 DatabaseConnection openConnection(String url, String username, String password, String propertyProvider, ResourceAccessor resourceAccessor)
           
 DatabaseConnection openConnection(String url, String username, String password, String driver, String databaseClass, String driverPropertiesFile, String propertyProviderClass, ResourceAccessor resourceAccessor)
           
 Database openDatabase(String url, String username, String password, String propertyProviderClass, ResourceAccessor resourceAccessor)
           
 Database openDatabase(String url, String username, String password, String driver, String databaseClass, String driverPropertiesFile, String propertyProviderClass, ResourceAccessor resourceAccessor)
           
 void register(Database database)
           
static void reset()
           
static void setInstance(DatabaseFactory databaseFactory)
          Set singleton instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DatabaseFactory getInstance()

reset

public static void reset()

setInstance

public static void setInstance(DatabaseFactory databaseFactory)
Set singleton instance. Primarily used in testing


getImplementedDatabases

public List<Database> getImplementedDatabases()
Returns instances of all implemented database types.


getInternalDatabases

public List<Database> getInternalDatabases()
Returns instances of all "internal" database types.


register

public void register(Database database)

findCorrectDatabaseImplementation

public Database findCorrectDatabaseImplementation(DatabaseConnection connection)
                                           throws DatabaseException
Throws:
DatabaseException

openDatabase

public Database openDatabase(String url,
                             String username,
                             String password,
                             String propertyProviderClass,
                             ResourceAccessor resourceAccessor)
                      throws DatabaseException
Throws:
DatabaseException

openDatabase

public Database openDatabase(String url,
                             String username,
                             String password,
                             String driver,
                             String databaseClass,
                             String driverPropertiesFile,
                             String propertyProviderClass,
                             ResourceAccessor resourceAccessor)
                      throws DatabaseException
Throws:
DatabaseException

openConnection

public DatabaseConnection openConnection(String url,
                                         String username,
                                         String password,
                                         String propertyProvider,
                                         ResourceAccessor resourceAccessor)
                                  throws DatabaseException
Throws:
DatabaseException

openConnection

public DatabaseConnection openConnection(String url,
                                         String username,
                                         String password,
                                         String driver,
                                         String databaseClass,
                                         String driverPropertiesFile,
                                         String propertyProviderClass,
                                         ResourceAccessor resourceAccessor)
                                  throws DatabaseException
Throws:
DatabaseException

findDefaultDriver

public String findDefaultDriver(String url)

clearRegistry

public void clearRegistry()
Removes all registered databases, even built in ones. Useful for forcing a particular database implementation


getDatabase

public Database getDatabase(String shortName)


Copyright © 2015 Liquibase.org. All rights reserved.