Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mjphuang opened this issue Mar 9, 2024 · 0 comments

Comments

@mjphuang
Copy link

mjphuang commented Mar 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant