I'm trying to connect to a Postgres DB using a the redshift-fake-driver (https://github.com/opt-tech/redshift-fake-driver) within my python code. However I can't get the driver to load.
I'm running the python code within a docker container based on the rappdw/docker-java-python image
import jpype
import os
import inspect
import jaydebeapi
jar = r'/drivers/redshift-fake-driver_2.12-1.0.10.jar'
args='-Djava.class.path=%s' % jar
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, '-ea', args)
conn = jaydebeapi.connect('jp.ne.opt.redshiftfake.postgres.FakePostgresqlDriver',"localhost", "airflow","airflow")
curs = conn.cursor()
Current i'm getting this exception:
File "/test.py", line 12, in <module>
"loclahost", "airflow","airflow")
File "/usr/local/lib/python3.6/site-packages/jaydebeapi/__init__.py", line 381, in connect
jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
File "/usr/local/lib/python3.6/site-packages/jaydebeapi/__init__.py", line 190, in _jdbc_connect_jpype
jpype.JClass(jclassname)
File "/usr/local/lib/python3.6/site-packages/jpype/_jclass.py", line 73, in JClass
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class jp.ne.opt.redshiftfake.postgres.FakePostgresqlDriver not found