3.3. Setup Datasource

The Business Central application requires a datasource which must be created prior to the deployment of the actual WAR file. This also means that you must have access to an underlying database that the datasource connects to. Whatever your underlying database, make sure you have the datasource ready. The steps below will help you set this up.
  1. Open up the JDBC providers panel by clicking on Resources --> JDBC --> JDBC Providers.
  2. Select the scope of this JDBC provider to include your server and node. It cannot be All scopes. Then click the New... button. This will bring up the Create new JDBC provider form page.
  3. Fill out the form based on the database driver that you have available. If your database is not listed, select Others Database type selection box and provide the implementation class name. For example, for H2, Postgres or MySQL, the implementation class name will be org.h2.jdbcx.JdbcDataSource, org.postgresql.xa.PGXADataSource and com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource respectively.
  4. Make sure to give the JDBC Provider a name that is descriptive and click the Next button. You will be asked to provide the CLASSPATH for the JDBC driver class files that you have just defined. Enter this value and click the Next button to be taken to the summary screen. Click the Finish button to accept and add this new JDBC Provider.
Using this new JDBC provider, you will now need to setup the actual datasource for Business Central. Before you create the datasource, however, open up the persistence.xml file in the Business Central war file that you have downloaded. You will need to know the name of the datasource defined within this file. It is normally jdbc/jbpm.
You will also need to change the hibernate.dialect to suit your actual database. For example, if your underlying database is DB2, you would change the this property from org.hibernate.dialect.H2Dialect to org.hibernate.dialect.DB2Dialect.

Setting up a Datasource

  1. Open up the datasources panel by clicking on Resources --> JDBC --> Data sources in the WebSphere administrative panel. Click the New... button making sure the appropriate scope has been selected from the Scope drop-down.
  2. Step 1 of the "Create a Data source" form is displayed. Enter a unique Data source name that you will use to refer to this datasource by. The JDBC provider is the one you created earlier in this section, and the JNDI name is the one you looked up from the persistence.xml file. Click Next and select the JDBC provider created earlier from the drop-down menu. Click Next 2 more times and accept the default values.
  3. Click the Finish button to save the changes and then click to save the changes in the master configuration.
  4. You will now need to provide the basic meta properties for this datasource. Properties like servername, databasename, username and password must now be defined and vary for different databases. These properties can be defined by editing the datasource just created and then clicking on Custom properties link under the Additional properties menu. Some example database properties are shown below.
    For H2 databases, you will need to define the following custom properties:
    • URL
    • user
    • password
    For MySQL databases, you will need to define the following custom properties:
    • serverName
    • databaseName
    • port
    • user
    • password
    Finally for Postgres databases, you will need to define the following custom properties:
    • serverName
    • databaseName
    • portNumber
    • user
    • password
  5. Once all the connection properties have been defined, click the Test Connection to ensure the validity of the datasource.