...
Feature | Apache Geronimo | JBoss v4 |
---|---|---|
JDBC access | Geronimo does not have any direct integration with JDBC but supports access through the generic J2CA framework. The TranQL project has J2CA adapters for various databases. | JDBC access in JBoss is through JDBC connectors based on the JCA specification. |
JCA implementation | Geronimo supports the JCA 1.5 specification and is backward compatible to the JCA 1.0 specification. | JBoss AS 4.0 implements the JCA (Java Connector Architecture) 1.5 specification instead of the JCA 1.0 in JBoss AS 3.2. |
Data sources supported | TranQL has generic wrappers for data source, ConnectionPoolDatasource, and XADataSource. | Supports 5 types of data sources:
|
Data source failover | TranQL has specialized drivers for certain databases (including Apache Derby, Oracle and soon DB2) that provide a tighter integration with the advanced features of the driver. | JBoss has data source failover capabilities implemented through two data sources. |
XA support | Supports XA transactions, Local Transactions, and No transaction. | Supports XA transactions, Local Transactions, and No transaction. |
Connection Manager Configurability | The J2CA framework is interceptor based which allows different parts of the connection framework to be plugged in. | You can plug in your own custom connection manager if required. |
JTA implementation | Transaction support is provided through JOTM and HOWL. | Full support for JTA through JBossJTA. |
Connection pooling and management | Custom Geronimo Code and TranQL used for connection pooling and management. | JBossCX framework used for connection pooling and management. |
Legacy driver support | Geronimo also provides this through the TranQL- connector JDBC to JCA wrapper in Geronimo. Supports JDBC 3.0 and 2.1. | JBoss provides connection to RDBMS that have not yet implemented JCA- JDBC drivers through JCA wrappers for JDBC drivers. |
...
The Geronimo repository is located at <geronimo_home>/repository. Inside this directory, create a directory called mysql/jarsmysql-connector-java/3.1.14-bin and copy the mysql-connector-java-3.1.14-bin.jar file into it. Now, you need to create the data source deployment plan.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1"> <dep:moduleId> <dep:groupId>user</dep:groupId> <dep:artifactId>jdbcdatasource</dep:artifactId> <dep:version>2.0</dep:version> <dep:type>car</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency> <dep:groupId>mysql</dep:groupId> <dep:artifactId>mysql-connector-java</dep:artifactId> <dep:version>3.1.14-bin</dep:version> <dep:type>jar</dep:type> </dep:dependency> </dep:dependencies> </dep:environment> <resourceadapter> <outbound-resourceadapter> <connection-definition> <connectionfactory-interface> javax.sql.DataSource </connectionfactory-interface> <connectiondefinition-instance> <name>TradeDS</name> <config-property-setting name="UserName"> root </config-property-setting> <config-property-setting name="Password"> password </config-property-setting> <config-property-setting name="Driver"> com.mysql.jdbc.Driver </config-property-setting> <config-property-setting name="ConnectionURL"> jdbc:mysql://localhost:3306/tradedb </config-property-setting> <config-property-setting name="CommitBeforeAutocommit"> false </config-property-setting> <config-property-setting name="ExceptionSorterClass"> org.tranql.connector.NoExceptionsAreFatalSorter </config-property-setting> <connectionmanager> <local-transaction/> <single-pool> <max-size>10</max-size> <min-size>0</min-size> <blocking-timeout-milliseconds> 5000 </blocking-timeout-milliseconds> <idle-timeout-minutes> 30 </idle-timeout-minutes> <match-one/> </single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> </outbound-resourceadapter> </resourceadapter> </connector> |
The listing above shows the plan for deploying a J2EE connector which will provide JDBC access to the database. The root element is the <connector> element. This element has the following four attributes:
...