|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectParkNPark.middletier.DatabaseManager
public class DatabaseManager
Manages the server's database parameters
Field Summary | |
---|---|
protected WeakHashMap<Connection,Object> |
connections
Weak set of references to our created connections so that we can hose them upon request |
private String |
jdbcDriver
The JDBC driver class |
private String |
jdbcPassword
The password |
private String |
jdbcURL
The JDBC URL |
private String |
jdbcUsername
The user name |
Constructor Summary | |
---|---|
DatabaseManager(String jdbcURL,
String jdbcUsername,
String jdbcPassword)
Create the database manager and initialize the JDBC driver |
Method Summary | |
---|---|
Connection |
getConnection()
Returns a new database connection using the database manager's current configuration |
void |
hoseConnection()
Hose all current and future connections |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String jdbcDriver
private String jdbcURL
private String jdbcUsername
private String jdbcPassword
protected WeakHashMap<Connection,Object> connections
Constructor Detail |
---|
public DatabaseManager(String jdbcURL, String jdbcUsername, String jdbcPassword)
jdbcURL
- The JDBC URL to use in the database connectionjdbcUsername
- The username to use in the database connectionjdbcPassword
- The password to use in the database connectionMethod Detail |
---|
public Connection getConnection() throws SQLException
SQLException
- Thrown when a problem arises while creating
a new connection to the databasepublic void hoseConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |