-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Cannot establish connection with Oracle DB
PostPosted: Wed Jun 22, 2005 10:49 pm 
Newbie

Joined: Wed Jun 22, 2005 10:47 pm
Posts: 2
Hi, I am new to NHibernate and I am trying to connect to an Oracle 8i Database. Firstly I should mention I can connect to SQL Server and all goes well.

However trying to establish a connection to Oracle returns:
Quote:
Exception: System.Data.OracleClient.OracleException
Message: ORA-12154: TNS:could not resolve service name


I have tested the DSN through Oracle's ODBC Test and this DSN works fine (can resolve the service name).

My web config looks like this:
Code:
   <nhibernate>
      <add key="hibernate.show_sql" value="true" />
      <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
      <add key="hibernate.dialect" value="NHibernate.Dialect.OracleDialect" />
      <add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleClientDriver" />
      <add key="hibernate.connection.connection_string" value="Data Source=myDsn;User ID=scott;Password=tiger;"/>
   </nhibernate>


I am missing something a newbie would miss?

Any help would be much appreciated.

Thanks
Joe


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 23, 2005 9:20 am 
Newbie

Joined: Wed Jun 15, 2005 11:09 am
Posts: 10
Location: Salem, MA
Is there a reason you are using a DSN? Can you connect with the DSN using "normal" ADO.Net connections?

I'm using a connection string like this to connect to 8i:

Code:
<add key="hibernate.connection.connection_string" value="Server=<SERVER>; UID=scott; PWD=tiger;" />


where <SERVER> should be replaced with whatever you've named the database schema in your tnsname.ora file. I'm no expert, but I think you might be experiencing a problem that is really related to Oracle and .Net in general, not nHibernate specifically.

Colin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 23, 2005 7:41 pm 
Newbie

Joined: Wed Jun 22, 2005 10:47 pm
Posts: 2
It was my fault, gee how about that, I was actually using a DSN as the Data Source. When I changed the "Data Source" value to the tns name it worked.

Thanks for the reply.

Joe


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.