cancel
Showing results for 
Search instead for 
Did you mean: 

Create connection to in memory H2 database in Integration Suite fails

kaisand
Explorer
0 Kudos

I'd like to create a In Memory H2 database in the Integration Suite. Therefor I uploaded the h2-Jar in the Resources Section of the iFlow and made the connection as follows:

.....

import org.h2.Driver

def Message processData(Message message) {

...

Class.forName("org.h2.Driver").newInstance()

Connection conn = DriverManager.getConnection("jdbc:h2:mem:test")

I get the following error:

java.sql.SQLException: No suitable driver found for jdbc:h2:mem:

The driver is definitely there otherwise I'd get a ClassNotFoundException.

When I try uploading whatever driver in the JDBC material I get the error:

Deploy artifact failed with error: (deployJdbcDriver)Failed to deploy jdbc driver null for tenant

Only Oracle, DB2 and MSSQL seem to be supported there.

How can I establish a connection to a In Memory H2 database? On my local machine it works flawlessly.

Accepted Solutions (1)

Accepted Solutions (1)

kaisand
Explorer
0 Kudos

You have to use JdbcConnectionPool instead. This way it works.

Class.forName("org.h2.Driver").newInstance()

JdbcConnectionPool cp = JdbcConnectionPool.

create("jdbc:h2:mem:test", "sa", "sa")

Connection conn = cp.getConnection()

Answers (0)