No suitable driver found for jdbc:h2:tcp

后端 未结 2 1717
执念已碎
执念已碎 2021-01-19 14:11

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.

2条回答
  •  温柔的废话
    2021-01-19 14:35

    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");
    

提交回复
热议问题