|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.output.db.DefaultDataSource
public class DefaultDataSource
A basic datasource that doesn't do any pooling but just wraps around default mechanisms.
Field Summary | |
---|---|
private int |
m_loginTimeout
|
private PrintWriter |
m_logWriter
|
private String |
m_password
|
private String |
m_url
|
private String |
m_username
|
Constructor Summary | |
---|---|
DefaultDataSource(String url,
String username,
String password)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final String m_username
private final String m_password
private final String m_url
private PrintWriter m_logWriter
private int m_loginTimeout
Constructor Detail |
---|
public DefaultDataSource(String url, String username, String password)
Method Detail |
---|
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int loginTimeout) throws SQLException
setLoginTimeout
in interface CommonDataSource
loginTimeout
- the loging timeout in seconds
SQLException
public void setLogWriter(PrintWriter logWriter) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public Object unwrap(Class iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public boolean isWrapperFor(Class iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |