Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to browse Added Data in Embedded H2 database

I used the out of box H2 embedded database for WSO2 Gov Registry 4.6.0 and added many entries there. I am trying to view the data in tables in the database but somehow cannot see the tables.

I logged in the embedded H2 database but only see the system tables and no tables or data that I added to the registry.

How can I get access to the REG_* and UM_* tables in the database to see the data?

I tried to see the tables in H2 db browser and DBVisualizer but cannot see tables and data in both.

Error log:

[2014-11-22 16:32:57,972] INFO {org.wso2.carbon.h2.osgi.console.ConsoleService} - Starting H2 Web server... [2014-11-22 16:32:58,191] INFO {org.wso2.carbon.h2.osgi.console.ConsoleService} - Starting H2 TCP server... org.h2.server.TcpServerThread@65fe28a7 Connect [2014-11-22 16:32:58,193] INFO {org.wso2.carbon.h2.osgi.console.ConsoleService} - Starting H2 PG server... Connect Disconnect Close javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Received close_notify during handshake at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1343) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1355) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:44) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at java.io.DataOutputStream.flush(DataOutputStream.java:106) at org.h2.value.Transfer.flush(Transfer.java:85) at org.h2.server.TcpServerThread.sendError(TcpServerThread.java:197) at org.h2.server.TcpServerThread.run(TcpServerThread.java:129) at java.lang.Thread.run(Thread.java:695) Caused by: javax.net.ssl.SSLException: Received close_notify during handshake at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1703) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1801) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1004) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:818) at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at java.io.DataInputStream.readInt(DataInputStream.java:370) at org.h2.value.Transfer.readInt(Transfer.java:145) at org.h2.server.TcpServerThread.run(TcpServerThread.java:71) ... 1 more org.h2.server.TcpServerThread@65fe28a7 Disconnect org.h2.server.TcpServerThread@65fe28a7 Close

like image 521
Cari Avatar asked Mar 20 '23 08:03

Cari


1 Answers

All the WSO2 products are default shipped with H2 database.

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
  3. Fill the JDBC URL, username and password as follows.
    • JDBC URL : jdbc:h2:/repository/database/WSO2CARBON_DB
    • username : wso2carbon
    • password : wso2carbon

Hope this helps!

like image 199
tk_ Avatar answered Apr 10 '23 16:04

tk_