java - How to connect to Mysql through Eclipse RCP -


I am trying to connect to mysql database through a RCP project. I downloaded the MySQL Jconnect file. Set the classpath variable described in the extracted document in a folder, but still I can not connect to MySQL. I am getting this error

  SQLException: jdbc: mysql: // localhost: 3306 / test SQLState: 08001 vendor error: 0  

for any I did not find suitable driver then I tried to add mysql-connected jar file as an external jar file in the project, but no luck. Tried to add it as a user library, nothing happened.

Finally I created the "Plugin Project from the current Jar File" option and used the mysql-connect as a jar file. Then in my RCP project I added this plugin as a dependency plugin, yet the same result

I'm pretty sure the code, error is in the classpath. How do I solve it?

OS: Ubuntu 10.04

Mysql Version: 5.2.1

My configs are:

Eclips: 3.5

I tried to put a file in the / usr / bin directory, which does not work either ...

is not a complete answer, but it is mentioned:

After checking everything again, I found that mysql configuration on the second computer After hearing that, (almost) all the fees To do the right thing

PS but anyway, Reading is not a suitable driver, it is difficult to guess, that the driver has been found, but failed to connect It is probably not a path or classpath problem, but a mysql configuration problem.


In fact, the OP confirms that it was a classpath problem:

This thing worked in the end. I have copied the mysql-connect jar file to the project folder and added it to the Runtime column of plugin.xml file .


Comments