Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Standalone RCP application needs to 'add' arbitrary 3rd-party JDBC driver jars to classpath
Standalone RCP application needs to 'add' arbitrary 3rd-party JDBC driver jars to classpath [message #528219] Mon, 19 April 2010 13:48 Go to next message
Eclipse UserFriend
I am building a standalone RCP application and I need to be
able to add arbitrary 3rd-party JDBC drivers to the applications'
classpath.

I know that OSGi in general frowns on this, but the reality is I
can't go around making bundles of every frigging JDBC driver jar
in existence.

At runtime I can display a wizard that navigates to the wherever the jar (or jars) are - but how do I get them 'added' to the classpath?

Thanks in advance,
Mike Norman
Re: Standalone RCP application needs to 'add' arbitrary 3rd-party JDBC driver jars to classpath [message #528235 is a reply to message #528219] Mon, 19 April 2010 14:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mike,

does this solve it? http://snippets.dzone.com/posts/show/3574

--

Best Regards,
Wim Jongman
-- Error: Keyboard not attached. Press F1 to continue.
(Eclipse Old Skool Quote Service)

> I am building a standalone RCP application and I need to be
> able to add arbitrary 3rd-party JDBC drivers to the applications'
> classpath.
>
> I know that OSGi in general frowns on this, but the reality is I
> can't go around making bundles of every frigging JDBC driver jar
> in existence.
>
> At runtime I can display a wizard that navigates to the wherever the jar
(or jars) are - but how do I get them 'added' to the classpath?
>
> Thanks in advance,
> Mike Norman
Re: Standalone RCP application needs to 'add' arbitrary 3rd-party JDBC driver jars to classpath [message #528516 is a reply to message #528219] Tue, 20 April 2010 14:52 Go to previous messageGo to next message
Eclipse UserFriend
It might be worth checking out how the Datatools Project [1] handles
loading JDBC drivers for their use (they had to overcome the same problem).

You can add them to the application or framework classpath [2]
(sidestepping OSGi completely). But that's an install time thing.
Wim's suggestion will work as long as everybody that actually needs to
work with those classes can "see" the new class loader.

You can also make an OSGi bundle on the fly that points to the jars on
the deployed system. $external$ can be used to specify that
Bundle-ClassPath entry is an absolute path from the filesystem instead
of a relative path in the bundle. Then you install the bundle (this
sounds like a lot of work :-)

Later,
PW

[1] http://www.eclipse.org/datatools/

[2]
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/reference/misc/runtime-options.html

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: Standalone RCP application needs to 'add' arbitrary 3rd-party JDBC driver jars to classpath [message #528544 is a reply to message #528516] Tue, 20 April 2010 17:31 Go to previous messageGo to next message
Eclipse UserFriend
FWIW, the BIRT guys are also pulling drivers in dynamically.

--

Best Regards,
Wim Jongman
-- Computers make very fast, very accurate mistakes.
(Eclipse Old Skool Quote Service)

> It might be worth checking out how the Datatools Project [1] handles
> loading JDBC drivers for their use (they had to overcome the same problem).
>
> You can add them to the application or framework classpath [2]
> (sidestepping OSGi completely). But that's an install time thing.
> Wim's suggestion will work as long as everybody that actually needs to
> work with those classes can "see" the new class loader.
>
> You can also make an OSGi bundle on the fly that points to the jars on
> the deployed system. $external$ can be used to specify that
> Bundle-ClassPath entry is an absolute path from the filesystem instead
> of a relative path in the bundle. Then you install the bundle (this
> sounds like a lot of work :-)
>
> Later,
> PW
>
> [1] http://www.eclipse.org/datatools/
>
> [2]
>
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/reference/misc/runtime-options.html
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
>
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: Standalone RCP application needs to 'add' arbitrary 3rd-party JDBC driver jars to classpath [message #528777 is a reply to message #528544] Wed, 21 April 2010 13:50 Go to previous message
Eclipse UserFriend
Hmm, I was hoping for some sort of simple 3-step solution ... which in hindsight is kinda silly as nothing in OSGi is a) simple and b) only 3 steps.

I'll see what the Datatools project is doing; another plugin
(Zigen's DbViewer) is also somehow getting external driver jars to work.
Previous Topic:loading SWT on MacOS10.6
Next Topic:Custom backing store for Preferences? to XML file perhaps?
Goto Forum:
  


Current Time: Tue Jun 17 04:45:31 EDT 2025

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

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

Back to the top