1

I'm researching how to set up a Coldfusion 8 (CF) data source that uses Oracle TNS under CentOS. I checked out this Stackoverflow article. But, I'm still having some difficulty. I got a copy of our tnsnames.ora file and put it on the server at /coldfusion/install/folder/TNSNamesFolder/TNSNames.ora. I downloaded the latest Oracle JDBC drivers for 11g, put them in a folder in the class path and restarted CF. I verified that the new JAR files were picked up by viewing the settings summary. The JDBC URL I'm using is:

jdbc:oracle:thin:TNSNamesFile=/coldfusion/install/folder/TNSNamesFolder/TNSNames.ora/TNSNames.ora; TNSServerName=%TNSEntry%

But, I'm getting the following error: The Network Adapter could not establish the connection. Another issue that occurred to me is that if there's another JDBC driver for Oracle in the class path, how do I know what JAR it's in? How do I make sure that these new JDBC drivers are the only ones in use for Oracle?

Community
  • 1
  • 1
HugeBob
  • 467
  • 1
  • 5
  • 14
  • Is that path to the TNSNames file correct? /coldfusion/install/folder/TNSNamesFolder/TNSNames.ora/TNSNames.ora – barnyr Nov 19 '13 at 13:57
  • also, I think the TNSNamesFile syntax may be unique to the macromedia JDBC drivers. Take a look at the accepted answer here for how to do the same thing with the Oracle drivers: http://stackoverflow.com/questions/14194750/java-jdbc-how-to-connect-to-oracle-using-tnsnames-ora – barnyr Nov 19 '13 at 14:02
  • Oh, the path to my tnsnames.ora file was a typo in my post. Just to be sure though, I created an environment variable TNS_ADMIN that contains the path to the TNS file. For good measure I renamed it to tnsnames.ora instead of TNSNames.ora. – HugeBob Nov 19 '13 at 15:09
  • The JDBC URL is now: jdbc:oracle:thin:@MyTNSEntry Still no connection – HugeBob Nov 19 '13 at 15:10
  • I think I'm getting a little closer. I altered the Coldfusion Java JVM settings and included the following under JVM arguments: -Doracle.net.tns_admin=%TNS_ADMIN%. It's now saying it can't resolve the TNS name I supplied in the JDBC URL. – HugeBob Nov 19 '13 at 15:23
  • I was able to get this working using the Macromedia driver with jdbc:macromedia:oracle:TNSNamesFile=%Path_to_tnsnames.ora_file%;TNSServerName=%Selected_TNS_Name% Now, if only I could get the 11g drivers to work. – HugeBob Nov 19 '13 at 15:46

1 Answers1

0

JDBC URL : jdbc:macromedia:oracle:TNSNamesFile=C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\tnsnames.ora;TNSServerName=db9d1.db

Driver Class : oracle.jdbc.OracleDriver

Rikhi Sahu
  • 655
  • 1
  • 7
  • 19