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
365 stars 148 forks source link

"'_jpype.PyJPField' object has no attribute 'getStaticAttribute'" #120

Closed renankaic closed 5 years ago

renankaic commented 5 years ago

Hi.

I'm trying to use Jaydebeapi to connect with a Tibero Database (used in my actual job) but I am getting the following exception:

"'_jpype.PyJPField' object has no attribute 'getStaticAttribute'"

I read in the issue #99 to switch to JPype version 0.6.3 but this version of JPype doesn't support the "com.tmax.tibero.jdbc.TbDriver". If I switch to 0.6.3 I get the following message:

"java.lang.RuntimeException: Class com.tmax.tibero.jdbc.TbDriver not found"

Please, what should I do? I didn't find anything in my searches.

renankaic commented 5 years ago

Hi.

I managed to solve the problem using the following code with JPype 0.6.3:

conn = jaydebeapi.connect(
                jclassname="com.tmax.tibero.jdbc.TbDriver",
                url="jdbc:tibero:thin:@localhost:1521:mydb",
                driver_args=["user","pass"],
                jars="/path/to/tibero6-jdbc.jar"
)