+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Configure Apache Tomcat for DB2 manually for Application Center

If we want to manually set up and configure your DB2® database for Application Center with Apache Tomcat server, use the following procedure.

Before you contiue, complete the DB2 database setup procedure.


Procedure

  1. Add the DB2 JDBC driver JAR file.

    We can retrieve this JAR file in one of the following ways:

    • Download it from DB2 JDBC Driver Versions.
    • Or fetch it from the directory db2_install_dir/java on the DB2 server) to $TOMCAT_HOME/lib.

  2. Prepare an XML statement that defines the data source, as shown in the following code example.

        <Resource auth="Container"
                  driverClassName="com.ibm.db2.jcc.DB2Driver"
                  name="jdbc/AppCenterDS"
                  username="worklight"
                  password="password"
                  type="javax.sql.DataSource"
                  url="jdbc:db2://server:50000/APPCNTR:currentSchema=APPSCHM;"/>

    The worklight parameter after username= is the name of the system user with "CONNECT" access to the APPCNTR database that you have previously created. The password parameter after password= is this user's password. If you have defined either a different user name, or a different password, or both, replace these entries accordingly.

    DB2 enforces limits on the length of user names and passwords.

    • For UNIX and Linux systems: 8 characters
    • For Windows: 30 characters

  3. Insert this statement in the server.xml file, as indicated in Configure Apache Tomcat for Application Center manually.

Parent topic: Configure the DB2 database manually for IBM MobileFirst Platform Application Center