Log4j 1.3alpha-1

org.apache.log4j.db
Class DataSourceConnectionSource

java.lang.Object
  |
  +--org.apache.log4j.db.ConnectionSourceSkeleton
        |
        +--org.apache.log4j.db.DataSourceConnectionSource
All Implemented Interfaces:
ConnectionSource, OptionHandler

public class DataSourceConnectionSource
extends ConnectionSourceSkeleton

The DataSourceConnectionSource is an implementation of ConnectionSource that obtains the Connection in the recommended JDBC manner based on a DataSource.

Author:
Ray DeCampo, Ceki Gülcü

Field Summary
 
Fields inherited from class org.apache.log4j.db.ConnectionSourceSkeleton
dialectCode, errorHandler, password, supportsBatchUpdates, supportsGetGeneratedKeys, user
 
Fields inherited from interface org.apache.log4j.db.ConnectionSource
HSQL_DIALECT, MSSQL_DIALECT, MYSQL_DIALECT, ORACLE_DIALECT, POSTGRES_DIALECT, UNKNOWN_DIALECT
 
Constructor Summary
DataSourceConnectionSource()
           
 
Method Summary
 void activateOptions()
          Activate the options that were previously set with calls to option setters.
 java.sql.Connection getConnection()
          Obtain a Connection for use.
 DataSource getDataSource()
           
 void setDataSource(DataSource dataSource)
           
 
Methods inherited from class org.apache.log4j.db.ConnectionSourceSkeleton
discoverConnnectionProperties, getErrorHandler, getLogger, getPassword, getSQLDialectCode, getUser, setErrorHandler, setPassword, setUser, supportsBatchUpdates, supportsGetGeneratedKeys
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceConnectionSource

public DataSourceConnectionSource()
Method Detail

activateOptions

public void activateOptions()
Description copied from interface: OptionHandler
Activate the options that were previously set with calls to option setters.

This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.


getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from interface: ConnectionSource
Obtain a Connection for use. The client is responsible for closing the Connection when it is no longer required.

Throws:
java.sql.SQLException - if a Connection could not be obtained
See Also:
ConnectionSource.getConnection()

getDataSource

public DataSource getDataSource()

setDataSource

public void setDataSource(DataSource dataSource)

Log4j 1.3alpha-1

Copyright 2000-2003 Apache Software Foundation.