-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: show_sql value to be set dynamically based on environment
PostPosted: Thu Sep 16, 2010 4:04 pm 
Newbie

Joined: Wed Sep 15, 2010 10:53 am
Posts: 7
Hi,

In our application we have used spring,struts,hibernate. I have requirement show_Sql value to be set concern config xml dynamically based on environments.please help me how can i resolve this.

i am trying to do with PropertyPlaceholder from spring. some how its not working for me...please help me....
applicationContext.xml
----------------------
<bean id="ApplicationProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>/WEB-INF/ShowSql.properties</value>
</property>
</bean>


dao_configuration.xml
---------------------

<bean id="sftPubAppSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" scope="singleton">
<property name="dataSource"><ref bean="sftPubDataSource"/></property>
<property name="configLocation">
<value>com/citigroup/rel/persistservice/contact/sft.hibernate.cfg.xml</value>
</property>

<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.datasource">jdbc/e-servicing/PUB</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.show_sql">${HIBERNATE_SHOW_SQL}</prop>
<prop key="max_fetch_depth">1</prop>
<prop key="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</prop>
</props>
</property>
</bean>

finally its not taking any values. if it is resolvedn then i have to look for environment based things.

thanks
jayaram


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.