Home > front end >  Connecting to oracle error using jaydebeapi
Connecting to oracle error using jaydebeapi

Time:04-28

Trying to connect to oracle data base using jaydebeapi. My connection string:

conn = jaydebeapi.connect('oracle.jdbc.driver.OracleDriver', ['jdbc:oracle:thin:username/pass@hostname:port/servicename'],
['username’,’pass'], 'C:/Program Files/Java/ojdbc8.jar')

But I'm getting an error:

TypeError: No matching overloads found for *static* java.sql.DriverManager.getConnection(list,str), options are:
    public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String,java.util.Properties) throws java.sql.SQLException
    public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String,java.lang.String,java.lang.String) throws java.sql.SQLException
    public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String) throws java.sql.SQLException

I tried to connect to that db using cx_Oracle and it connects fine. What's can be wrong with connection string? Or it can be oracle driver error?

CodePudding user response:

From the docs:

The second argument is a string with the JDBC connection URL.

Your second argument is a list, not a string. That's what the error message is complaining about. Try:

conn = jaydebeapi.connect('oracle.jdbc.driver.OracleDriver', \
  'jdbc:oracle:thin:username/pass@hostname:port/servicename', \
  ['username','pass'], 'C:/Program Files/Java/ojdbc8.jar')

CodePudding user response:

Got error quotes in username\pass list ['username’,’pass']. Working fine with ['username','pass']

  • Related