Connecting to the Database
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
To retrieve connection information from an Oracle tnsnames.ora file with the Oracle driver, you must inform the driver which tnsnames.ora file (using the TNSNamesFile property) and Oracle service name entry (using the TNSServerName property) to use so that the driver can reference the correct connection information. For example, the following connection URL in a Java string:
jdbc:datadirect:oracle:TNSNamesFile=c:\\oracle\\NETWORK\\
ADMIN\\tnsnames.ora;TNSServerName=FITZGERALD.SALES
specifies the path and file name of the tnsnames.ora file
(TNSNamesFile=c:\\oracle\\NETWORK\\ADMIN\\tnsnames.ora) and the net service
name entry (TNSServerName=FITZGERALD.SALES) to use for the connection.
TNSNamesFile=c:\\oracle\\NETWORK\\ ADMIN\\tnsnames.oraIf using tnsnames.ora files with a Security Manager on a Java Platform, read permission must be granted to the tnsnames.ora file. See Granting Access to an Oracle tnsnames.ora File for an example.