Skip to content

Commit

Permalink
Merge pull request #3 from informatici/OP-65_To_externalize_applicati…
Browse files Browse the repository at this point in the history
…on_context

Op 65 to externalize application context
  • Loading branch information
mwithi authored Apr 29, 2019
2 parents eaee670 + d471d33 commit 27f36b8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 77 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,4 @@
</snapshots>
</repository>
</repositories>
</project>
</project>
68 changes: 0 additions & 68 deletions rsc/applicationContext.properties

This file was deleted.

23 changes: 15 additions & 8 deletions rsc/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@

<!-- <bean class ="org.isf.utils.EntityManagerFactoryBean" id = "entityManagerFactory"> -->
<!-- </bean> -->

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>file:rsc/database.properties</value>
</property>
<property name="ignoreResourceNotFound" value="true"/>
</bean>

<bean id="springDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/oh" />
<property name="user" value="isf" />
<property name="password" value="isf123" />
<property name="driverClass" value="${jdbc.class:com.mysql.jdbc.Driver}" />
<property name="jdbcUrl" value="${jdbc.url:jdbc:mysql://localhost:3306/oh}" />
<property name="user" value="${jdbc.username:isf}" />
<property name="password" value="${jdbc.password:isf123}" />

<!-- these are C3P0 properties -->
<property name="acquireIncrement" value="1" />
Expand All @@ -51,9 +58,9 @@
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql:false}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql:true}</prop>
<prop key="hibernate.dialect">${hibernate.dialect:org.hibernate.dialect.MySQLDialect}</prop>
</props>
</property>
</bean>
Expand All @@ -65,4 +72,4 @@

<aop:aspectj-autoproxy proxy-target-class="true" />

</beans>
</beans>
3 changes: 3 additions & 0 deletions rsc/database.properties.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jdbc.url=jdbc:mysql://localhost:3306/oh
jdbc.username=isf
jdbc.password=isf123

0 comments on commit 27f36b8

Please sign in to comment.