From f1637fc224b491d63c299e9f18c34ff136adbbd5 Mon Sep 17 00:00:00 2001 From: Grant Sherrick Date: Tue, 27 Aug 2019 18:03:24 -0600 Subject: [PATCH] Add fix for JDBC issue by reloading classpath when attaching JVM to thread. --- jaydebeapi/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jaydebeapi/__init__.py b/jaydebeapi/__init__.py index f319cde..dc21895 100644 --- a/jaydebeapi/__init__.py +++ b/jaydebeapi/__init__.py @@ -199,6 +199,7 @@ def _jdbc_connect_jpype(jclassname, url, driver_args, jars, libs): convertStrings=True) if not jpype.isThreadAttachedToJVM(): jpype.attachThreadToJVM() + jpype.java.lang.Thread.currentThread().setContextClassLoader(jpype.java.lang.ClassLoader.getSystemClassLoader()) if _jdbc_name_to_const is None: types = jpype.java.sql.Types types_map = {}