I pretend to build a java application with a derby database embedded. However, I can’t establish a connection with my database. After following some tutorials I found on Internet, I ended up adding this code to my main method.
String dbms = "jdbc:derby:database;create=true";
String uName = "admin";
String uPass= "pass";
Connection con = DriverManager.getConnection(dbms, uName, uPass);
But I get the following error: "No suitable driver found for jdbc:derby...."
Strange is that if I use a not embedded connection like this:
String dbms = "jdbc:derby://localhost:1527/database";
The connection works. Am i missing some file on libraries or something, in a tutorial i found it was saying to add the “derbyclient.jar” to the libraries of the project, but still not working!
If you’re using the embedded version of Derby then the
derbyclient.jarisn’t enough. You’ll need to include the fullderby.jarlibrary.