Constructor and Description |
---|
DbConfiguration() |
Modifier and Type | Method and Description |
---|---|
static void |
addConnectionWrapper(ConnectionSpecWrapper connectionWrapper,
boolean override) |
static void |
clearConnectionWrappers() |
protected static void |
clearConnectionWrappers(String env) |
static List<ConnectionSpecWrapper> |
getConnectionSpecWrappers()
Provides a list of all connection wrappers corresponding to a current environment.
|
static List<ConnectionSpecWrapper> |
getConnectionSpecWrappers(String env)
Provides a list of all connection wrappers corresponding to a given environment.
|
List<ConnectionSpecWrapper> |
getTestConnectionWrappers() |
static void |
loadConfiguration(String file)
Configures multiple database connections from a single property file.
|
static void |
resetConnectionWrappers() |
public static void addConnectionWrapper(ConnectionSpecWrapper connectionWrapper, boolean override)
public static List<ConnectionSpecWrapper> getConnectionSpecWrappers()
public static List<ConnectionSpecWrapper> getConnectionSpecWrappers(String env)
env
- name of environment, such as "development", "production", etc.public static void clearConnectionWrappers()
public static void resetConnectionWrappers()
protected static void clearConnectionWrappers(String env)
public static void loadConfiguration(String file)
development.driver=com.mysql.jdbc.Driver development.username=john development.password=pwd development.url=jdbc:mysql://localhost/proj_dev test.driver=com.mysql.jdbc.Driver test.username=mary test.password=pwd1 test.url=jdbc:mysql://localhost/test production.jndi=java:comp/env/jdbc/prodRules and limitations of using a file-based configuration:
file
- path to a file. Can be located on classpath, or on a file system. First searched on classpath,
then on file system.public List<ConnectionSpecWrapper> getTestConnectionWrappers()
Copyright © 2016 JavaLite. All rights reserved.