org.apache.log.output.db
Class DefaultDataSource
java.lang.Objectorg.apache.log.output.db.DefaultDataSource
- DataSource
public class DefaultDataSource
extends java.lang.Object
implements DataSource
A basic datasource that doesn't do any pooling but just wraps
around default mechanisms.
Connection | getConnection()- Attempt to establish a database connection.
|
Connection | getConnection(String username, String password)- Attempt to establish a database connection.
|
PrintWriter | getLogWriter()- Get the log writer for this data source.
|
int | getLoginTimeout()- Gets the maximum time in seconds that this data source can wait while
attempting to connect to a database.
|
void | setLogWriter(PrintWriter logWriter)
|
void | setLoginTimeout(int loginTimeout)- Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database.
|
DefaultDataSource
public DefaultDataSource(String url,
String username,
String password)
getConnection
public Connection getConnection()
throws SQLException Attempt to establish a database connection.
getConnection
public Connection getConnection(String username,
String password)
throws SQLException Attempt to establish a database connection.
getLogWriter
public PrintWriter getLogWriter()
throws SQLException Get the log writer for this data source.
getLoginTimeout
public int getLoginTimeout()
throws SQLException Gets the maximum time in seconds that this data source can wait while
attempting to connect to a database.
setLogWriter
public void setLogWriter(PrintWriter logWriter)
throws SQLException
setLoginTimeout
public void setLoginTimeout(int loginTimeout)
throws SQLException Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database.
loginTimeout - the loging timeout in seconds