Skip to content

Commit b617ff2

Browse files
committed
11_15_vds
1 parent 5fa26cb commit b617ff2

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

config/db.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
database.url=jdbc:postgresql://localhost:5432/topjava
2+
database.username=user
3+
database.password=password
4+
database.init=false
5+
jdbc.initLocation=classpath:db/initDB.sql
6+
jpa.showSql=false
7+
hibernate.format_sql=false
8+
hibernate.use_sql_comments=false

src/main/resources/spring/spring-db.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@
3434
p:password="${database.password}"/>
3535
</beans>
3636

37+
<beans profile="postgres">
38+
<context:property-placeholder location="classpath:db/postgres.properties" system-properties-mode="OVERRIDE"/>
39+
</beans>
40+
41+
<beans profile="vds">
42+
<context:property-placeholder location="file:///#{systemEnvironment[TOPJAVA_ROOT]}/config/db.properties" system-properties-mode="OVERRIDE"/>
43+
</beans>
44+
3745
<beans profile="postgres,vds">
46+
3847
<!--
3948
For postgres driver logging
4049
It uses java.util.logging and logged via jul-to-slf4j bridge
@@ -44,8 +53,6 @@
4453
<property name="staticMethod" value="org.slf4j.bridge.SLF4JBridgeHandler.install"/>
4554
</bean>
4655

47-
<context:property-placeholder location="classpath:db/postgres.properties" system-properties-mode="OVERRIDE"/>
48-
4956
<bean id="dataSource"
5057
class="org.apache.tomcat.jdbc.pool.DataSource"
5158
p:driverClassName="org.postgresql.Driver"

0 commit comments

Comments
 (0)