Saturday, March 28, 2009

Hiberate Configuration for Oracle 10g

Oracle Driver Configuration for Hibernate:

Add the following XML file into configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url"> jdbc:oracle:thin:@databaseurl>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>
<property name="connection.pool_size">1</property>
<mapping resource="hibernate.hbm.xml"/>
<mapping resource="hibernate1.hbm.xml"/>
</session-factory>
</hibernate-configuration>