Hi I have a small java project and am using hibernate with it. Now I would like to change the database to oracle, what changes would I have to do in configuration file to make it possible.
2 Answers
In you hibernate.cfg.xml, you should have a dialect defined. The line looks like this:
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
change it to this:
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
Also change the database connection parameters in the same file.
Comments
Modify these properties. In hibernate.cfg.xml
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">your_new_password</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@loalhost:xe</property>
<property name="hibernate.connection.username">user_name</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>