Oracle® Adaptive Access Manager Installation and Configuration Guide Release 10g (10.1.4.5) Part Number E12050-03 |
|
|
View PDF |
TopLink is an object-relational mapping (ORM) package for Java developers. Oracle Adaptive Access Manager uses TopLink for database connectivity. You must configure sessions.xml
to use TopLink in order to connect to your Adaptive Risk Manager Online or Offline database.
For information on configuring your database connectivity for JDBC, refer to the "Configuring sessions.xml for JDBC" section; for information on configuring your database connectivity for JNDI, refer to the "Configuring sessions.xml for JNDI" section.
If you are using the Tomcat Web server, follow the procedure documented in the "Configuring sessions.xml for JDBC" section.
To configure sessions.xml for JDBC
Copy your sample.sessions.xml reference file into a sessions.xml file. The sample.sessions.xml is located under the /WEB-INF/classes directory.
Modify the following tags with the appropriate values. Refer to "sessions.xml Tags for JDBC" for more information.
How to modify the tags is explained below.
<platform-class>
Refer to "TopLink platform-class" for the platform specific property that you will modify the TopLink <platform-class> tag with.
<driver-class>
If you are using an Oracle 10g driver, specify the JDBC driver class. An example in bold type is provided in the "sessions.xml File Sample for JDBC" section.
<connection-url>
The connection URL is given as "jdbc:oracle:thin:@%hostname%:%port%:%database sid%." An example in bold type is shown in the "sessions.xml File Sample for JDBC" section below.
<user-name>
Specify the username for the database account.
<password>
Specify the password for the database account.
Note:
The password can be a TopLink encrypted password.To encrypt the password, using the following command:
For Windows:
java -classpath "vcrypt.jar;toplink.jar" com.bharosa.vcrypt.utility.cmdline.BharosaCmdLine -toplink-password-encrypt mydbpassword
For UNIX:
echo "mydbpassword" | $JAVA_HOME/bin/java -classpath ./vcrypt.jar:./toplink.jar:./log4j-1.2.9.jar com.bharosa.vcrypt.utility.cmdline.BharosaCmdLine -toplink-password-encrypt
<connection-pools>
For performance reasons, make sure that the max-connections
and the min-connections
are set to the same value for the <read-connection-pool> and the <write-connection-pool>.
For your reference, a sessions.xml
file is provided below.
<?xml version="1.0" encoding="UTF-8" ?> - <toplink-sessions version="10g Release 3 (10.1.3.1.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <session xsi:type="server-session"> <name>default</name> <event-listener-classes /> <primary-project xsi:type="xml">BharosaTLMappings.xml</primary-project> - <login xsi:type="database-login"> <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class> <user-name>%username%</user-name> <password>%password%</password> - <sequencing> - <default-sequence xsi:type="native-sequence"> <name>Native</name> <preallocation-size>1</preallocation-size> </default-sequence> </sequencing> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> <connection-url>jdbc:oracle:thin:@%hostname%:%port%:%database sid%</connection-url> </login> - <connection-pools> - <read-connection-pool> <name>ReadConnectionPool</name> <max-connections>5</max-connections> <min-connections>5</min-connections> </read-connection-pool> - <write-connection-pool> <name>default</name> <max-connections>25</max-connections> <min-connections>25</min-connections> </write-connection-pool> </connection-pools> <connection-policy /> </session> </toplink-sessions>
JDBC String for RAC Database
The correct connection URL for RAC databases is shown below.
<connection-url>jdbc:oracle:thin:@(description = (address = (protocol = tcp)(host = XXhost1XX)(port = 1521))(address = (protocol = tcp)(host =XXhost2XX)(port = 1521))(load_balance = yes)(connect_data =(server = dedicated)(service_name = XXservice_nameXX)(failover_mode =(type = select)(method = basic)(retries = 100)(delay = 5)))) </connection-url>
Globalization Support for Microsoft SQL Server
To support Globalization with Microsoft SQL Server, please remove the "sendStringasUnicode= false" string from the JDBC URL.
To configure sessions.xml for JNDI
Copy your sample_jndi.sessions.xml
reference file into a sessions.xml file. The sample_jndi.sessions.xml
file is located under the /WEB-INF/classes directory.
Modify or add the following tags with the appropriate values. Refer to "sessions.xml Tags for JNDI" for more information.
The tags to modify or add are explained below.
<platform-class>
Modify the <platform-class> tag. Refer to "TopLink platform-class" for the platform specific property that you will modify the TopLink <platform-class> tag with.
<external-connection-pooling>
Modify the <external-connection-pooling> tag. An example in bold type is provided in the "sessions.xml File Sample for JNDI" section.
<datasource>
Modify the <datasource> tag. For example,
<datasource>%datasource name%</datasource>
Note:
For a RAC database, use the RAC JDBC string for the datasource.For another example, refer to the "sessions.xml File Sample for JNDI" section.
For your reference, a sessions.xml file is provided below.
<?xml version="1.0" encoding="UTF-8"?> <toplink-sessions version="10g Release 3 (10.1.3.1.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <session xsi:type="server-session"> <name>default</name> <event-listener-classes/> <primary-project xsi:type="xml">BharosaTLMappings.xml</primary-project> <login xsi:type="database-login"> <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class> <external-connection-pooling>true</external-connection-pooling> <sequencing> <default-sequence xsi:type="native-sequence"> <name>Native</name> <preallocation-size>1</preallocation-size> </default-sequence> </sequencing> <datasource>%oarm_ds%</datasource> </login> <connection-policy/> </session> </toplink-sessions>
Platform specific property that you modify the TopLink <platform-class> tag with are listed below.
Oracle TopLink <platform-class> tag that you will need to modify are listed below.
Oracle - Generic
oracle.toplink.platform.database.OraclePlatform
Oracle10g (10.1.0.3)
oracle.toplink.platform.database.oracle.Oracle10Platform
For WebLogic:
com.bharosa.common.db.wldbutil.Oracle10PlatformLOBUtil
Oracle10g (10.2.0.1)
oracle.toplink.platform.database.oracle.Oracle10Platform
For WebLogic:
com.bharosa.common.db.wldbutil.Oracle10PlatformLOBUtil
Note:
For WebLogic, use Oracle drivers with the Utility class. The WebLogic database drivers will not work with the Utility class.