Using pure TNSNAMES rather than host-based database connections in Oracle JDeveloper -


i'm using oracle jdeveloper 11.1.1.4.0, , can create database connections (with type of oracle (jdbc)) using thin driver without problems long i'm specifying host.

for instance, can connect locally-running oracle xe database specifying:

driver: thin host name: localhost jdbc port: 1521 service name: xe 

for connecting remote databases, use tns, , tnsnames.ora file set below, mydatabase.example.com oracle service identifier want use.

mydatabase.example.com=   (description=     (address=       (protocol=tcp)       (host=testdb.example.com)       (port=1234)     )     (connect_data=       (service_name=mydatabase.example.com)     )   ) 

connections mydatabase.example.com service work sql developer, sql plus, tnsping etc. machine can't find way of specifying in jdeveloper database connection without being forced specify host.

the reason don't want specify host same reason we're using tns in first place - testdb.example.com host change on time, mydatabase.example.com tns service identifier not.

if specify host testdb.example.com along correct tns alias, connection works. if specify wrong identifier, fails - it's aware of contents of tnsnames.ora file.

posts this one seem suggest if jdeveloper aware of tns_admin, use tnsnames.ora, using "enter custom jdbc url" doesn't work, using string like:

jdbc:oracle:thin:mydatabase.example.com 

it still gives "please enter valid value host name" error.

does know how create database connection in jdeveloper without specifying host?

according oracle jdbc developer's guide, need specify location of tnsnames.ora file through (jvm) system property in order able use tnsnames thin driver:

http://download.oracle.com/docs/cd/b28359_01/java.111/b31224/urls.htm#beidijce

you need start sql developer in such way system property oracle.net.tns_admin defined.

adding

addvmoption -doracle.net.tns_admin=/path/to/tnsnames.ora

to ide.conf should trick (although have not tried it).


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -