Configuring Jdbc Datasources; Configuring Datasources - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

This chapter shows the bean or application deployer how to configure the DataSources to connect the
application to databases.
4.1. Configuring DataSources
For both container-managed and bean-managed persistence, JOnAS makes use of relational
storage systems through the JDBC interface. JDBC connections are obtained from an object, the
, provided at the application server level. The DataSource interface is defined in
DataSource
the JDBC 2.0 standard extensions (see http://java.sun.com/products/jdbc/). A DataSource object
identifies a database and a means to access it via a JDBC driver. An application server may request
access to several databases and thus provide the corresponding DataSource objects. Available
DataSource objects can be added on the platform; they must be defined in the
file. This section explains how DataSource objects can be defined and configured in the JOnAS
server.
To support distributed transactions, JOnAS requires the use of a JDBC2-XA-compliant driver. Such
drivers that implement the
databases. JOnAS provides a generic driver-wrapper that emulates the XADataSource interface on a
regular JDBC driver.
Important
It is important to note that this driver-wrapper does not ensure a real two-phase commit for distributed
database transactions.
JOnAS's generic
driver-wrapper
lows DataSource objects to be defined using a JDBC1-compliant driver for some relational databases,
such as Oracle and PostgreSQL.
Neither the EJB specification nor the J2EE specification describe how to define DataSource objects so
that they are available to a J2EE platform. Therefore, this document, which describes how to define
and configure DataSource objects, is specific to JOnAS. However, the way to use these DataSource
objects in the Application Component methods is standard; that is, by using the resource manager con-
nection factory references (refer to the example in Section 8.6 Writing Database Access Operations
(Bean-Managed Persistence)).
A DataSource object should be defined in a file called
Oracle1.properties
In the
jonas.properties
name as in the properties file) to the line
jonas.service.dbm.datasources Oracle1,PostgreSQL
The property file defining a DataSource should contain the following information:
datasource.name
Configuring JDBC DataSources
XADataSource
provides an implementation of the DataSource interface that al-
for an Oracle DataSource), as delivered with the platform.
file, to define a DataSource "Oracle1", add the name
jonas.service.dbm.datasources
JNDI name of the DataSource
interface are not always available for all relational
DataSourcename.properties
Chapter 4.
jonas.properties
(for example,
(the same
Oracle1
, as follows:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the APPLICATION SERVER - JONAS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Application server

Table of Contents