How to use DNS listener to retrieve the tnsname.ora automatically in my connection string?

How to use DNS listener to retrieve the tnsname.ora automatically in my connection string?
I am using the below code with ODBC connection.

SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));
uid=myUsername;pwd=myPassword;

However i dont want to enter manually everytime i need to give my tool to anyone,it should pick the server details automatically using DNS Listener.
Could you help me with the code?

0 answers