cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect to H2 Database embedded with ThingWorx

Tanzanite

How to connect to H2 Database embedded with ThingWorx

Introduction

 

H2 database provided as an embedded persistence provider with ThingWorx. However, for those of us interested in peeking inside the structure of how the data is persisted, it's challenging to simply connect to it like other databases which are installed separately e.g. PostgreSQL, SAP Hana, or any other RDBMS connecting to ThingWorx via JDBC.

 

Disclaimer: This guide is for the purpose of debugging or view only scenarios. Any direct change to the stored data in the H2 database may lead to data corruption leading to data loss or ThingWorx failing to start.

 

How to connect to embedded H2 Database installation

 

Challenging as it may appear at first sight, connecting to H2 Database embedded with ThingWorx is quite straight forward. Here's a quick guide to it:

 

1. Download and Install H2 Database engine

 

     Visit the official page of H2Database and download the last stable version for your platform

 

2. Access the H2 Database browser

 

     Navigate to the H2 Console, for e.g. if installed on Windows OS : Window's Start > H2 Console

 

3. Connecting to the H2 Database embedded with ThingWorx

 

     H2 Console is a web based UI and will be launched in a web browser, see following sample screenshot. For connecting to the existing embedded H2 DB used within           ThingWorx, simply provide the location for the \\ThingWorxStorage\Database\data and press Connect without any username and password.

 

4. Exploring the H2 Console

 

     Once connected you will be able to view the schema and all the data stored within, like so

Tags (1)
3 REPLIES 3

Re: How to connect to H2 Database embedded with ThingWorx

How create database with table and show into mashup. Please help.

Re: How to connect to H2 Database embedded with ThingWorx

Hi Rajanikant, can you please elaborate more your use case what sort of database are you referring to i.e. an external data store or Persistence Provider for ThingWorx? Or are you looking to create just a DataTable ?

Would recommend you to please open a separate thread/discussion to ask your specific question in detail so it gets more visibility on the Developer Community.

Highlighted

Re: How to connect to H2 Database embedded with ThingWorx

Thanks for sharing the information.

 

i have also connected thingworx with h2 db and i am able to view the schema . But how can we view the tables which are stored in thingworx db ?  like thing, thing templates , user groups etc?

 

 

Tags (1)