python access to TimesTen

后端 未结 5 1755
旧时难觅i
旧时难觅i 2021-01-14 20:17

I googled a lot to find any python module to access TimesTen (in memory database). I am writing a automated testing framework (more like for System Test and not Unit Test).

5条回答
  •  渐次进展
    2021-01-14 20:52

    @ScalableDBDoug, would you mind providing the python code snippet? I tried using cx_Oracle in python script but was getting error message:

    cx_Oracle.DatabaseError: ORA-12547: TNS:lost contact
    

    Here is my code snippet:

    
    import cx_Oracle
    
    dsn_tns = cx_Oracle.makedsn('TTSERVER',TTPORT,service_name='TTSERVICE');
    print(dsn_tns)
    connection = cx_Oracle.connect('USER', 'PASS', dsn_tns)
    
    cursor = connection.cursor()
    cursor.execute("""SELECT * FROM MYTABLE""")
    for record in cursor:
        print("Values:", record)
    

    As a workaround I'm using UnixODBC and pyodbc to query the timesten database for now, But would like to use the native cx_Oracle module to access timesten.

    Thanks,

提交回复
热议问题