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

jaydebeapi.connect getting TypeError: No matching overloads found for *static* java.sql.DriverManager.getConnection(str,str) #241

Open mjphuang opened 7 months ago

mjphuang commented 7 months ago

A simple connecting test jaydebeapi to connect to Oracle DB using z/OS python. The codes: import jaydebeapi
import jpype
driver_class = "oracle.jdbc.driver.OracleDriver"
driver_file = "/webs/usr/lib/ojdbc8/ojdbc8.jar"
jpype.addClassPath('/webs/usr/lib/ojdbc8/*')
jpype.startJVM()

conn=jaydebeapi.connect('oracle.jdbc.driver.OracleDriver', \
'jdbc:oracle:thin:xxxxxxxxx/yyyyyyyyyyyy@\
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=twst6gvhldp-scan.tdc.vzwcorp.com)(PORT=2051)) \
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = swerfff)))', \
'/webs/usr/lib/ojdbc8/ojdbc8.jar')
conn.close()

The error: Traceback (most recent call last):
File "/webs/tech/py/testJDBC.py", line 31, in
File "/webs/pyVenv/venv/lib/python3.11/site-packages/jaydebeapi/init.py", line 412, in connect
jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
File "/webs/pyVenv/venv/lib/python3.11/site-packages/jaydebeapi/init.py", line 230, in _jdbc_connect_jpype
return jpype.java.sql.DriverManager.getConnection(url, dargs)
¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
TypeError: No matching overloads found for
static* java.sql.DriverManager.getConnection(str,str), options are:
.public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String) throws java.sql.SQLException
.public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String,java.lang.String,java.lang.String) throws j .public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String,java.util.Properties) throws java.sql.SQLEx