Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » connect mysql
connect mysql [message #464112] Sun, 25 February 2007 00:27 Go to next message
Eclipse UserFriend
hi everyone:
when i connect mysql from RCP. it couldn't find the connector class.
Class.forName("org.gjt.mm.mysql.Driver"),there,it throws an exception.
how could i get it. i had the jar:Mysql-connector-java-5.04-bin.jar.
and will i add it to "JRE System Library" or "Plug-in Dependencies".
or are there other ways to connect it?
appreciate your help:)
Re: connect mysql [message #464114 is a reply to message #464112] Sun, 25 February 2007 10:56 Go to previous messageGo to next message
Eclipse UserFriend
tiger ha scritto:
> hi everyone:
> when i connect mysql from RCP. it couldn't find the connector class.
> Class.forName("org.gjt.mm.mysql.Driver"),there,it throws an exception.
> how could i get it. i had the jar:Mysql-connector-java-5.04-bin.jar. and
> will i add it to "JRE System Library" or "Plug-in Dependencies".
> or are there other ways to connect it?
> appreciate your help:)
>
Hi,
I am using MySQL 5.0 with eclipse 3.2.0 and the
mysql-connector-java-3.1.13 is in the classpath (see my answer to
'Connect to MySql 5.0' in eclipse.dtp Forum).

Hope that helps
Riccardo Cattania
www.riccardocattania.net
Re: connect mysql [message #464115 is a reply to message #464112] Sun, 25 February 2007 17:08 Go to previous messageGo to next message
Eclipse UserFriend
The way I have set it up is the following: I built a plugin from a
number of jars hat I needed (including mysql connector) and then made my
RCP app use that additional plugin. To build a plugin from your jar(s),
simply follow the File ->New -> Other... -> Plugin Development ->
Plug-in from existing Jar archives.

Hope this helps,
Ali.



tiger wrote:
> hi everyone:
> when i connect mysql from RCP. it couldn't find the connector class.
> Class.forName("org.gjt.mm.mysql.Driver"),there,it throws an exception.
> how could i get it. i had the jar:Mysql-connector-java-5.04-bin.jar. and
> will i add it to "JRE System Library" or "Plug-in Dependencies".
> or are there other ways to connect it?
> appreciate your help:)
>
Re: connect mysql [message #464122 is a reply to message #464112] Mon, 26 February 2007 04:33 Go to previous message
Eclipse UserFriend
Originally posted by: hkaest.mro.man.de

"tiger" wrote:
> when i connect mysql from RCP. it couldn't find the connector class.
> Class.forName("org.gjt.mm.mysql.Driver"),there,it throws an exception.
> how could i get it. i had the jar:Mysql-connector-java-5.04-bin.jar. and
> will i add it to "JRE System Library" or "Plug-in Dependencies".
> or are there other ways to connect it?
> appreciate your help:)

The ways are listed in:

http://wiki.eclipse.org/index.php/FAQ_How_do_I_add_a_library _to_the_classpath_of_a_plug-in%3F

1. The JAR can be added to the boot classpath. But I didn't find out how to
do that. Somebody knows?
2. The JAR can be added to the declared libraries for a plug-in. This was
easy by copy the jar into the plugin and declaring it in the plugin.xml. Is
this the right way?
3. A new wrapper plug-in can be created. Usefull when you want to use the
library in other plugins too.
4. The OSGi parent loader can be changed. I didn't managed #1 => I
didn't tried.
5. Use your own UrlClassLoader together with your own DriverManager,
because the java.sql.DriverManager doesn't work with the UrlClassLoader (the
solution i found in Squirrel). That's what i did because i want to change
driver and jar dynamically at runtime.

--harald
Previous Topic:Editors
Next Topic:How to run the Eclipse in Japanese language?
Goto Forum:
  


Current Time: Mon Mar 17 14:59:23 EDT 2025

Powered by FUDForum. Page generated in 0.02451 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top