and I am having difficulty in setting up the environment correctly. I have created an OC4J data source (type II driver) and get the following error when I attempt to use it to access my database:
SQLException java.sql.SQLException: ORA-12154: TNS:could not resolve service name
How should I set up my environment to make both Oracle products happy? The 9iAS Containers for J2EE Services Guide suggested that I would need to do the following:
* install the Oracle Client on the same machine on which OC4J is installed
* set the ORACLE_HOME variable
* set LD_LIBRARY_PATH (or the equivalent environment variable for your OS) to $ORACLE_HOME/lib
* set TNS_ADMIN to a valid Oracle administration directory with a valid tnsnames.ora file
I followed these steps (setting ORACLE_HOME to point to the app server and TNS_ADMIN to point to the database client's network/admin directory). I have read conflicting reports about whether ORACLE_HOME should be set at all on a system with multiple Oracle products installed.
Can anyone advise me where I am going wrong? I don't want to give up on this and use the thin driver...
ORA-12154 basically means that the alias you have used to connect to your database is not correct.
Check if the alias used is defined in the tnsnames.ora file. Also, check if SQLNET.ORA file on TNS_ADMIN directory contains NAMES.DEFAULT_DOMAIN parameter defined. If so, try to comment that out.