How to resolve TNS error in Oracle when using an ODBC DSN I have come across this error when I was trying to insert data from front end (using JSP) to back end (Oracle 10g):

java.sql.SQLException: [Oracle][ODBC][Ora]ORA-12154:
                       TNS:could not resolve the connect identifier specified


Steps followed:


went to Microsoft ODBC
User DSN
Enter DNS ,TNS SERVICE NAME, USERID
When I click on "Test connection", the result was "Connection Successfull"


When I run my frontend JSP which has a text box and a button, I get the error mentioned above when I click on the button.
Make sure that your tns files (tnsnames.ora, sqlnet.ora) are in a certain directory that is readable by all users.  for example &quot;/oracle/network/admin/&quot;
Make sure that all your users and processes that need to work with the database[s] have the environt variable TNS_ADMIN defined with the value &quot;/oracle/network/admin/&quot;.
Doing so gives a good chance that all processes look to the same configuration.