Hello,
I'm a ColdFusion 8 (CF) developer trying to form a TNS connection to Oracle 11g. The CF service runs on a CentOS5 server. Here are the steps I've taken:
- Added -Doracle.net.tns_admin=/folder1/folder2/folder3/OracleTNS argument in my list of JVM arguments
- Placed the tnsnames.ora file in the folder referenced by the oracle.net.tns_admin setting
- Placed the ojdbc6.11.2.0.4.jar in the classpath, restarted CF and verified that CF detected and loaded it
- Implemented JDBC URL: jdbc:oracle:thin:@MyTNS.DB
- Driver class used: oracle.jdbc.OracleDriver
When I attempt the connection, I got the error:
Invalid connection string format, a valid format is: "host:port:sid". The root cause was that: java.sql.SQLRecoverableException: IO Error: Invalid connection string format, a valid format is: "host:port:sid"
I tested another driver that came with CF: the Macromedia driver. To get TNS to work with it, I used the following JDBC URL:
jdbc:macromedia:oracle:TNSNamesFile=/folder1/folder2/folder3/OracleTNS/tnsnames.ora;TNSServerName=MyTNS.DB
This connection worked! This demonstrates, at least, that the tnsnames.ora file is OK. So, my trouble seems to be working with the latest 11g driver ojdbc6.11.2.0.4.jar and the proper JDBC URL. I would just use the Macromedia driver. But, it's very old and I'd rather use the updated driver. If anyone has any ideas on what further steps I could make, please chime in.
Thanks