Issue1925
Created on 2012-06-15.18:10:06 by tcrawley, last changed 2018-03-17.06:01:52 by jeff.allen.
msg7227 (view) |
Author: Toby Crawley (tcrawley) |
Date: 2012-06-15.18:10:05 |
|
The attached patch adds support for creating JDBC connections for driver classes that aren't
available from the system classloader but are available in the sys classloader.
The problem: java.sql.DriverManager won't create connections for drivers that aren't loaded
in the system classloader, making it difficult to load driver classes dynamically.
A common solution is to use a delegating driver class that can handle the dynamic driver, as
described here: http://www.kfu.com/~nsayer/Java/dyn-jdbc.html
This patch works around that, and saves the user from using the delegation approach. It
modifies zxJDBC.connect to first attempt to use DriverManager.getConnection with a fallback
to instantiate the driver and call connect() directly. It also attempts to load the driver
class in the system state classloader instead of the system classloader.
The patch has a null check around Py.getSystemState().getClassLoader(), but will that ever
be null? I'm new to the jython codebase, so the state of that classloader is unclear to me.
|
msg7383 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-08-10.21:27:34 |
|
Thanks for the patch Toby, I will try to have a look after the 2.5.3 final cycle.
|
msg9049 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-09-26.06:04:20 |
|
Likely goes away as a problem with the adoption of jyjdbc to replace zxJDBC, since that will be using Jython's class loader
|
msg11815 (view) |
Author: Jeff Allen (jeff.allen) |
Date: 2018-03-17.06:01:52 |
|
Anybody know if this is still an issue (assuming only 2.7 is supported)?
|
|
Date |
User |
Action |
Args |
2018-03-17 06:01:52 | jeff.allen | set | nosy:
+ jeff.allen messages:
+ msg11815 |
2014-09-26 06:04:20 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg9049 |
2013-02-20 00:32:42 | fwierzbicki | set | versions:
+ Jython 2.7, - 2.7a2 |
2013-02-15 19:45:35 | amak | set | nosy:
+ amak |
2012-08-10 21:27:34 | fwierzbicki | set | messages:
+ msg7383 |
2012-06-28 18:42:08 | fwierzbicki | set | priority: normal assignee: fwierzbicki |
2012-06-15 18:26:57 | fwierzbicki | set | nosy:
+ fwierzbicki |
2012-06-15 18:10:06 | tcrawley | create | |
|