I\'ve followed the JDBC tutorial at: http://docs.oracle.com/javase/tutorial/jdbc/basics/gettingstarted.html, and managed to build and create my own JDBC database without too
java.sql.SQLException: No suitable driver found for jdbc:derby:db directory
So your error can be caused by:
Driver is not loaded correctly or your URL
is malformed. So at first you need to ensure that your *.jar
is in classpath. Check it out.
Also try to change your URL
to:
jdbc:derby://<path>/<databasename>;create=true
create=true
will ensure that db will be created if does not exist.
Look at this thead also: SQLException: No suitable driver found for jdbc:derby://localhost:1527
If you have this type of error
java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
and you are using netbeans
then you have to follow these steps: