|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.sql.ConnectionUtil
public class ConnectionUtil
Encapsulate the Connection-related operations that every JDBC program seems to use.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_NAME
The default config filename, relative to ${user.home} |
Constructor Summary | |
---|---|
ConnectionUtil()
|
Method Summary | |
---|---|
static java.lang.String |
getConfigFileName()
Returns the full path of the configuration file being used. |
static Configuration |
getConfiguration(java.lang.String config)
Get a SimpleSQLConfiguration for the given config using the default or set property file name |
static java.util.Set<java.lang.String> |
getConfigurationNames()
Generate a Set |
static java.util.List<Configuration> |
getConfigurations()
Return all the configurations as SimpleSQLConfiguration objects |
static java.sql.Connection |
getConnection(Configuration c)
|
static java.sql.Connection |
getConnection(java.util.Properties p,
java.lang.String configName)
Get a Connection for the given config name from a provided Properties |
static java.sql.Connection |
getConnection(java.lang.String configName)
Get a Connection for the given config using the default or set property file name |
static java.sql.Connection |
getConnection(java.lang.String dbUrl,
java.lang.String dbDriver,
java.lang.String dbUserName,
java.lang.String dbPassword)
|
static void |
setConfigFileName(java.lang.String configFileNam)
Sets the full path of the config file to read. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_NAME
Constructor Detail |
---|
public ConnectionUtil()
Method Detail |
---|
public static void setConfigFileName(java.lang.String configFileNam)
configFileNam
- The FileName of the configuration file to use.public static java.lang.String getConfigFileName()
public static Configuration getConfiguration(java.lang.String config) throws DataBaseException
DataBaseException
public static java.sql.Connection getConnection(java.lang.String configName) throws DataBaseException
DataBaseException
public static java.sql.Connection getConnection(java.util.Properties p, java.lang.String configName) throws DataBaseException
DataBaseException
public static java.sql.Connection getConnection(java.lang.String dbUrl, java.lang.String dbDriver, java.lang.String dbUserName, java.lang.String dbPassword) throws java.lang.ClassNotFoundException, java.sql.SQLException
java.lang.ClassNotFoundException
java.sql.SQLException
public static java.sql.Connection getConnection(Configuration c) throws java.lang.ClassNotFoundException, java.sql.SQLException
java.lang.ClassNotFoundException
java.sql.SQLException
public static java.util.Set<java.lang.String> getConfigurationNames()
public static java.util.List<Configuration> getConfigurations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |