Unable to Connect H2 Database from UiPath Using Java Activities – Need Assistance

Hi Everyone,

I’m trying to establish a connection between UiPath and an H2 database, but I’m facing issues during the setup.

I have the inputs JDBC URL, Username, Password for the H2 DB configuration in UiPath.

I downloaded the H2.jar file and loaded it inside the Java Scope as the first step. I also configured Java in the system environment and passed the JDK folder path in the Java Scope activity.

Inside the Java Scope, I’m using Invoke Java Method activities to connect to the H2 database and execute a simple SELECT query.

The Java Scope activity itself runs without any errors, but the Invoke Java Method activity inside it throws an error. I’m not getting any data or confirmation from the query execution.

Could someone please guide me on the correct approach or share any working examples for connecting UiPath with an H2 database (preferably using JDBC or any alternative method)?

Any help or suggestions would be greatly appreciated! :folded_hands:

Thanks,
Pritam Senapati

Hi @Pritam_Senapati

I tried it with a sample H2 database, and this is a sample project that does what you want with the Java activities. It is not trivial, but it works and in this sample it returns the number of returned rows.

It also requires you to manually navigate the result set, which is a bit of a pain, but hopefully workable.

Sample project: H2 database with Java activities.zip (2.4 MB)


There are a few other ways, but it would depend on what would suit you best:

  • convert the H2.jar file to a .NET DLL using IKVM, and then use Coded Workflows in C# to interact with your DB
  • reach out to any of the JDBC.NET bridges
  • some Python libraries might be able to do it, but might become quite complex