You can translate the question and the replies:

Error connecting to Denodo from Python (JDBC)

Followed the instructions given in the below link to connect to Denodo from Python using JDBC driver. Getting below error while connecting to Denodo. This happenes while executing connection (cnxn) string. Is there and issue with arguments ? Is **jars** keyword in python ? Could you pls advise on this asap ? ***TypeError: function takes at most 1 non-keyword argument*** ``` import jaydebeapi as dbdriver import csv,pyodbc as dbdriver,pyodbc,pandas as pd from socket import gethostname from datetime import datetime from socket import gethostname denodoserver_name = "11..10.." denodoserver_jdbc_port = "9999" denodoserver_database = "****" denodoserver_uid = "****" denodoserver_pwd = "****" denododriver_path = "C:\\Virtual DataPort Administration Tool of Denodo Platform-8.0\\tools\\client-drivers\\jdbc\\denodo-vdp-jdbcdriver.jar" denodo_class_path = "com.denodo.vdp.jdbc.Driver" client_hostname = gethostname() useragent = "%s-%s" % (dbdriver.__name__,client_hostname) conn_uri="jdbc:denodo://%s:%s/%s?userAgent=%s"%(denodoserver_name, denodoserver_jdbc_port, denodoserver_database, useragent) **cnxn = dbdriver.connect( "com.denodo.vdp.jdbc.Driver",conn_uri,driver_args = {"user": denodoserver_uid,"password": denodoserver_pwd}, jars=denododriver_path)** query = "select * from bv_dimdate" df_dqlserver = pd.read_sql(query, con = cnxn) ```
11-03-2023 03:52:11 -0500

1 Answer

Hi, As per my understanding, You are trying to connect from Python to Denodo using the **jaydebeapi** library and **Denodo JDBC driver**. For Denodo JDBC connections, whether it’s from Python or any other client-tools, the URL format is always like *jdbc:vdb://<hostname>:<port>/<database>*. Based on the code snippet you shared, you should update the value of your variable **conn_uri** from “jdbc:**denodo**://….” to “jdbc:**vdb**://….” You should be able to successfully establish the connection with the corrected syntax. In the same [article]( you’ve shared, check out the other ways to connect to Denodo using other Python libraries. Hope this helps!
Denodo Team
13-03-2023 23:00:36 -0400
You must sign in to add an answer. If you do not have an account, you can register here