org.umber.ballast.config
Class JdbcConfig

java.lang.Object
  extended byorg.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

Constructor Summary
JdbcConfig()
           
 
Method Summary
 java.sql.Connection createConnection()
          Creates a JDBC connection from the current state of config properties.
 java.lang.String getDatabaseUrl()
           
 java.lang.String getDriverClass()
           
 java.lang.String getPassword()
           
 java.lang.String getPropertiesFile()
           
 java.lang.String getUsername()
           
 void setDatabaseUrl(java.lang.String url)
           
 void setDriverClass(java.lang.String driverClass)
           
 void setPassword(java.lang.String password)
           
 void setPropertiesFile(java.lang.String propertiesFile)
          Loads JDBC properties from the given properties file.
 void setUsername(java.lang.String username)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcConfig

public JdbcConfig()
Method Detail

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.

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