• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ReUsing connection properties from hibernate.cfg.xml to properties file in Struts2 Framework

 
sangram nani
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

In my struts2 web-application with Hibernate3.5 ORM, we are using the default hibernate.cfg.xml for all db properties. In the hibernate.cfg.xml file the following properties, I want to use in quartz.properties file @ startup(when the application initializes).

<property name="hibernate.dialect">com.generalsentiment.dialect.MySQL5InnoDB</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>

<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/gsraisin?useUnicode=true&characterEncoding=UTF-8</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">rootAdmin</property>

The reason why i can't hardcode the same in quartz.properties file is because in the production servers we have different properties for different environments. Please suggest me what changes i need to do in order get the properties files these properties at startup.
 
Joe Ess
Bartender
Posts: 9313
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sangram nani wrote:
The reason why i can't hardcode the same in quartz.properties file is because in the production servers we have different properties for different environments.


Why doesn't the hibernate configuration file change with each environment?
Take a look at this discussion on managing different environments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic