Follow the instructions below to set up a remote H2 database.
...
2. Go to the $H2_HOME/bin
directory and run the H2 network server starting script.
Info | title | Tip
---|
|
...
1. Edit the default database configuration defined in the master-datasources.xml
file located at $CARBON$PRODUCT_HOME/repository/conf/datasources
directory instance as follows. Both the database configurations in registry.xml
and user-mgt.xml
refer this data source.
Info | title | Note
---|
The configurations should be replaced with your own database name, username, and password. |
...
- 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.
Setup Drivers
Info | title | Tip
---|
The H2 database version h2-1.2.140 and the related H2 database driver are currently shipped with the WSO2 BPS. |
...
1. Delete the following H2 database related JARs. Some of them may already be excluded from the configuration.
$CARBON$PRODUCT_HOME/repository/components/plugins/h2-database-engine_1.2.140.wso2v3.jar
...
2. Copy the new H2 database driver (org.h2.Driver
) to $CARBON$PRODUCT_HOME/repository/components/lib
. You can find the required driver JAR in $H2_HOME/bin/h2-*.jar
.
...
1. Tables can be manually created by logging into the created database and running the following script in H2 shell or web console.
Info | |
---|---|
Note | Use the |
Code Block |
---|
CARBONPRODUCT_HOME/dbscripts/h2.sql |
2. After setting up the DB tables, start the server with the following commands.
...