Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16714

Trying to connect to Oracle SQL on AWS using Python

$
0
0

I'm trying to connect to Oracle SQL on AWS using Python. I have cx_Oracle installed, ORacle Instant Client path set, and can't seem to figure out the host and service_name. I've checked some past posts, googled, and can't seem to find it. Sorry if this is obvious, thank you for your time

Python Script:

import cx_Oracleusername = 'Think I have this one done'password = 'assuming this is just the password'host = 'is this the endpoint?'port = 'This one is figured out'service_name = 'is this the endpoint?'dsn = cx_Oracle.makedsn(host, port, service_name=service_name)connection = cx_Oracle.connect(username, password, dsn)cursor = connection.cursor()query = "SELECT * FROM your_table"cursor.execute(query)for row in cursor:    print(row)cursor.close()connection.close()

I've tried Google, checking tutorials, looking through stack overflow and other resources.


Viewing all articles
Browse latest Browse all 16714

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>