|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.jdbc.ConnectionSource
A static class that hands out database connections.
Field Summary | |
private static java.lang.String |
DEFAULT
|
private static java.lang.Object |
guard
guard for protecting theSource and namesToURLs. |
private MutableMap |
namesToDataSources
|
private static ConnectionSource |
theSource
Singleton. |
Constructor Summary | |
private |
ConnectionSource(java.lang.String driverName,
javax.sql.DataSource dataSource)
|
Method Summary | |
private void |
addDataSource(java.lang.String name,
javax.sql.DataSource dataSource)
|
static void |
addDB(java.lang.String name,
javax.sql.DataSource dataSource)
|
static void |
addDB(java.lang.String name,
java.lang.String driverName,
java.lang.String dbURL,
java.lang.String userName,
java.lang.String passWord)
|
private boolean |
containsDataSource(java.lang.String name)
|
static boolean |
containsDB(java.lang.String name)
|
static java.sql.Connection |
getConnection()
Get a connection to a database. |
static java.sql.Connection |
getConnection(java.lang.String connectionName)
Get a connection to a database. |
private javax.sql.DataSource |
getDataSourceForName(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static ConnectionSource theSource
private static java.lang.Object guard
private static final java.lang.String DEFAULT
private MutableMap namesToDataSources
Constructor Detail |
private ConnectionSource(java.lang.String driverName, javax.sql.DataSource dataSource) throws java.sql.SQLException
defaultDBURL
- the url to use to grab connections in the (no parameter) getConnection() methodMethod Detail |
private void addDataSource(java.lang.String name, javax.sql.DataSource dataSource) throws java.sql.SQLException
public static void addDB(java.lang.String name, java.lang.String driverName, java.lang.String dbURL, java.lang.String userName, java.lang.String passWord) throws java.sql.SQLException
public static void addDB(java.lang.String name, javax.sql.DataSource dataSource) throws java.sql.SQLException
public static boolean containsDB(java.lang.String name)
private boolean containsDataSource(java.lang.String name)
private javax.sql.DataSource getDataSourceForName(java.lang.String name) throws java.sql.SQLException
public static java.sql.Connection getConnection() throws java.sql.SQLException
public static java.sql.Connection getConnection(java.lang.String connectionName) throws java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |