All WSO2 products are shipped with a default H2 database. In some product scenarios, you may need to access a database table to see how it works, to troubleshoot, or to try out the scenario.
Follow the instructions given below to connect to the H2 database and browse through it.
H2 is not recommended in production
The embedded H2 database is NOT recommended in enterprise testing and production environments. It has lower performance, clustering limitations, and can cause file corruption failures. Please use an industry-standard RDBMS such as Oracle, PostgreSQL, MySQL, or MS SQL instead.
You can use the embedded H2 database in development environments and as the local registry in a registry mount.
<PRODUCT_HOME>/repository/conf/carbon.xmlfile and paste the following configuration.
Do not uncomment the existing
<H2DatabaseConfiguration>element. Just paste the following configuration below it.
Restart the WSO2 product and access the following URL via your browser: http://localhost:8082
Tip: If you are logged in to the management console, logout before connecting to the database.
- Enter the following details and click Connect.
- JDBC URL : jdbc:h2:[file path to <PRODUCT_HOME>/repository/database/WSO2CARBON_DB]
- username : wso2carbon
- password : wso2carbon
The database tables are listed on the left. You can now browse through them as required.