import cx_Oracle as oracle db = oracle.connect('blsdm/BLS_admin01@blsprod01.c2dlljmccmd3.ap-southeast-1.rds.amazonaws.com:1521/orcl') cursor = db.cursor() cursor.execute('select sysdate from dual') data = cursor.fetchone() print('Database time:%s' % data) cursor.close() db.close()