Wednesday, February 24, 2010

Maven 2, Hibernate & Oracle 10g

For those who follow the official Hibernate tutorial and wish to change the Database from the HSQLDB to Oracle 10g, then looks further no-more.

Here is a snapshot of my local directory:



Install the Oracle JDBC driver to your local Maven 2 repository.... with the following command

mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle.jdbc -DartifactId=ojdbc14 -Dversion=10.2.0.1.0 -Dpackaging=jar -DgeneratePom=true


Note that you need to have the ojdbc14.jar in the current directory where you issue the mvn install:install-file command or you can specify the path.

The next step would be to include the new Oracle JDBC in your pom.xml....by adding the following




And the last part, will be to update the Hibernate properties/configuration file, in this case, it is the hibernate.cfg.xml......





And then run a couple of DB updates, then you can see the results for yourself....





No comments:

Post a Comment

Followers