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


Configure Liberty profile for DB2 manually for Application Center

We can set up and configure your DB2® database manually for Application Center with WebSphere® Application Server Liberty profile.


Before you begin

Complete the DB2 Database Setup procedure before continuing.


Procedure

  1. Add the DB2 JDBC driver JAR file to $LIBERTY_HOME/wlp/usr/shared/resources/db2.

    If that directory does not exist, create it. We can retrieve the file in one of two ways:

  2. Configure the data source in the $LIBERTY_HOME/wlp/usr/servers/worklightServer/server.xml file as follows:

    In this path, we can replace worklightServer by the name of your server.

    <library id="DB2Lib"> <fileset dir="${shared.resource.dir}/db2" includes="*.jar"/> </library> <!-- Declare the IBM Application Center database. --> <dataSource jndiName="jdbc/AppCenterDS" transactional="false"> <jdbcDriver libraryRef="DB2Lib"/> <properties.db2.jcc databaseName="APPCNTR" currentSchema="APPSCHM" serverName="db2server" portNumber="50000" user="worklight" password="worklight"/> </dataSource>

    The worklight placeholder after user= is the name of the system user with CONNECT access to the APPCNTR database that you have previously created. The worklight placeholder after password= is this user's password. If you have defined either a different user name, or a different password, or both, replace worklight accordingly. Also, replace db2server with the host name of your DB2 server (for example, localhost, if it is on the same computer).

    DB2 has a user name and password length limit of 8 characters for UNIX and Linux systems, and 30 characters for Windows.

  3. We can encrypt the database password with the securityUtility program in <liberty_install_dir>/bin.

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