org.umber.ballast.config
Class JdbcConfig
java.lang.Object
org.umber.ballast.config.JdbcConfig
- public class JdbcConfig
- extends java.lang.Object
Configuration JavaBean for JDBC properties. The primary properties can
be set explicitly; the propertiesFile is loaded as a fallback, if found, but
will not overwrite properties that are explicitly set.
- Author:
- jsheets
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JdbcConfig
public JdbcConfig()
getDatabaseUrl
public java.lang.String getDatabaseUrl()
setDatabaseUrl
public void setDatabaseUrl(java.lang.String url)
getDriverClass
public java.lang.String getDriverClass()
setDriverClass
public void setDriverClass(java.lang.String driverClass)
getUsername
public java.lang.String getUsername()
setUsername
public void setUsername(java.lang.String username)
getPassword
public java.lang.String getPassword()
setPassword
public void setPassword(java.lang.String password)
getPropertiesFile
public java.lang.String getPropertiesFile()
setPropertiesFile
public void setPropertiesFile(java.lang.String propertiesFile)
- Loads JDBC properties from the given properties file. Does not
overwrite properties that are already set. If properties file is
not found, only sets the properties file path.
- ballast.jdbc.databaseurl
- ballast.jdbc.driverclass
- ballast.jdbc.username
- ballast.jdbc.password
- Parameters:
propertiesFile
- path to properties file- See Also:
BallastConfig.loadProperties(String)
createConnection
public java.sql.Connection createConnection()
throws BallastConfigException
- Creates a JDBC connection from the current state of config properties.
- Returns:
- JDBC connection object, or null if unable to
- Throws:
BallastConfigException
- if fatal error occurs