org.apache.avalon.excalibur.datasource
Class InformixDataSource
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLogEnabled
|
+--org.apache.avalon.excalibur.datasource.InformixDataSource
- All Implemented Interfaces:
- org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, DataSourceComponent, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.framework.thread.ThreadSafe
- public class InformixDataSource
- extends org.apache.avalon.framework.logger.AbstractLogEnabled
- implements DataSourceComponent, org.apache.avalon.framework.logger.Loggable
The Informix implementation for DataSources in Excalibur. This uses the
com.informix.jdbcx.IfxConnectionPoolDataSource
object. It uses
the following format for configuration (italics mark information you change):
<informix>
<pool-controller init="5" min="5" max="10"/>
<dbname>dbname</dbname>
<servername>servername</servername>
<host port="2000">host</host>
<user>user</user>
<password>user</password>
<informix>
Informix doesn't like the JdbcDataSource Component, so we gave it it's own.
Do not use this datasource if you are planning on using your J2EE server's
connection pooling.
You must have Informix's JDBC 2.2 or higher jar file, as well as the extensions
jar file (ifxjdbc.jar
and ifxjdbcx.jar
). Also, this
DataSource requires the Avalon Cadastre package because it uses the MemoryContext.
- Since:
- 4.0
- Version:
- CVS $Revision: 1.6 $ $Date: 2001/12/11 09:53:28 $
- Author:
- Berin Loritsch
Constructor Summary |
InformixDataSource()
Set up the system property for the context factory if it hasn't been
done already. |
Method Summary |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
Set up the Informix driver for direct use. |
java.sql.Connection |
getConnection()
Return an Informix Connection object |
void |
setLogger(org.apache.log.Logger logger)
|
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 |
InformixDataSource
public InformixDataSource()
- Set up the system property for the context factory if it hasn't been
done already. This is not done in a static initializer due to the
existence of the J2eeDataSource.
setLogger
public void setLogger(org.apache.log.Logger logger)
- Specified by:
setLogger
in interface org.apache.avalon.framework.logger.Loggable
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Return an Informix Connection object
- Specified by:
getConnection
in interface DataSourceComponent
- Following copied from interface:
org.apache.avalon.excalibur.datasource.DataSourceComponent
- Throws:
NoValidConnectionException
- when there is no valid Connection wrapper
available in the classloader.NoAvailableConnectionException
- when there are no more available
Connections in the pool.
configure
public void configure(org.apache.avalon.framework.configuration.Configuration conf)
throws org.apache.avalon.framework.configuration.ConfigurationException
- Set up the Informix driver for direct use.
- Specified by:
configure
in interface org.apache.avalon.framework.configuration.Configurable
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.