on 12-14-2022 8:43 AM
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.
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()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.