How to Browse H2 database in WSO2 products

If your a frequent user of wso2 products, sometimes you might wanted to browse data and test quires in wso2 H2 databasesH2 is a relational database management system written in Java. It can be embedded in Java applications or run in the client-server mode. The disk footprint (size of the jar file) is about 1.5 MB.
WSO2 products currently ships H2 database engine version h2-1.2.140.* and its related H2 database driver.


H2, the Java SQL database. The main features of H2 are:
  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 1.5 MB jar file size
This can be easily achieved by enabling the H2DatabaseConfiguration in carbon.xml.
  1. Go to the CARBON_HOME/repository/config
  2. Open the carbon.xml file.
  3. Paste the H2DatabaseConfiguration as follows.(don't uncomment the H2DatabaseConfiguration which already there just paste below code)
<H2DatabaseConfiguration>
        <property name="web"/>
        <property name="webPort">8082</property>
        <property name="webAllowOthers"/>        
</H2DatabaseConfiguration>



  1. Start the the server.
  2. Direct your browser to http://localhost:8082


  1. Fill the JDBC URL, username and password as follows.
    • JDBC URL : jdbc:h2:repository/database/WSO2CARBON_DB
    • username : wso2carbon
    • password : wso2carbon
Note: for the JDBC URL make sure you use the relative path not the absolute path which is jdbc:h2:<gregHome>/repository/database/WSO2CARBON_DB  
Now You can browse through h2 database using simple h2 dashboard.




Comments