Skip to main content
1-Visitor
November 22, 2017
Solved

Error while accessing the H2 database from a thing service

  • November 22, 2017
  • 2 replies
  • 6791 views

I am using internal H2 db to host my application data as well. So I have created a database and a table in H2 database from H2 console. When I try to connect to this database and access the table data, I am getting error IO Exception: "java.io.IOException: The filename, directory name, or volume label syntax is incorrect"; "TCP:C:/ThingworxStorage/database/<my_database_name>.mv.db" [90031-192]

Note: I can see that <my_database_name>.mv file is getting created under ThingworxStorage/database

Message was edited by: Pawan Badiger added note

Best answer by pbadiger

This is now resolved.

I changed the connection string to use H2 console, I closed all the browser sessions, which included the H2 console session. This closed the open H2 session allowing thingworx to access the H2 db properly and it worked.

2 replies

5-Regular Member
November 22, 2017

Hi Pawan, just curious any specific reason why you prefer to create custom tables in H2 DB rather than connecting an RDBMS via JDBC driver?

Can you share your connection string?

pbadiger1-VisitorAuthor
1-Visitor
November 22, 2017

This is because we are currently working on a PoC and are restricted to working with limited resources.

Below are the connection details

JDBC Driver class: org.h2.Driver

jdbc:h2:TCP:C:\ThingworxStorage\database\<my_database_name>

Thank you in advance

pbadiger1-VisitorAuthorAnswer
1-Visitor
November 22, 2017

This is now resolved.

I changed the connection string to use H2 console, I closed all the browser sessions, which included the H2 console session. This closed the open H2 session allowing thingworx to access the H2 db properly and it worked.

5-Regular Member
November 22, 2017

thanks for confirming, was still in the process of validating with a local setup.