How to set "hibernate.properties" environment specific


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: How to set "hibernate.properties" environment specific

  1. #1
    Join Date
    Aug 2008
    Posts
    36

    How to set "hibernate.properties" environment specific

    Hi All,

    Greetings,

    I would like to know steps for,

    How to configure the "hibernate.properties" specific to environment(dev/stage/prod).

    we are using .properties file for DB connection utility with below props.
    Code:
    hibernate.dialect = org.hibernate.dialect.OracleDialect
    hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
    hibernate.connection.url=jdbc:oracle:thin:@host:port_no:dsn
    hibernate.connection.username=username
    hibernate.connection.password=password
    hibernate.jdbc.batch_size=0
    we are not using hibernate-cfg.xml for DB connection,

    I need to put this for specific to the environment, as of now we are using the "hibernate.properties" for every environment, we used to change the db connection everytime whenever we want to deploy to dev/stage/prod envs which is causing issue with other developers, if they are not aware of usage of this process.

    Iam using Tomcat server and deploying the war file in to it.

    Please let me know your ideas on this.

    Thanks,

  2. #2
    Join Date
    Aug 2008
    Posts
    36
    Any help is appreciated...!!!

  3. #3
    Join Date
    Aug 2008
    Posts
    36
    if it is not the correct place to put this question please let me point to the correct place...

  4. #4
    Join Date
    Aug 2008
    Posts
    36
    Today when i was googling found a link http://galaxy.andromda.org/forum/vie...f9ecbc4fa95e64 which has some info on it. I was trying with this it could resolve the issue.

    i.e. Adding the properties to CATALINA_OPTS and export like below..
    -Dhibernate.dialect=org.hibernate.dialect.HSQLDialect

  5. #5
    Join Date
    Aug 2008
    Posts
    36
    The above mentioned process is working like chome....

Similar Threads

  1. Replies: 4
    Last Post: 10-19-2006, 12:21 PM
  2. Unable to set environment vars in j2ee
    By kshama in forum Java
    Replies: 0
    Last Post: 04-03-2003, 12:54 PM
  3. Replies: 0
    Last Post: 06-19-2001, 01:06 PM
  4. Replies: 1
    Last Post: 12-23-2000, 08:42 AM
  5. How to generate Make Files?
    By aMax in forum Java
    Replies: 2
    Last Post: 08-04-2000, 05:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center