connection Java/MySQL

Hi all, I'm writing my first java program on Ubuntu system.
I installed on Ubuntu system the libmysql-java package, I writed my program and then I compiled it, but I have the following message in running it:

Java Code:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at Primo.main(Primo.java:9)

Re: connection Java/MySQL

1st you have to set classpath.
after classpath
you have to provide the connection
the connection is
String url = "jdbc:mysql://localhost:3306/";
String db = "myDB"; //it is ur database name
Connection con = DriverManager.getConnection(url+db,"root", "mypasswd");