简体   繁体   中英

How do I add Derby Client to a Java project?

I am building an app in Java, using Eclipse and Derby as DataBase. I have aready added Derby Client to my project and everything goes perfect.

My problem is that when I run my app from the CMD or comand line; I get the error message: Not suitable driver found for jdbc:derby://localhost:1527/...

How can this be solved?

Thanks before hand!

  1. Firstly, just to make sure you already have Derby jdbc driver in your classpath. You can check for its versions and download here

  2. Secondly, when you run your app from CMD, make sure you specify the classpath which should include your Derby jdbc driver. You can follow the guide here which mentioned:

You have two options:

1.include all jar files from the lib directory into the manifest (you can use relative paths there)

2.Specify everything (including your jar) on the commandline using -cp: java -cp MyJar.jar:lib/* com.somepackage.subpackage.Main

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM