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:
- The Derby JDBC driver is not in the class path of your project or application.
- The version of JDBC driver JAR file isn’t the correct version for the version of Derby you are using. Please, check versions.
There is a comprehensive Derby documentation where you can find more information and step-by-step guides.
In order to add org.apache.derby.jdbc.ClientDriver
to your class path, you can do few things, depending on your development environment:
If you're using an IDE like NetBeans, you can add the JAR file to the project's build path by IDE UI, for example, the answers to this question explains how to do so.
If you're building your project with a build tool like 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
If you're running your project from the command line, you can add the JAR file to the classpath by specifying it as a command-line argument when running your project's main class. For example, if the jar file is located in /lib/derby-jdbc.jar
, the command would be:
java -cp /lib/derby-jdbc.jar YourMainClass