All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jporm-test-base-db-script.5.2.0.source-code.spring-context-h2.xml Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context.xsd
           http://www.springframework.org/schema/aop 
           http://www.springframework.org/schema/aop/spring-aop.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx.xsd
           http://www.springframework.org/schema/jdbc 
           http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">

 
    <!-- BEGIN - H2 DIRECT DATASOURCE IMPLEMENTATION -->
    
    <bean id="h2TransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" lazy-init="true">
		<property name="dataSource" ref="h2DataSource"/>
	</bean>
	
    <bean id="h2DataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" lazy-init="true">
        <property name="driverClassName" value="${h2.jdbc.driverClassName}"/>
        <property name="url" value="${h2.jdbc.url}"/>
        <property name="username" value="${h2.jdbc.username}"/>
        <property name="password" value="${h2.jdbc.password}"/>
        <property name="defaultAutoCommit" value="false"/>
    </bean>
    
    <jdbc:initialize-database data-source="h2DataSource" >
		<jdbc:script location="classpath:/sql/h2_create_db.sql" />
	</jdbc:initialize-database>
	
    <!-- END - H2 DIRECT DATASOURCE IMPLEMENTATION -->
    
</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy