Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the instructions below to set up a remote H2 database.

...

1. Edit the default database configuration defined in the  master-datasources.xml  file located at  $CARBON<PRODUCT_HOMEHOME>/repository/conf/datasources directory instance as follows. Both the database configurations in  registry.xml  and  user-mgt.xml  refer this data source.

...

  • url - The URL of the database.
  • username - The name of the database user.
  • password - The password of the database user.
  • driverClassName  - The class name of the database driver.
  • maxActive - The maximum number of active connections that can be allocated from this pool at the same time or negative for no limit.
  • maxWait - The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or <= 0 to wait indefinitely.
  • minIdle - The minimum number of active connections that can remain idle in the pool, without extra ones being created, or 0 to create none.

...

1. Delete the following H2 database related JARs. Some of them may already be excluded from the configuration.

  • $CARBON<PRODUCT_HOMEHOME>/repository/components/plugins/h2-database-engine_1.2.140.wso2v3.jar

...

2. Copy the new H2 database driver (org.h2.Driver) to $CARBON<PRODUCT_HOMEHOME>/repository/components/lib. You can find the required driver JAR in $H2_HOME/bin/h2-*.jar.

...

Info
titleNote

Use the ./h2.sh command to start the web console. After that copy the script text from the SQL file, paste it into the console and click "Run."

Code Block
CARBONPRODUCT_HOME/dbscripts/h2.sql

2. After setting up the DB tables, start the server with the following commands.

...