|
Predictions 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object ConnectionSrc
public class ConnectionSrc
Implementation of ConnectionSource
, required by WEB4J.
This application talks only to a single database.
This implementation uses a Connection pool managed by the container.
Only one method can be overridden - getConnectionByName(String)
.
Field Summary | |
---|---|
static String |
DEFAULT
Value - "DEFAULT". |
static String |
DEFAULT_CONN_STRING
Value "DefaultDbConnectionString". |
Constructor Summary | |
---|---|
ConnectionSrc()
|
Method Summary | |
---|---|
Connection |
getConnection()
Return a Connection for the default database. |
Connection |
getConnection(String aDatabaseName)
Return a Connection for the identified database. |
protected Connection |
getConnectionByName(String aDbName)
Return a connection the named database. |
protected String |
getConnectionString(String aDbName)
This item is protected, in order to make it visible to any subclasses created for testing outside of the normal runtime environment. |
Set<String> |
getDatabaseNames()
Return value contains only DEFAULT . |
void |
init(Map<String,String> aConfig)
Read in connection strings from web.xml. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CONN_STRING
public static final String DEFAULT
Constructor Detail |
---|
public ConnectionSrc()
Method Detail |
---|
public final void init(Map<String,String> aConfig)
init
in interface ConnectionSource
public final Set<String> getDatabaseNames()
DEFAULT
.
getDatabaseNames
in interface ConnectionSource
public final Connection getConnection() throws DAOException
Connection
for the default database.
getConnection
in interface ConnectionSource
DAOException
public final Connection getConnection(String aDatabaseName) throws DAOException
Connection
for the identified database.
getConnection
in interface ConnectionSource
aDatabaseName
- single value DEFAULT
DAOException
protected Connection getConnectionByName(String aDbName) throws DAOException
This method can be overridden by a subclass. Such overrides are intended for testing.
DAOException
protected String getConnectionString(String aDbName)
|
Predictions 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |