I'm trying to connect to a database using Derby in Java (using NetBeans), bIt i keep getting this error when I try to create a new database:
An error occurred while crating the database java.lang.ClassNotFoundException; org.apache.derby.jdbc.ClientDriver.
I've tried using Derby 10.16.1.1 and Derby 10.14.2.1.
The error message you are seeing suggests that the class org.apache.derby.jdbc.ClientDriver
is not being found by the class loader at runtime. This class is necessary for connecting to a Derby
database. There are few possible causes:
There is a comprehensive derby documentation where you can find more info and step-by-step guide.
In order to add org.apache.derby.jdbc.ClientDriver
to your class path you can do few things, depending on your development environment:
Maven
or Gradle
, you can add the JAR file as a dependency in your project's pom.xml
file or build.gradle
file. You can read more about that approach here and here/lib/derby-jdbc.jar
, the command would be:java -cp /lib/derby-jdbc.jar YourMainClass
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.