• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL Question for Dummies

 
James Eman
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not a the most and advanced user for java or mysql. I'm trying to create a database or my program to submit data from a series of questions but ever time I try some way of connecting to my database. Heres my code and the error follows.



Error
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
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:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at Test.main(Test.java:14)
at __SHELL5.run(__SHELL5.java:6)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at bluej.runtime.ExecServer$3.run(ExecServer.java:725)
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to download the MySQL JDBC driver (which is a jar file) and put it in the classpath of any application that wants to access MySQL. You can find the driver somewhere around here: https://dev.mysql.com/downloads/connector/j/
 
James Eman
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Says its loaded
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not familiar with BlueJ. Does that screenshot show the compile time classpath, or the runtime classpath? Or are are they the same in BlueJ?
 
James Eman
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe there the same in bluej
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic