Hello guys.. Im very new to java. Im using netbeans 7.0 and JDK 1.7.
Im an IT student. My teacher said that we must use only Java DB (don't know why) for our database.
I've already made a program. It will display all the contents of a table. My problem is that, there is no driver. This is the error:
java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver

This is what I put in class.forname:
Class.forName("org.apache.derby.jdbc.ClientDriver");

What should I do? Should I download a driver for this?

Edited 5 Years Ago by Whilliam: n/a

I didn't try downloading and unpacking Derby. I have a folder JavaDB if that helps. THis is all the error.

Aug 14, 2011 3:56:26 PM studinfosystem.StudInfoSystem main
SEVERE: null
java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at studinfosystem.StudInfoSystem.main(StudInfoSystem.java:27)
Exception in thread "main" java.lang.NullPointerException
at studinfosystem.Login.viewTable(Login.java:46)
at studinfosystem.StudInfoSystem.main(StudInfoSystem.java:35)

Where did you get the folder? What does it contain? Also you did not answered my question about adding required library to your project.

JavaDB is the SQL database packaged with JDK 1.6 and 1.7
It's the same database engine as Derby, but slightly differently packaged. You do not need to download any part of Derby to use JavaDB under 1.6 or later; tt is automatically included and installed as part of the JDK.

Under 1.6 and 1.7 you do not need to load the driver yourself. The appropriate driver will be loaded automatically the first time you try to create a Connection.
Just forget about the Class.forName - it's not used any more.

http://download.oracle.com/javadb/10.8.1.2/ref/rrefjdbc32052.html

Edited 5 Years Ago by JamesCherrill: n/a

You did no mention which server you are using for DB in netbeans 7.0 .
I have done a project recently in Netbean 7.0 using MySQL Data base server.
I will prefer you to use it.
Because it is easy to use for the beginers.
plz use it......
If you want to use MY SQL, then you need a My SQL connector for it to use in Netbean.

Edited 5 Years Ago by peter_budo: No reason for bold lettering, no important info to highlight

This article has been dead for over six months. Start a new discussion instead.