简体   繁体   中英

how to configure intellij idea to use oracle tnsnames

Our company uses hundreds of DBs, and I have tnsnames.ora file. I can use this file SqlDeveloper, but this product is a huge pain to use. However the same pain is to create connection in intellij idea by rewriting from this tnsnames.ora. Is there some human-friendly way, to use tnsnames.ora from intellij idea?

I can see, that in datasources tabs there is possibility to set connection type to tns, but it does not work. The documentation [1] explains:

TNS: to use tnsnames.ora configuration file. In TNSADMIN field, specify a path to the folder with tnsnames.ora. In TNS name, specify what service name to use (see a value of net_service_name in tnsnames.ora) if you have more than one service.

tnsnames.ora is in my home directory, I set tnsadmin to my home directory and I also tried to set it to specific file, but no luck. The error is "could not resolve connect identifier", but it's not a user error (IIUC), because setting the same in oracle sql developer connects me just fine.

[1] https://www.jetbrains.com/help/idea/2019.3/connecting-to-a-database.html?utm_campaign=IU&utm_medium=link&utm_source=product&utm_content=2019.3

"could not resolve connect identifier" means that the alias you set in TNS name could not be found and translated to its full form, probably because the tnsnames.ora could no be found.

TNSADMIN should point to the directory containing tnsnames.ora and not to the file itself, try creating another directory instead of using your home directory, and use the full path.

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