Re: Java Mysql Driver Error
That looks right... Have you even installed mysql??
Re: Java Mysql Driver Error
Quote:
Originally Posted by System_Error
That looks right... Have you even installed mysql??
It's not that he didn't install but I beleive the problem is in the IDE he's using
Re: Java Mysql Driver Error
I have installed MySql already. I didn't use any Java IDE. I use Notepad and compile and run it in DOS Prompt.
Re: Java Mysql Driver Error
Try explicitly tellling the JVM which to use:
java -Djdbc.drivers=com.mysql.jdbc.Driver YourJavaProgram
or something like that.
You could also do this:
Class.forName("com.mysql.jdbc.Driver").newInstance();
PS: Good job on writing and compiling the real way ;)
Re: Java Mysql Driver Error
Code:
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/test?user=procopio&password=alibi");
} catch (Exception ex) {
ex.printStackTrace();
}
Works fine with me. You should check the classpath variable for the runtime to locate the class com.mysql.jdbc.Driver.
Please see, http://vbforums.com/showthread.php?t...ight=classpath