http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIDIJCE
This allows you to store your database server details in an external tnsnames.ora file, which you then reference from the JDBC connection URL.
To use this with a Weblogic Server DataSource, try the following:
- Create a tnsnames.ora file with the required connection details and store it in a file that is accessible to the WLS instance:
TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testserver)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test.au.oracle.com)
)
) - Edit the setDomainEnv script for your domain and add the following System property
-Doracle.net.tns_admin=<PATH_TO_TNS_NAMES_FILE>
- Create a DataSource and specify the connection URL to use the TNS names entry:
<name>basic</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@TEST</url>
<driver-name>oracle.jdbc.xa.client.OracleXADataSource</driver-name>
<properties>
<property>
<name>user</name>
<value>banker</value>
</property>
</properties>
<password-encrypted>{AES}fOJ/qlGxQjpdSiPODvxxilPHy/VuQe8yXggSSh1Lw4c=</password-encrypted>
</jdbc-driver-params>
oracle.net.tns_admin
property.
1 comment:
We've tried this, but when we specify a target (server), we still get an error, saying you have to provide a host.
James
Post a Comment