SQLException: No suitable driver found for jdbc:derby://localhost:1527

Viewed 147701

I get this error in Netbeans:

java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/

How is this caused and how can I solve it?

19 Answers

Encountered the same problem. I was doing something like:

connect 'jdbc:derby://localhost:1527/~/databases/db1'

Replacing the path with the absolute path fixed this problem:

connect 'jdbc:derby://localhost:1527//Users/ayush99/databases/db1'.

In summary: Avoid using ~ or any such variables in the path of existing database.

Had the same, and it was solved by running with the classpath defining the derby.jar location.

java -cp <path-to-derby.jar> <Program>

To be more precise:

java -cp "lib/*:." Program

Where :. includes the current directory. And the lib/* does not include the jar extension (lib/*.jar).

I used the above answers and nothing worked. What worked for me was to put the dependencies into the project, like its said above.

Then go in the dependencies folder, right click on the dependencies derbyshared.jar and derbyclient.jar and "add local sources". Connect the two dependencies with the local jar files in your derby folder and its done. Maybe only a Netbeans problem

Related