github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/docs/examples/example_osv_java_servlet/src/main/resources/spring/datasource-config.xml (about) 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Application context definition for PetClinic Datasource. 4 --> 5 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" 6 xmlns:context="http://www.springframework.org/schema/context" 7 xmlns:jdbc="http://www.springframework.org/schema/jdbc" 8 xmlns:jee="http://www.springframework.org/schema/jee" 9 xmlns="http://www.springframework.org/schema/beans" 10 xsi:schemaLocation="http://www.springframework.org/schema/beans 11 http://www.springframework.org/schema/beans/spring-beans.xsd 12 http://www.springframework.org/schema/context 13 http://www.springframework.org/schema/context/spring-context.xsd 14 http://www.springframework.org/schema/jdbc 15 http://www.springframework.org/schema/jdbc/spring-jdbc.xsd 16 http://www.springframework.org/schema/jee 17 http://www.springframework.org/schema/jee/spring-jee.xsd"> 18 19 <!-- ========================= DATASOURCE DEFINITION ========================= --> 20 21 <!-- Configurer that replaces ${...} placeholders with values from a properties file --> 22 <!-- (in this case, JDBC-related settings for the dataSource definition below) --> 23 <context:property-placeholder location="classpath:spring/data-access.properties" system-properties-mode="OVERRIDE"/> 24 25 <!-- DataSource configuration for the tomcat jdbc connection pool 26 See here for more details on commons-dbcp versus tomcat-jdbc: 27 http://blog.ippon.fr/2013/03/13/improving-the-performance-of-the-spring-petclinic-sample-application-part-3-of-5/--> 28 <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" 29 p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" 30 p:username="${jdbc.username}" p:password="${jdbc.password}"/> 31 32 <!-- Database initializer. If any of the script fails, the initialization stops. --> 33 <!-- As an alternative, for embedded databases see <jdbc:embedded-database/>. --> 34 <jdbc:initialize-database data-source="dataSource"> 35 <jdbc:script location="${jdbc.initLocation}"/> 36 <jdbc:script location="${jdbc.dataLocation}"/> 37 </jdbc:initialize-database> 38 39 <beans profile="javaee"> 40 <!-- JNDI DataSource for JEE environments --> 41 <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/petclinic"/> 42 </beans> 43 </beans>