0

My project can connect to the database in the services tab. But when I go to connect to my database through the code, it does not work.

I tried adding Class.forName("org.apache.derby.jdbc.ClientDriver") but it underlines it and can't find it.

I tried adding the Derby client jar to the project, still nothing.

The error:

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

This is a Java Maven project.

I seem to have fixed the issue. So when I tried to add through the library manager setting, it did not work (Finding the derby client and updating).

But when I used the dependencies folder it worked. Can anyone explain please?

asdasd44
  • 1
  • 1
  • _"Can anyone explain please?"_ It depends on exactly what you did. If you _only_ created a new library in Tools > Libraries > Ant Library Manager, then that library will just sit there in NetBeans not being used by any of your projects. You can add a library to a project as a _dependency_ - just like you added the JDBC driver JAR to your project. So maybe that is what happened here - but this is just a guess on my part. – andrewJames Jun 11 '21 at 00:33

0 Answers0