Skip to content

Instantly share code, notes, and snippets.

@Kuassim
Last active March 27, 2019 22:48
Show Gist options
  • Save Kuassim/a3de7af2aaa9cb72e4b109e52a4f8fae to your computer and use it in GitHub Desktop.
Save Kuassim/a3de7af2aaa9cb72e4b109e52a4f8fae to your computer and use it in GitHub Desktop.
/*
* Setting TNS_ADMIN to point to the locatioon of the tnsnames.ora file and/or the
* property files (e.g., ojdbc.properties, new with DB18c)
* by default $ORACLE_HOME/network/admin but you must explicly set its value
*
*
*
* option 1 -- non-intrusive
*/
java -Doracle.net.tns_admin=<location of tnsnames.ora>
/*
* option 2 -- intrusive
*/
System.setProperty("oracle.net.tns_admin", <location of tnsnames.ora>);
/*
* option 3 -- intrusive, in JDBC URL (requires DB18c or later)
*/
jdbc:oracle:thin:@<alias>?TNS_ADMIN=<location of tnsnames.ora>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment