Skip to main content

Setting up databases

Once you have successfully prepared the environment for the deployment, you can configure the databases.

note

NextGenPSD2 Reference Toolkit is compatible with the following DBMSs:

  • MySQL 8.0
  • Oracle 19c
  • Microsoft SQL Server 2017
  • PostgreSQL 13

Creating databases​

  1. Create the following databases:

    • openbank_apimgtdb
    • openbank_am_configdb
    • openbank_govdb
    • openbank_userdb
    • openbank_iskm_configdb
    • openbank_openbankingdb
  2. According to your DBMS, place the compatible JDBC drivers in the following directories:

    • <APIM_HOME>/repository/components/lib
    • <IS_HOME>/repository/components/lib
    tip

    The supported JDBC driver versions are as follows:

    DBMS versionJDBC driver version
    MySQL 8.0mysql-connector-java-5.1.44.jar
    Oracle 19cojdbc10.jar
    Microsoft SQL Server 2017sqljdbc41.jar
    PostgreSQL 13postgresql-42.2.17.jar

Configuring datasources​

  1. The databases above have a respective datasource. Add or update the default datasource configurations in <APIM_HOME>/repository/conf/deployment.toml with your database configurations.

    • Given below is the relevant datasource configuration for each database:

      DatabaseTOML configuration
      openbank_apimgtdb[database.apim_db]
      openbank_am_configdb[database.config]
      openbank_govdb[database.shared_db]
      openbank_userdb[[datasource]]
      id="WSO2UM_DB"
      • Configure the datasources by following the sample below:
    [database.apim_db]
    url = "jdbc:mysql://localhost:3306/openbank_apimgtdb?autoReconnect=true&amp;useSSL=false"
    username = "root"
    password = "root"
    driver = "com.mysql.jdbc.Driver"

    [database.apim_db.pool_options]
    maxActive = "150"
    maxWait = "60000"
    minIdle ="5"
    testOnBorrow = true
    validationQuery="SELECT 1"
    validationInterval="30000"
    defaultAutoCommit=false
  2. Add or update the default datasource configurations in <IS_HOME>/repository/conf/deployment.toml with your database configurations.

    • Given below is the relevant datasource configuration for each database:
    DatabaseTOML configuration
    openbank_apimgtdb[database.identity_db]
    openbank_govdb[database.shared_db]
    openbank_userdb[database.user]
    openbank_iskm_configdb[database.config]
    openbank_openbankingdb[[datasource]]
    id="WSO2OB_DB"
    • Configure the datasources by following the sample below:
    [database.config]
    url = "jdbc:mysql://localhost:3306/openbank_iskm_configdb?autoReconnect=true&amp;useSSL=false"
    username = "root"
    password = "root"
    driver = "com.mysql.jdbc.Driver"

    [database.config.pool_options]
    maxActive = "150"
    maxWait = "60000"
    minIdle ="5"
    testOnBorrow = true
    validationQuery="SELECT 1"
    validationInterval="30000"
    defaultAutoCommit=false

Creating database tables​

To create the database tables, go to the following locations and execute the relevant database script against the given database.

These locations contain database scripts for all the supported database types, choose the script according to your DBMS.

DatabaseScript location
openbank_apimgtdb<APIM_HOME>/dbscripts/apimgt
openbank_am_configdb<APIM_HOME>/dbscripts
openbank_govdb<APIM_HOME>/dbscripts
openbank_userdb<APIM_HOME>/dbscripts
openbank_iskm_configdb<IS_HOME>/dbscripts
openbank_openbankingdb<IS_HOME>/dbscripts/open-banking/consent
Increase the column size of the following table columns:

Execute the relevant SQL command against the openbank_apimgtdb database.

  1. Increase the column size of the VALUE column in the SP_METADATA table:

    ALTER TABLE SP_METADATA MODIFY VALUE VARCHAR(4096);
  2. Increase the column size of the INPUTS column in the AM_APPLICATION_REGISTRATION table:

    ALTER TABLE AM_APPLICATION_REGISTRATION MODIFY INPUTS VARCHAR(7500);

Was this page helpful?