I am trying to connect to my on premise Oracle database using oracledb library in AWS glue.
import oracledb
connection = oracledb.connect(user="my user", password="mypass",
host="myhostname", port=1521, service_name="db")
print('Connection success!')
cursor = connection.cursor()
for row in cursor.execute("select * from table"):
print(row)
cursor.close()
connection.close()
This is just a test script which works in visual studio. But does not work in AWS glue. Maybe should I try using AWS Glue python shell job instead?
Error Category: UNCLASSIFIED_ERROR; OperationalError: DPY-6005: cannot connect to database (CONNECTION_ID=AgdbWkV1V/WY16Icr8DckQ==).
Wasn’t the whole point of using python-oracledb being able to use thin mode connection by default so that we would not run into errors like using cx_Oracle which used thick mode and relies on Oracle client libraries.