6.3. Configuring JDBC DataSources

6.3. Configuring JDBC DataSources

Rather than configuring the connection manager factory related MBeans discussed in the previous section via a mbean services deployment descriptor, JBoss provides a simplified datasource centric descriptor. This is transformed into the standard jboss-service.xml MBean services deployment descriptor using a XSL transform applied by the org.jboss.deployment.XSLSubDeployer included in the jboss-jca.sar deployment. The simplified configuration descriptor is deployed the same as other deployable components. The descriptor must be named using a *-ds.xml pattern in order to be recognized by the XSLSubDeployer.

The schema for the top-level datasource elements of the *-ds.xml configuration deployment file is shown in Figure 6.5, “The simplified JCA DataSource configuration descriptor top-level schema elements”.

The simplified JCA DataSource configuration descriptor top-level schema elements
Figure 6.5. The simplified JCA DataSource configuration descriptor top-level schema elements

Multiple datasource configurations may be specified in a configuration deployment file. The child elements of the datasources root are:

The non-transactional DataSource configuration schema
Figure 6.6. The non-transactional DataSource configuration schema

The non-XA DataSource configuration schema
Figure 6.7. The non-XA DataSource configuration schema

The XA DataSource configuration schema
Figure 6.8. The XA DataSource configuration schema

The schema for the experimental non-XA DataSource with failover
Figure 6.9. The schema for the experimental non-XA DataSource with failover

The schema for the experimental XA Datasource with failover
Figure 6.10. The schema for the experimental XA Datasource with failover

Elements that are common to all datasources include:

Additional common child elements for both no-tx-datasource and local-tx-datasource include:

Elements in common to the local-tx-datasource and xa-datasource are:

The unique xa-datasource child elements are:

The failover options common to ha-xa-datasource and ha-local-tx-datasource are:

Example configurations for many third-party JDBC drivers are included in the JBOSS_DIST/docs/examples/jca directory. Current example configurations include: