import cx_Oracle
conn = cx_Oracle.connect('yb_ya/**@10.254.254.:1521/yaybdb',encoding="UTF-8")
cursor = conn.cursor()
cursor.execute('select * from ac01 where rownum <= 5')
result = cursor.fetchall()
print (cursor.rowcount)
for row in result:
print(row) #此处特别注意前面空格
cursor.close()
conn.close()