Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse giving error when adding MySql jdbc driver

Tags:

mysql

eclipse

I am getting below exception

A driver already exists with that name. Please provide a unique driver name.

enter image description here

Anyone tell me what i am doing wrong ?

like image 973
JavaBeigner Avatar asked Dec 25 '22 09:12

JavaBeigner


1 Answers

Please follow: http://www.javahotchocolate.com/tutorials/jdbc.html

A driver already exists with that name. Please provide a unique driver name. ...until you remove the workspace's internal (but wrong) knowledge of that driver. (This process is more complicated than for a "simple" User Library.)

To remove a driver definition so that you can re-add it from scratch to match its actual location on disk:

Close the Build Path dialog.

Open workspace preferences (menu Window -> Preferences).

Expand Data Management by clicking its triangle.

Example Connectivity by clicking its triangle.

Click Driver Definitions.

Click on the offending definition, for the example in this article it would be "MySQL JDBC Driver | MySQL | 5.1" and then click Remove.

Dismiss the preferences dialog by clicking OK.

Return to Build Path in the project for which you need the MySQL JDBC driver and follow the steps to set up a new driver above.

If you experience trouble reaching Build Path, getting a weird error, bounce Eclipse (and return to the same workspace and project). You'll almost surely find that the problem has cleared and you can successfully follow the steps above again.

like image 69
mokter Avatar answered Jan 05 '23 00:01

mokter