org.outerj.daisy.datasource
Class JdbcDataSource

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.outerj.daisy.datasource.JdbcDataSource
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, javax.sql.DataSource, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, JdbcDataSourceMBean, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable

public class JdbcDataSource
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements javax.sql.DataSource, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable, JdbcDataSourceMBean

A DataSource implementation based on Jakarta Commons DBCP.

Originally based on the JdbcDataSource from the Apache James projects.


Constructor Summary
JdbcDataSource()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void dispose()
           
 java.sql.Connection getConnection()
           
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
           
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
 int getMaxActive()
           
 int getMaxIdle()
           
 int getMinIdle()
           
 int getNumActive()
           
 int getNumIdle()
           
 java.lang.String getUrl()
           
 java.lang.String getUserName()
           
 void initialize()
           
 void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(java.io.PrintWriter out)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcDataSource

public JdbcDataSource()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Specified by:
getLoginTimeout in interface javax.sql.DataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws java.sql.SQLException
Specified by:
setLoginTimeout in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Specified by:
getLogWriter in interface javax.sql.DataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws java.sql.SQLException
Specified by:
setLogWriter in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getNumActive

public int getNumActive()
Specified by:
getNumActive in interface JdbcDataSourceMBean

getNumIdle

public int getNumIdle()
Specified by:
getNumIdle in interface JdbcDataSourceMBean

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface JdbcDataSourceMBean

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface JdbcDataSourceMBean

getMinIdle

public int getMinIdle()
Specified by:
getMinIdle in interface JdbcDataSourceMBean

getMaxIdle

public int getMaxIdle()
Specified by:
getMaxIdle in interface JdbcDataSourceMBean

getMaxActive

public int getMaxActive()
Specified by:
getMaxActive in interface JdbcDataSourceMBean


Copyright © -2005 . All Rights Reserved.