Saturday, June 2, 2012

Watching Content of Embedded H2 Database Through Browser in WSO2 Products

H2 is a RDBMS written in Java.This database can be used in embedded mode,only thing is add the h2*.jar to the class path & do not have any other dependencies.All the WSO2 products are default shipped with H2 database.Graphical interfaces to run SQL commands and display their results. there are H2 Database Query Tool also available.


1. Download a  WSO2 product and extract

2. Open the file "carbon.xml" in the location repository/conf

3. Enable the followe H2DatabaseConfiguration only

<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>
</Server>

In here we do not need to start PG server therefor only enabling
        <property name="web" />
        <property name="webPort">8082</property>
        <property name="webAllowOthers" />
is enough

4. Save the file and close

5. Start the server


So now that If wanted to watch the content of this db browser page should open with the URL http://localhost:8082 to in browser


Login

Select [Generic H2] and JDBC URL : jdbc:h2:<file path to CARBON_HOME>/repository/database/WSO2CARBON_DB
username : wso2carbon
password  : wso2carbon





 You are now logged in & ow h2 database use WSO2 client that can run SQL commands and display their results


No comments:

Post a Comment