I was wondering if someone could give me some instructions on how to do the following:
- How to add mysql connection JAR file to the Eclipse plugin build path
- How to add the connector JAR file as library and adding to the plugin's runtime classpath
I am getting com.mysql.jdbc.Driver exception when trying to load the Driver class using Class.forName("com.mysql.jdbc.Driver")
. I have added the jdbc driver to the project by right clicking on the project name and selecting add Library button. But I found out there for eclipse rcp project there is a different way of adding the jdbc jar file.
Do use
DynamicImport-Package: *
in the MANIFEST.MF of the jar-plugin having mysql.jar as Runtime classpath. It helpsClass.forName("com.mysql.jdbc.Driver")
importing wanted packages.i also faced the problem & i think this link could help and solve the problem this link explains the solution in detail
I've never used mysql with Eclipse, but i've done this with postgres sql. Maybe this will help you:
Add your jdbc driver jar to the bundle classpath (every RCP plugin is a OSGi bundle). To do it you can edit META-INF/MANIFEST.MF directly or use manifest editor provided by PDE (classpath section under Runtime tap).
In general, you should never edit plugin projects classpath directly.
run "PDE Tools / Update classpath";
the mysql jar must in the project lib dir.
in project "Java build path", select the mysql jar in lib dir of the project.