![Red Hat Application Server Manual Download Page 104](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406104.webp)
96
Chapter 8. Developing Entity Beans
Thus, for each type of database (and more precisely for each JDBC driver), the corresponding map-
per must be specified in the DataSource. This is the purpose of the
datasource.mapper
prop-
erty of the DataSource properties file. Note that all JOnAS-provided DataSource properties files (in
$JONAS_ROOT/conf
) already contain this property with the correct mapper.
For the JORM database mapper
datasource.mapper
, the possible values are:
•
rdb
: generic mapper (JDBC standard driver ...)
•
rdb.firebird
: Firebird
•
rdb.mckoi
: McKoi DB
•
rdb.mysql
: MySQL
•
rdb.oracle8
: Oracle 8 and lesser versions
•
rdb.oracle
: Oracle 9
•
rdb.postgres
: PostgreSQL (version 7.2 or greater)
•
rdb.sapdb
: SAP DB
•
rdb.sqlserver
: MS SQL Server
•
rdb.sybase
: Sybase
Contact the JOnAS team ([email protected]) to obtain a mapper for other databases.
The container code generated at deployment (GenIC or EJB-JAR Ant task) is dependent on this map-
per. It is possible to deploy (generate container code) a bean for several mappers in order to change
the database (that is, the DataSource file) without redeploying the bean. These mappers should be
specified as the
mappernames
argument of the GenIC command or as the
mappernames
attribute of
the JOnAS ANT EJB-JAR task. The value is a comma-separated list of mapper names for which the
container classes will be generated. This list of mapper names corresponds to the list of potential
databases upon which you can deploy your Entity Beans. For example, to deploy Entity Beans so that
they can be used on either Oracle or PostgreSQL, run GenIC as:
GenIC -mappernames rdb.oracle,rdb.postgres eb.jar
The following is the same example in an Ant
build.xml
file:
D
target name="deploy"
description="Build and deploy the ejb-jars"
depends="compile
E
D
ejbjar naming="directory"
....
....
D
jonas destdir="${ejbjars.dir}"
jonasroot="${jonas.root}"
orb="${orb}"
jarsuffix=".jar"
secpropag="yes"
keepgenerated="true"
mappernames="${mapper.names}"
additionalargs="${genicargs}"
E
D
/jonas
E
...
...
D
/ejbjar
E
D
/target
E
that have the following in
build.properties
:
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: ......