RSS

NHibernate configuration for Oracle

22 Jun

Our team developing environment is a bit outdated. We’re using vs2005 with Oracle 8i client. The data provider is Microsoft’s System.Data.OracleClient. Here is a simple workable NHibernate configuration. For those applications developed using ODP.NET, simply replace the connection.driver_class setting like the sample below.

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.Oracle8iDialect</property>
    <!--Using ADO.NET System.Data.OracleClient driver-->
    <property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
    <!--Using ODP.NET driver-->
    <!--<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>-->
    <property name="connection.connection_string">Data Source=XXXX;User ID=XXXX;Password=XXXX;Unicode=True</property>
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>

Reference:Nhibernate with Microsoft System.Data.OracleClient

Advertisements
 
Leave a comment

Posted by on June 22, 2012 in .NET, ADO.NET, NHibernate, Oracle, ORM

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: