Using Hibernate AND letting the user select the JDBC-Driver? [message #448971] |
Mon, 08 May 2006 04:43  |
Eclipse User |
|
|
|
Originally posted by: eclipse.lokahl.de
Hi,
I would like to use Hibernate in my RCP-app.
I'm using the wrapper approach (i.e. having seperate wrapper-plugins for
hibernate-jars and the JDBC-driver) that's proposed by several sources
(e.g. the hibernate homepage: http://hibernate.org/311.html).
Now, instead of supplying a load of available db-drivers in my
db-wrapper-plugin I would like to let the user specify all the params my
app should use to get a db connection - including the jar-file
containing the db-driver.
The problem I'm facing is that I don't know how to introduce these
user-defined jar-files to the Hibernate(!)-classloader at runtime, which
is used when I'm calling buildSessionFactory().
Has anyone figured out a solution for this and would share the
information? I would really need some help on this one...
Regards,
T^2
|
|
|
Re: Using Hibernate AND letting the user select the JDBC-Driver? [message #449086 is a reply to message #448971] |
Wed, 10 May 2006 07:26  |
Eclipse User |
|
|
|
An intriguing question.
You may find that the equinox forum is a better one to ask this, becuase you'd be getting down and dirty with the low-level stuff. I expect that the answer is 'no', or at least, 'no, not easily'.
The 'right' way to do it would probably involve:
1) Defining your hibernate plugin to be buddy-compliant
2) Importing the Jar, creating a bundle on the fly (another jar with minimal manifest.mf etc.) that is buddy-registered with the hibernate plugin
3) Importing the bundle into Eclipse dynamically using the OSGi layer's loading mechanism and start it
If you want to know more about the buddy loading, have a butch at http://www.eclipsezone.com/articles/eclipse-vms/
The other stuff -- installing a plugin dynamically -- occurs during the update manager code, so you might want to see how that does it.
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.03727 seconds