+

Search Tips   |   Advanced Search

Configure Liberty Profile for Oracle manually

To manually set up and configure the Oracle database with WAS Liberty Profile, use the following procedure.

Complete the Oracle database setup procedure before continuing.

  1. Add the Oracle JDBC Driver JAR file to $LIBERTY_HOME/wlp/usr/shared/resources/oracle. If that directory does not exist, create it.

  2. If we are using JNDI, configure the data sources in the $LIBERTY_HOME/wlp/usr/servers/worklightServer/server.xml file (worklightServer may be replaced in this path by the name of the server) as shown in the following JNDI code example:
    <!-- Declare the jar files for Oracle access through JDBC. -->
    <library id="OracleLib">
      <fileset dir="${shared.resource.dir}/oracle" includes="*.jar"/>
    </library>
    <!-- Declare the Worklight Server project database -->
    <dataSource jndiName="worklight/jdbc/WorklightDS" transactional="false">
      <jdbcDriver libraryRef="OracleLib"/>
      <properties.oracle driverType="thin" databaseName="ORCL"
                         serverName="oserver" portNumber="1521"
                         user="WORKLIGHT" password="WORKLIGHT_password"/>
    </dataSource>
    <!-- Declare the Worklight Server reports database -->
    <dataSource jndiName="worklight/jdbc/WorklightReportsDS" transactional="false">
      <jdbcDriver libraryRef="OracleLib"/>
      <properties.oracle driverType="thin" databaseName="ORCL"
                         serverName="oserver" portNumber="1521"
                         user="WORKLIGHTREPORTS" password="WORKLIGHTREPORTS_password"/>
    </dataSource>

    Where WORKLIGHT and WORKLIGHTREPORTS after user= are the names of the users with "CONNECT" access to the WRKLGHT and WLREPORT databases that you previously created, and password after password= are this users' passwords. If we defined either different user names, or different passwords, or both, replace these entries accordingly. Also, replace oserver with the host name of your Oracle server (for example, localhost, if it is on the same machine).

    The database users provided in this step do not need extended privileges on the databases. If we need to implement restrictions on the database, we can set here a user that has the restricted privileges listed in Restrict database user permissions for runtime operations.

    The jndiName attributes must depend on the context root that you select for the MobileFirst Server application, following the instructions in Configure the Liberty profile manually. If the context root is /app_context, use jndiName="app_context/jdbc/WorklightDS" and jndiName="app_context/jdbc/WorklightReportsDS".


Parent topic: Configure the Oracle databases manually