![Red Hat Application Server Manual Download Page 39](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406039.webp)
Chapter 3. JOnAS Configuration
31
3.5.7. Configuring the Database Service
Note
The description of the new JDBC Resource Adapters as a replacement for the database service is
located in Chapter 40
Configuring JDBC Resource Adapters
.
To allow access to one or more relational databases (for example, Oracle, PostgreSQL, and so on),
JOnAS will create and use DataSource objects. Such a DataSource object must be configured accord-
ing to the database that will be used for the persistence of a bean. More details about DataSource
objects and their configuration are provided in Chapter 4
Configuring JDBC DataSources
.
The following subsections briefly explain how to configure a DataSource object for your database in
order to be able to run the Entity Bean example.
Note that the SQL requests sent to the database can be easily traced using the JOnAS Logging system
and the integrated P6Spy tool. The configuration steps are described in Section 4.4
Tracing SQL
Requests Through P6Spy
.
3.5.7.1. Configuring Oracle for the Supplied Example
You can find a template
Oracle1.properties
file in the installation directory (refer to
$JONAS_BASE/conf/Oracle1.properties
). This file is used to define a
DataSource
object
that is named
Oracle1
. This template must be updated with values appropriate to your installation.
The fields are the following:
datasource.name
JNDI name of the DataSource: The name used in the example is
jdbc_1
.
datasource.url
The JDBC database URL: for the Oracle JDBC "Thin" driver it is
jdbc:oracle:thin:@
hostname
:
sql*net_port_number
:ORACLE_SID If using
an Oracle OCI JDBC driver, the URL is
jdbc:oracle:oci7:
or
jdbc:oracle:oci8:
datasource.classname Name of the class implementing the Oracle JDBC driver:
oracle.jdbc.driver.OracleDriver
datasource.mapper
Adapter (JORM), mandatory for CMP2.0 only (more details in Section 4.2
CMP2.0/JORM
):
rdb.oracle8
for Oracle 8 and prior versions
datasource.username Database user name
datasource.password
Database user password
For the EJB platform to create the corresponding DataSource object, the
Oracle1
name must be in
the
jonas.properties
file on the
jonas.service.dbm.datasources
line:
jonas.service.dbm.datasources
Oracle1
There may be several DataSource objects defined for an EJB server, in which case there will
be several
dataSourceName.properties
files and a list of the DataSource names on the
jonas.service.dbm.datasources
line of the
jonas.properties
file:
jonas.service.dbm.datasources
Oracle1, Oracle2
To create the table used in the example with the SQL script that is provided in the
examples/src/eb/Account.sql
file, the Oracle server must be running with a JDBC
Summary of Contents for Application Server
Page 1: ...Red Hat Application Server JOnAS User Guide ...
Page 8: ......
Page 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Page 58: ...50 Chapter 3 JOnAS Configuration ...
Page 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Page 78: ...70 Chapter 6 JOnAS Command Reference ...
Page 80: ......
Page 86: ...78 Chapter 7 Developing Session Beans ...
Page 136: ...128 Chapter 9 Developing Message Driven Beans ...
Page 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Page 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Page 158: ...150 Chapter 14 EJB Packaging ...
Page 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Page 164: ......
Page 176: ...168 Chapter 18 WAR Packaging ...
Page 178: ......
Page 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Page 186: ...178 Chapter 21 Client Packaging ...
Page 188: ......
Page 192: ...184 Chapter 23 EAR Packaging ...
Page 194: ......
Page 200: ...192 Chapter 24 JOnAS Services ...
Page 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Page 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Page 234: ...226 Chapter 29 Web Services with JOnAS ...
Page 236: ......
Page 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Page 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Page 296: ......