Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <context-param>
  2. <param-name>spring.profiles.active</param-name>
  3. <param-value>test, dev, prod</param-value>
  4. </context-param>
  5.  
  6. > ls src/main/webapp/resources/properties/
  7. application-dev.properties application-prod.properties application-test.properties
  8.  
  9. jdbc.driverClassName=org.postgresql.Driver
  10. jdbc.url=jdbc:postgresql://localhost:5432/galapagos
  11. jdbc.username=foo
  12. jdbc.password=
  13.  
  14. <?xml version="1.0" encoding="UTF-8"?>
  15. <beans:beans xmlns="http://www.springframework.org/schema/mvc"
  16. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
  17. xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  18. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  19. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  20. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  21. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
  22.  
  23. ....
  24.  
  25. <!-- Database / JDBC -->
  26.  
  27. <beans:bean
  28. class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  29. <beans:property name="location" value="resources/properties/application.properties" />
  30. </beans:bean>
  31.  
  32. <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  33. <beans:property name="driverClassName" value="${jdbc.driverClassName}" />
  34. <beans:property name="url" value="${jdbc.url}" />
  35. <beans:property name="username" value="${jdbc.username}" />
  36. <beans:property name="password" value="${jdbc.password}" />
  37. </beans:bean>
  38.  
  39. ....
  40.  
  41. </beans:beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement