Versions Compared

Key

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

The following sections describe how to replace the default H2 database with Embedded H2: 

Table of Contents
maxLevel3
minLevel3
styleborder:1
separatorpipe

Tip
titleBefore you begin
You need
  • Be sure to set up
Embedded H2 before following the steps to configure your product with it. For more information, see  
  • Be sure to download the <DB Driver> and copy it to

Setting up configuration files

...

Following are the datasource configuration properties:

PropertyDescription
urlThe URL of the database.
userName The name of the database user.
passwordThe password of the database user.
driverClassNameThe class name of the database driver.
maxActiveThe maximum number of active connections that can be allocated from this pool at the same time, or enter a negative value for no limit.
maxWaitThe 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. You can enter zero or a negative value to wait indefinitely.
minIdleThe minimum number of active connections that can remain idle in the pool, without extra ones being created, or enter zero to create none.
testOnBorrowThe indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and another attempt will be made to borrow another. 
validationQueryThe SQL query that will be used to validate connections from this pool before returning them to the caller.
validationInterval

The indication to avoid excess validation, and only run validation at the most, at this frequency (time in milliseconds). If a connection is due for validation, but has been validated previously within this interval, it will not be validated again. 

Info

For more information on other parameters that can be defined in the datasource xml file, see Tomcat JDBC Connection Pool.

...

You can create the database tables manually by executing the H2 script in the shell or web console:

DatabaseDB Script name and Location

WSO2_CARBON_DB

<IoTS_HOME>/dbscripts//h2.sql

WSO2AM_DB

<IoTS_HOME>/dbscripts//apimgt/h2.sql

WSO2_MB_STORE_DB

<IoTS_HOME>/wso2/broker/dbscripts/mb-store/h2.sql

WSO2_ANALYTICS_EVENT_STORE_DB

 


WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB

 


WSO2_METRICS_DB

<IoTS_HOME>/dbscripts//metrics/h2.sql

DM_DS<IoTS_HOME>/dbscripts//cdm/h2.sql

Device plugin databases

Example: Arduino_DB

<IoTS_HOME>/dbscripts//cdm/plugins/<PLUGIN_NAME>/h2.sql

Example:

<IoTS_HOME>/dbscripts//cdm/plugins/android/h2.sql

Follow the steps below to run the H2 script in web console: 

...