|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.server.JDBCDatabase
public class JDBCDatabase
A javax.sql.DataSource that uses a JDBC Driver to establish connections. This class should be used for testing only. Production configurations should use the JNDIDataSource class.
| Constructor Summary | |
|---|---|
JDBCDatabase()
|
|
| Method Summary | |
|---|---|
Parameter |
createParam()
Create a parameter that will be passed to the Driver when establishing a connection. |
Connection |
getConnection()
|
Connection |
getConnection(String username,
String password)
|
int |
getLoginTimeout()
|
PrintWriter |
getLogWriter()
|
boolean |
isWrapperFor(Class c)
|
void |
setDriver(String driver)
Set the JDBC driver class to be used for this DataSource |
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(PrintWriter out)
|
void |
setPassword(String password)
Set the password to be used for connecting to the database. |
void |
setURL(String s)
Set the JDBC URL to be used for this DataSource |
void |
setUser(String user)
Set the user to be used for connecting to the database. |
Object |
unwrap(Class c)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCDatabase()
| Method Detail |
|---|
public void setURL(String s)
s - The URLpublic void setDriver(String driver)
s - the JDBC driver class to be used for this DataSourcepublic void setUser(String user)
user - the user to be used for connecting to the database.public void setPassword(String password)
password - the password to be used for connecting to the database.public Parameter createParam()
public Connection getConnection()
throws SQLException
getConnection in interface DataSourceSQLException
public Connection getConnection(String username,
String password)
throws SQLException
getConnection in interface DataSourceSQLException
public PrintWriter getLogWriter()
throws SQLException
getLogWriter in interface CommonDataSourceSQLException
public void setLogWriter(PrintWriter out)
throws SQLException
setLogWriter in interface CommonDataSourceSQLException
public void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLException
public int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLException
public boolean isWrapperFor(Class c)
throws SQLException
isWrapperFor in interface WrapperSQLException
public Object unwrap(Class c)
throws SQLException
unwrap in interface WrapperSQLException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||