Timeout when connecting to H2 database

Hello,

I was trying to connect to the Camunda H2 database via the H2 Console at http://localhost:8080/h2/h2. But when I try to establish a connection I (immediately) receive the error message

Connection is broken: "java.net.SocketTimeoutException: connect timed out: localhost"

I am using the following settings:

driver: org.h2.Driver
url: jdbc:h2:tcp://localhost/~/test
user: sa
password: sa

I am running the tomcat version of camunda that I downloaded from the camunda site (I made no changes or configurations yet).

Does anybody can explain me how I can solve this timeout problem? Can I configure the timeout value of the used camunda application somewhere in the configuration files?

Regards
Michael

Hi @michael.n and welcome to the Camunda community!

From what you’ve posted, it looks like the url in your settings is missing a port number for the H2 database. The jdbc connector needs to know what port to use for the connection.

hth,
dg

Hi @davidgs,

explicitly defining the port did not help. But your answer motivated me to rethink all the steps I’ve done so far. At the end I got the solution how to connect to the camunda-bpm-tomcat database :slight_smile:

The decisive hint I got on the following site of the Camunda documentation:
Install the Pre-Packaged Distribution

There you can find a description on how to access the standard H2 database of the prepacked version of Camunda.

The connection settings are as follows:

jdbc:h2:./camunda-h2-dbs/process-engine
User: sa
Password: sa

This means also that you have to use the embedded version of H2 instead of the server version.

Many thanks for your help!
Regards
Michael

1 Like