org.dbmaintain.database.impl
Class DefaultDatabaseConnectionManager
java.lang.Object
org.dbmaintain.database.impl.DefaultDatabaseConnectionManager
- All Implemented Interfaces:
- DatabaseConnectionManager
public class DefaultDatabaseConnectionManager
- extends Object
- implements DatabaseConnectionManager
- Author:
- Tim Ducheyne, Filip Neven
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
databaseInfos
protected List<DatabaseInfo> databaseInfos
sqlHandler
protected SQLHandler sqlHandler
databaseInfoFactory
protected DatabaseInfoFactory databaseInfoFactory
dataSourceFactory
protected DataSourceFactory dataSourceFactory
dataSourcesPerDatabaseName
protected Map<String,DataSource> dataSourcesPerDatabaseName
databaseConnectionsPerDatabaseName
protected Map<String,DatabaseConnection> databaseConnectionsPerDatabaseName
DefaultDatabaseConnectionManager
public DefaultDatabaseConnectionManager(Properties configuration,
SQLHandler sqlHandler,
DataSourceFactory dataSourceFactory)
DefaultDatabaseConnectionManager
public DefaultDatabaseConnectionManager(Properties configuration,
SQLHandler sqlHandler,
DataSourceFactory dataSourceFactory,
Map<String,DataSource> dataSourcesPerDatabaseName)
getSqlHandler
public SQLHandler getSqlHandler()
- Specified by:
getSqlHandler
in interface DatabaseConnectionManager
getDatabaseConnection
public DatabaseConnection getDatabaseConnection(String databaseName)
- Gets the connection for the database with the given name.
The data source will be null if the database is disabled
The default database always has a data source even if disabled
- Specified by:
getDatabaseConnection
in interface DatabaseConnectionManager
- Parameters:
databaseName
- The name
- Returns:
- The connection, not null
getDatabaseConnections
public List<DatabaseConnection> getDatabaseConnections()
- Specified by:
getDatabaseConnections
in interface DatabaseConnectionManager
createDatabaseConnection
protected DatabaseConnection createDatabaseConnection(String databaseName)
getDatabaseInfo
protected DatabaseInfo getDatabaseInfo(String databaseName)
getDatabaseInfos
protected List<DatabaseInfo> getDatabaseInfos()
createDatabaseInfoFactory
protected DatabaseInfoFactory createDatabaseInfoFactory(Properties configuration)
Copyright © 2011. All Rights Reserved.