Sunday, July 19, 2015

How to browse the H2 database management tool in WSO2 products

Hi, in this blog post I shall show you how to access and view the H2 DB management tool that is shipped with all WSO2 products.


This can be easily done by following the below steps.

Step 1 - Download a WSO2 product


For this example I am using WSO2 ESB but this configuration is common to most WSO2 products which can be downloaded from here.

Step 2 - Go to carbon.xml


Extract the downloaded product to a desired location and open the carbon.xml which is located at <ESB_HOME>/repository/conf.

Step 3 - Edit the carbon.xml


Un-comment H2 DB configuration as shown below.

<!--H2DatabaseConfiguration>
        <property name="web" />
        <property name="webPort">8082</property>
        <property name="webAllowOthers" />
        <!-- <property name="webSSL" />
        <property name="tcp" />
        <property name="tcpPort">9092</property>
        <property name="tcpAllowOthers" />
        <property name="tcpSSL" />
        <property name="pg" />
        <property name="pgPort">5435</property>
        <property name="pgAllowOthers" />
        <property name="trace" />
        <property name="baseDir">${carbon.home}</property> -->
    </H2DatabaseConfiguration-->

Now start the ESB from wso2server.sh / wso2server.bat depending on the OS you are using which is located at  <ESB_HOME>/bin




Step 4 - View H2 DB Management tool in browser 

Open the browser and go to http://localhost:8082/ and give the JDBC URL which is similar to <ESB_HOME>/repository/database/WSO2CARBON_DB and test the connection. 





When it displays successful. Then click on "Connect"

You can see the databases and query it as you like.







1 comment: