-->

To configure your oracle database using the play framework you need to follow the following steps:

  1. Choose the JAR with the drivers according to your oracle’s database version and put in the lib/ directory of your web application
  2. Configure your application.conf file,  located inside the conf/ directory
    • In the JPA Configuration Section you have to choose the JPA (Hibernate) dialect. In my case I was working with oracle10g so i had to insert in the configuration file:
      • jpa.dialect=org.hibernate.dialect.Oracle10gDialect
    • Now you just need to add the following lines, according to your database (including username and password).
      • db.url=jdbc:oracle:thin:@yourdatabaseserver:1521:dbname
        db.driver=oracle.jdbc.driver.OracleDriver
        db.user=yourusername
        db.pass=yourpassword
  3. Now you just need to restart the server. He adds the database drivers automatically to the classpath of the project.
  4. If you want, you can generate Netbeans or Eclipse projects, so you can open this projects with everything configured.

Really easy with no XMLs!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • LinkedIn
  • MySpace
  • Twitter

4 responses


Do you want to comment?

Comments RSS and TrackBack Identifier URI ?

Nice post! I followed the steps in the post and it worked straight away. Thanks!

March 11, 2010 08:59

Thanks for comment.

Yes, it is very easy to set up an oracle db using play.

Thanks again
Hugo

March 11, 2010 09:52


Thanks for the mention.

Good article :)
congratulations.

March 23, 2010 22:08

Comment now!