+

Search Tips   |   Advanced Search

Configure Apache Tomcat for Oracle manually

To manually set up and configure the Oracle database with the Apache Tomcat server, use the following procedure.

Complete the Oracle database setup procedure before continuing.

  1. Add the Oracle JDBC driver JAR file to the directory $TOMCAT_HOME/lib.

  2. Prepare an XML statement that defines the data source, as shown in the following code example. Insert this statement in the server.xml file, as indicated in Configure Apache Tomcat manually.
      <Resource name="jdbc/WorklightDS"
                auth="Container"
                type="javax.sql.DataSource"
                driverClassName="oracle.jdbc.driver.OracleDriver"
                url="jdbc:oracle:thin:@oserver:1521/ORCL"
                username="WORKLIGHT"
                password="WORKLIGHT_password"/>
      <Resource name="jdbc/WorklightReportsDS"
                auth="Container"
                type="javax.sql.DataSource"
                driverClassName="oracle.jdbc.driver.OracleDriver"
                url="jdbc:oracle:thin:@oserver:1521/ORCL"
                username="WORKLIGHTREPORTS"
                password="WORKLIGHTREPORTS_password"/>

    Where WORKLIGHT and WORKLIGHTREPORTS after username= 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.


Parent topic: Configure the Oracle databases manually