3

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.

1
  • 1
    just change the data source details. Commented Feb 25, 2013 at 10:41

2 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.