Unable to establish jdbc connection - from jep

Bug #1779285 reported by Aravind S
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python DBAPI Compliance Tests
New
Undecided
Unassigned

Bug Description

Hello Team,

I'm trying to create a jdbc connection to monetdb using jaydebeapi as follows.

import jaydebeapi

def __getConnection__(username, password):
  conn = jaydebeapi.connect(jclassname='nl.cwi.monetdb.jdbc.MonetDriver',url='jdbc:monetdb://localhost:50000/altairba',driver_args=[<username>,<password>],jars=[<driver_path>])

  print(conn)
  return conn

jdbc = __getConnection__(<uname>,<pwd>)

When I run this piece of code in python environment, it works! I could see a connection obj created
<jaydebeapi.Connection object at 0x000000000EA41C50>

But when I try to invoke this function from JAVA environment using 'Jep'(Jep embeds CPython in Java through JNI ) i'm seeing the following error

jep.JepException: <class 'RuntimeError'>: Unable to start JVM at native\common\jp_env.cpp:78
 at E:\Installation\Anaconda\lib\site-packages\jpype\_core.startJVM(_core.py:50)
 at E:\Installation\Anaconda\lib\site-packages\jaydebeapi\__init__._jdbc_connect_jpype(__init__.py:176)
 at E:\Installation\Anaconda\lib\site-packages\jaydebeapi\__init__.connect(__init__.py:381)
 at E:\Installation\Anaconda\lib\site-packages\caDB\__init__.__getDatasourceConnection__(__init__.py:867)
 at E:\Installation\Anaconda\lib\site-packages\caDB\__init__.connect_ca(__init__.py:814)
 at <string>.multiplier(<string>:4)
 at <string>.<module>(<string>:1)
 at jep.Jep.eval(Native Method)
 at jep.Jep.eval(Jep.java:609)
 at com.altair.ba.advancedscript.BAPythonEngine.execFormula(BAPythonEngine.java:127)
 at com.altair.ba.advancedscript.BAPythonEngine.execScript(BAPythonEngine.java:64)
 at com.altair.ba.advancedscript.BAAdvancedScriptService$3.run(BAAdvancedScriptService.java:193)
 at java.lang.Thread.run(Thread.java:745)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)

Please let me know, how to sort this out.

Thanks,
Aravind

Aravind S (aravndr)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.