Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] External JDBC driver

Hello, All!

I've tried to use the JDBC Driver, that is loaded from the lib/ext directory of the JRE from the plugin and found interesting results: if I understand class loading in Eclipse correctly, it is impossible to use the JDBC driver that is not bundled with the plugin, but placed in the lib/ext or loaded with -classpath runtime parameter.

The reason is java.sql.DriverManager takes into account only registered java.sql.Driver's that were loaded with the caller's class loader. So when I'm trying to connect to the database from the plugin, DriverManager complains that driver could not be found (because it could not be loaded with the plugin bundle class loader)!

Of course, this could be solved by placing the driver library into the my bundle or some other plugin my plugin depends on, but this makes fixed dependency on the driver library.

So the question is, how to solve such a situation?

There will be no problem, if I understand problem corretly, if the system class loader would be the parent of all plugins bundle class loaders, so another question is: why this is not the case?


Back to the top