org.apache.log.output.db
Class DefaultDataSource

java.lang.Object
  |
  +--org.apache.log.output.db.DefaultDataSource
All Implemented Interfaces:
DataSource

public class DefaultDataSource
extends Object
implements DataSource

A basic datasource that doesn't do any pooling but just wraps around default mechanisms.

Author:
Peter Donald

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.
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataSource

public DefaultDataSource(String url,
                         String username,
                         String password)
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Attempt to establish a database connection.

Specified by:
getConnection in interface DataSource
Returns:
the Connection
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Attempt to establish a database connection.

Specified by:
getConnection in interface DataSource
Returns:
the Connection
SQLException

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.

Specified by:
getLoginTimeout in interface DataSource
Returns:
the login time
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Get the log writer for this data source.

Specified by:
getLogWriter in interface DataSource
Returns:
the LogWriter
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.

Specified by:
setLoginTimeout in interface DataSource
Parameters:
loginTimeout - the loging timeout in seconds
SQLException

setLogWriter

public void setLogWriter(PrintWriter logWriter)
                  throws SQLException
Specified by:
setLogWriter in interface DataSource
SQLException


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.