Skip to content

Python module: cx_Oracle is oracledb now #335

Open
@aliensmily

Description

@aliensmily

Hi,

cx_Oracle (https://oracle.github.io/python-cx_Oracle/) is oracledb (https://oracle.github.io/python-oracledb/) now.

Please consider to support both or to upgrade the modules to oracledb.

Something like that:

try:
  import oracledb as connect_ora
except ImportError:
  oracledb_exists = False
  try:
    import cx_Oracle as connect_ora
  except ImportError:
    cx_oracle_exists = False
  else:
    cx_oracle_exists = True
else:
  oracledb_exists = True
  cx_oracle_exists = False

for using it as "sqlplus / as sysdba" we have done somthing like that:

if oracledb_exists:
	connect_ora.init_oracle_client()
	conn = connect_ora.connect(mode=connect_ora.AUTH_MODE_SYSDBA)
elif not oracledb_exists and cx_oracle_exists:    
	conn = connect_ora.connect('/', mode=connect_ora.SYSDBA)

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions