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
Содержание Application Server
Страница 1: ...Red Hat Application Server JOnAS User Guide ...
Страница 8: ......
Страница 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Страница 58: ...50 Chapter 3 JOnAS Configuration ...
Страница 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Страница 78: ...70 Chapter 6 JOnAS Command Reference ...
Страница 80: ......
Страница 86: ...78 Chapter 7 Developing Session Beans ...
Страница 136: ...128 Chapter 9 Developing Message Driven Beans ...
Страница 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Страница 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Страница 158: ...150 Chapter 14 EJB Packaging ...
Страница 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Страница 164: ......
Страница 176: ...168 Chapter 18 WAR Packaging ...
Страница 178: ......
Страница 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Страница 186: ...178 Chapter 21 Client Packaging ...
Страница 188: ......
Страница 192: ...184 Chapter 23 EAR Packaging ...
Страница 194: ......
Страница 200: ...192 Chapter 24 JOnAS Services ...
Страница 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Страница 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Страница 234: ...226 Chapter 29 Web Services with JOnAS ...
Страница 236: ......
Страница 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Страница 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Страница 296: ......