baztian / jaydebeapi

JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.
GNU Lesser General Public License v3.0
366 stars 148 forks source link

Connection issue #71

Open leedsrising opened 6 years ago

leedsrising commented 6 years ago

conn = jaydebeapi.connect(jclassname="com.teradata.presto.jdbc42.Driver", url="verified driver url",driver_args=[username, password], jars="/path/to/presto-jdbc42-1.0.14.1022.jar", libs=[]).

A colleague of mine has the same document formatting, same anaconda, python, and java versions as myself, but the above connection works for him (with the only change being the user directory correctly changed, everything else is mirrored) but I receive the error

jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class com.teradata.presto.jdbc42.Driver not found

leedsrising commented 6 years ago

Only solution I have found is completely uninstalling Python, Pip, and Anaconda, and then reinstalling just Anaconda. Working theory is that as a result of using python and pip independent installers in addition to the anaconda installer before, I created some problem with my environment variables that prevented the jar file from being found.

weihanhua commented 5 years ago

Have you solve the problem? Can you list your solution procedures?

joerobmunoz commented 4 years ago

This is old, but hopefully this helps someone else. It's possible that you should be passing your jdbc jar path to the libs arg, not the jars. This solved my filepath issues.