an java.sql.SQLException: No suitable driver found for jdbc:h2:tcp://localhost/~/ZadatakDB is thrown when I try to connect to h2 database using a java web application.
The JDBC driver for the H2 database is not in the classpath, or the driver is is unloaded. Use this to load the driver class:
Class.forName("org.h2.Driver");
For a maven project ensure that <scope>
of com.h2database
dependency is not set to test
. I removed the scope completely for my dependency and the issue was resolved.