![Red Hat Application Server Скачать руководство пользователя страница 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
:
Содержание 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: ......