Connector can't choose Driver.
Posted by: Adam Komisarek
Date: August 23, 2005 12:45PM

I've read tons of forums. But it still dont work for me. I want to run very simply application which connect to database. In NetBeans it works fine (i add mysql-connector-....jar to project properties). But in console it dont work at all. I add mysql... in CLASSPATH (normal version not debug) or either i tried to run application with command:
java -cp .;c:\mysql\mysql-connector-java-3.1.10-bin.jar Program
It didnt work too.


public User() {
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();

} catch (Exception ex) {
System.out.println("Dont work.");
}
}

The exception is always catched.
I have 2 version of Java environment. One was installed by browser (Runtime environemt has java in version 1.5) and SDK was installed by my. Normally by typing java this newer version runs. Maybe here is the problem? What should i do?
Thank in advance! :)

Options: ReplyQuote


Subject
Written By
Posted
Connector can't choose Driver.
August 23, 2005 12:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.