• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

read from tnsnames.ora file  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Thanks for replying
I am using apache tomcat 5.0.24.
I am using driver jdbc : oracle:thin @ server : port:sid,username,password

I want the thin driver to read from tnsnames.ora file
To do that the above driver would become
jdbc : oracle:thin@hostString,password where hostString is taken from tnsnames.ora file
But this give me an Io Exception :So Exception was generated.

If instead of "thin" driver i type "oci" .It works fine. But i want to use thin driver.
Please help out.
[ September 15, 2004: Message edited by: Bear Bibeault ]
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I want the thin driver to read from tnsnames.ora file


Can you explain why you want to do it this way? How do you work out which of the entries in tnsnames.ora you actually want to connect to? And what is the exception you see?

The reason why the oci driver might work where the thin driver doesn't is usually because you have not configured TNS properly.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

JDBC thin driver does not use tnsnames.ora to make a connection.
Using a tnsname here instead of the SID is quite an easy error to make. If it is a name in your TNS file, then replace the host string name with the network name of the Oracle server. That should resolve your problem.

Also, to add to this, some extra info with regard to OCI and Thin driver is...

The JDBC OCI driver provides an implementation of the JDBC interfaces using the Oracle Call Interface (OCI).
The JDBC OCI driver requires an Oracle client installation including Net8.

The JDBC Thin driver establishes a direct connection to the database server using Java Sockets.
The JDBC Thin driver does not require Oracle software on the client side; however, there must be an Oracle listener process correctly installed on the Oracle server.

Hope this helps.


Note:
Please donot use Display Name for the Topic, as this will not help anybody to understand what the topic is all about.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!