Hi im new to java DB(derby).I installed java db recently.I have set the classpath to derby.jar and derbytools.jar ,which has to be done for driver loading.
here's the sample code i tried with java DB
but i'm getting a error asCode:package test;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author SRIDARSHAN
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
// TODO code application logic here
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
try {
Connection con = DriverManager.getConnection("jdbc:derby:testDB", "test", "test");
System.out.println("success");
} catch (SQLException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
help needed here fellas :(Code:Jun 26, 2010 11:12:15 AM test.Main main
SEVERE: null
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at test.Main.main(Main.java:22)

