[jdbc] Fix librdbms problem when CLASSPATH variable not defined in environment
@@ -19,6 +19,8 @@ import logging
import os
import sys
+from notebook.conf import DBPROXY_EXTRA_CLASSPATH
+
LOG = logging.getLogger(__name__)
@@ -51,7 +53,11 @@ class Jdbc():
if 'py4j' not in sys.modules:
raise Exception('Required py4j module is not imported.')
- self.gateway = JavaGateway.launch_gateway(classpath=os.environ['CLASSPATH'])
+ classpath = os.environ.get('CLASSPATH', '')
+ if DBPROXY_EXTRA_CLASSPATH.get():
+ classpath = '%s:%s' % (DBPROXY_EXTRA_CLASSPATH.get(), classpath)
+
+ self.gateway = JavaGateway.launch_gateway(classpath=classpath)
self.jdbc_driver = driver_name
self.db_url = url
