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. https://community.denodo.com/kb/en/view/document/How%20to%20connect%20to%20Denodo%20from%20Python%20-%20a%20starter%20for%20Data%20Scientists?category=Northbound%20Connections 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) ```
user
11-03-2023 03:52:11 -0500
code

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](https://community.denodo.com/kb/en/view/document/How%20to%20connect%20to%20Denodo%20from%20Python%20-%20a%20starter%20for%20Data%20Scientists?category=Northbound%20Connections) 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
code
You must sign in to add an answer. If you do not have an account, you can register here