Java SQL error, no suitable driver found

寵の児 提交于 2019-12-08 14:12:31
Roman C

Not sure the problem with the database URL connection, but in the usage of the correct driver. If the database is embedded you should use the driver commented in your post and example from my answer, there's also tutorial embedded derby.

if not then use

Class.forName("org.apache.derby.jdbc.ClientDriver");

It's a different driver to connect to the database running standalone. In this case see derby network client documentation how to configure and run derby network client.

Make sure derbyrun.jar is in your classpath. It resides in the db/lib directory of your JDK.

Doing a quick search on Maven and Derby, included the following in my pom:

<dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derbyclient</artifactId>
    <version>10.10.2.0</version>
</dependency>

and everything worked afterwards, so it may be a library reference issue if the previous solution did not work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!