简体   繁体   中英

connecting to oracle timesten via cx_oracle in sqlalchemy

I can connect to oracle via cx_Oracle in sqlalchemy by this connection string:

connection_string = 'oracle+cx_oracle://user:pass@127.0.0.1/orcl'

and also i can connect TimesTen by cx_Oracle using this:

con = cx_Oracle.connect('user/pass@127.0.0.1/tt2:timestendirect')

but i don't know how to connect to TimesTen via cx_Oracle in sqlalchemy?

You should be able to create an entry in the TNSNAMES.ora configuration file and then use that directly. If you are using the instant client, you can set the environment variable TNS_ADMIN to point to a directory of your choosing that contains the tnsnames.ora configuration file.

https://docs.oracle.com/cd/E18283_01/timesten.112/e13066/oci.htm#BABHAAHJ

The easy connect syntax does not appear to be supported by sqlalchemy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM