I'm able to use the thin client to connect to the db, but can't figure out the syntax for connecting using TNS. Our db group here has put the TNS files onto a common server, and instucted us to us the TNS name only. It works ok using Toad, and when I write C# programs I don't have a problem. Does anyone know how to connect his way? Thanks, Steve
have at look at the Oracle9i JDBC Developer's Guide and Reference - Opening a Connection for the JDBC OCI Driver. Specifically it says: "For the JDBC OCI driver, you can specify the database by a TNSNAMES entry. You can find the available TNSNAMES entries listed in the file tnsnames.ora on the client computer from which you are connecting. On Windows NT, this file is located in the [ORACLE_HOME]\NETWORK\ADMIN directory. On UNIX systems, you can find it in the /var/opt/oracle directory. For example, if you want to connect to the database on host myhost as user scott with password tiger that has a TNSNAMES entry of MyHostString, enter: Connection conn = DriverManager.getConnection ("jdbcracleci:@MyHostString", "scott", "tiger");
Note that both the ":" and "@" characters are necessary." Jamie [ January 06, 2004: Message edited by: Jamie Robertson ]
Joined: Feb 12, 2003
I'm pretty sure (with 8i at least) that you can't use a name server with the thin driver. That driver was designed for use with Applets, where a name server wouldn't make sense.