public class DefaultDataSource extends Object implements DataSource
| Modifier and Type | Field and Description |
|---|---|
private int |
m_loginTimeout |
private PrintWriter |
m_logWriter |
private String |
m_password |
private String |
m_url |
private String |
m_username |
| Constructor and Description |
|---|
DefaultDataSource(String url,
String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection()
Attempt to establish a database connection.
|
Connection |
getConnection(String username,
String password)
Attempt to establish a database connection.
|
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while
attempting to connect to a database.
|
PrintWriter |
getLogWriter()
Get the log writer for this data source.
|
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class iface) |
void |
setLoginTimeout(int loginTimeout)
Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database.
|
void |
setLogWriter(PrintWriter logWriter) |
Object |
unwrap(Class iface) |
private final String m_username
private final String m_password
private final String m_url
private PrintWriter m_logWriter
private int m_loginTimeout
public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int loginTimeout)
throws SQLException
setLoginTimeout in interface CommonDataSourceloginTimeout - the loging timeout in secondsSQLExceptionpublic void setLogWriter(PrintWriter logWriter) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic Object unwrap(Class iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.