How to open Guidewire H2 database file

As you know H2 is the default database used by Guidewire InsuranceSuite products for local development environment. If you see this tag in your PolicyCenter database-config.xml, for example

<database  name="PolicyCenterDatabase"  dbtype="h2">
  <dbcp-connection-pool    jdbc-url="jdbc:h2:file:/tmp/guidewire/pc;CACHE_SIZE=32000"/>
</database>

then you use H2 as well. It's quick and easy to start, but at some point you'll want to take a look at your data tables. How to do this properly? Fortunately, there are great tools for this purpose. You can use DBeaver or DBVisualizer. As an example let's consider DBeaver. To create a new connection try File -> New -> Database Connection, Connection Type = H2 Embedded.

Now is the most interesting part. On Generic JDBC Connection Settings in Database/Schema specify the folder where you H2 database files are stored. For example, c:/tmp/guidewire/pc. Warning!  Don't specify a file name, like pc.h2.db. If you do this you'll see nothing.  If you don't have H2 driver so far DBeaver will download it for you. Finish the wizard and go to your new connection -> PUBLIC -> Tables. All your database tables are there and you can do whatever you want with them.

Please note, if you open the database in DBeaver you will not be able to start you server, you'll get a database locked exception. That's because the database file is locked and cannot be used by more than one process at the same time. Disconnect DBeaver and the file will be unlocked. Enjoy!

Comments

  1. I am not able to make the H2 connection in CC. it is showing table is not found. could you please help

    ReplyDelete

Post a Comment

Popular posts from this blog

Hello World!

Existence Script must be empty if existence is not defined by script