Configuring Liberty Profile for DB2 manually

IBM Worklight V5.0.5. automatically configures your databases. However, if you are using an older version of IBM Worklight, or if you are experiencing problems with the automatic configuration process for the Liberty Application Server, you must manually set up and configure your DB2 database and then the Liberty Application Server for DB2. Complete the DB2 Database Setup procedure before continuing.

  1. Add the DB2 JDBC driver (download it from DB2 JDBC Driver Versions) JAR file to $LIBERTY_HOME/usr/shared/resources/lib. If that directory does not exist, create it.

  2. Configure the data source in the $LIBERTY_HOME/usr/servers/defaultServer/server.xml file as follows:
    <server description="new server">
        <!-- Enable features -->
        <featureManager>
            <feature>servlet-3.0</feature>
            <feature>jdbc-4.0</feature>
        </featureManager>
        <httpEndpoint id="defaultHttpEndpoint"
                      host="localhost"
                      httpPort="9080">
        </httpEndpoint>
        <classloader delegation="parentLast">
                <commonLibrary>
                    <fileset dir="${shared.resource.dir}/lib" includes="*.jar"/>
                </commonLibrary>
            </classloader>
        </application>
        <!-- JNDI data source -->
        <dataSource id="DB2"  jndiName="jdbc/WorklightDS" jdbcDriverRef="DB2JCC4">
            <properties databaseName="WRKLGHT" user="worklight" password="worklight" portNumber="50000" serverName="localhost"/>
        </dataSource>
    <dataSource id="WorklightReportsDS"  jndiName="jdbc/WorklightReportsDS" jdbcDriverRef="DB2JCC4">
            <properties databaseName="WLREPORT" user="worklight" password="worklight" portNumber="50000" serverName="localhost"/>
        </dataSource>
    

    Where worklight after user= is the name of the system user with "CONNECT" access to the WRKLGHT database that you have previously created, and worklight 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.

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


Parent topic Troubleshooting