DNS and TNS Names in JDBC | Java JDBC Tutorial
This Java JDBC Tutorial “DNS and TNS Names” post is providing the information about importance of DNS names in Sun driver loading process and TNS names in Oracle Driver loading process.
Setting DSN :
- Stands for Data Source Name.
- DSN settings mandatory for JDBC-ODBC-Bridge driver.
- DSN is an alias name to work with specified ODBC among available.
How to set DSN name:
- Open Control panel
- Select Administrative Tools
- Click on Data Sources(ODBC)
- Click on SystemDSN tab on the window
- Click on Add button.
- Choose Microsoft ODBC for Oracle.
- Click on Finish
- Give DSN name in Data Source Name column.
- Click on ok
- Now u can work with type1 driver.
- Stands for Transparent Network Substrate.
- We need to set classpath to work with Oracle driver
- Set the classpath for below string in system environment variables area.
Finding TNS name in the System:
- Open C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN.
- Open tnsnames.ora file using text editor.
- Check the SERVICE_NAME that is your TNS name