Connection to H2 local business_data.db for test purposes

1
0
-1

Hello,

I'm trying to access the H2 business_data database and extract some data for test purposes (before switching to another DB).

I've setup an H2 connector with folllowing configuration:

jdbc:h2:TCP://localhost:5432/business_data.db;FILE_LOCK=NO

username: sa

password:

I got this error when submitting my SQL request:

java.lang.reflect.InvocationTargetException
org.bonitasoft.engine.bpm.connector.ConnectorExecutionException: USERNAME=install | org.bonitasoft.engine.core.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.h2.jdbc.JdbcSQLException: Table "CLIENTS" non trouvée
Table "CLIENTS" not found; SQL statement:
SELECT * FROM CLIENTS; [42102-170]

Could you please tell me the right approach for extracting business data directly from the local H2 database using a script?

Thanks a lot for your help,

Kind regards.

Pierre-Alain

2 answers

1
+1
-1
This one is the BEST answer!

Hi,
The JDBC url should look like this:

jdbc:h2:file:/path/to/h2_database/business_data.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE;IGNORECASE=TRUE;AUTO_SERVER=TRUE;

If you are in a studio envrionement, each project has it h2_database folder (in STUDIO_FOLDER/workspace/My Project/h2_database)

But remember that you should not access the BDM database directly in your process but use business variables and DAOs.

HTH
Romain

1
+1
-1

Hello Pierre-Alain,

can you tell us why you need to use a connector to get data from your business data database?

I'd suggest you to use the dao api provided. If you created a Business object called "Clients" you have a "clientsDAO" library that you can use to query data.

Anyway the connector should work as well, also if not suggested.

How did yiu create your Clients table?

Thanks

Notifications