mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
Switched to embedded db
This commit is contained in:
parent
737d478752
commit
ef838ad656
2 changed files with 5 additions and 19 deletions
|
@ -16,16 +16,9 @@
|
|||
|
||||
<tx:annotation-driven/>
|
||||
|
||||
<!-- DataSource configuration for Apache Commons DBCP. -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
|
||||
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
|
||||
p:username="${jdbc.username}" p:password="${jdbc.password}"/>
|
||||
|
||||
<!-- Database initializer. If any of the script fails, the initialization stops. -->
|
||||
<!-- As an alternative, for embedded databases see <jdbc:embedded-database/>. -->
|
||||
<jdbc:initialize-database data-source="dataSource">
|
||||
<jdbc:embedded-database id="dataSource">
|
||||
<jdbc:script location="${jdbc.initLocation}"/>
|
||||
<jdbc:script location="${jdbc.dataLocation}"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
|
|
|
@ -14,17 +14,10 @@
|
|||
|
||||
<tx:annotation-driven />
|
||||
|
||||
<!-- DataSource configuration for Apache Commons DBCP. -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
|
||||
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
|
||||
p:username="${jdbc.username}" p:password="${jdbc.password}"/>
|
||||
|
||||
<!-- Database initializer. If any of the script fails, the initialization stops. -->
|
||||
<!-- As an alternative, for embedded databases see <jdbc:embedded-database/>. -->
|
||||
<jdbc:initialize-database data-source="dataSource">
|
||||
<jdbc:embedded-database id="dataSource">
|
||||
<jdbc:script location="${jdbc.initLocation}"/>
|
||||
<jdbc:script location="${jdbc.dataLocation}"/>
|
||||
</jdbc:initialize-database>
|
||||
</jdbc:embedded-database>
|
||||
|
||||
<!-- Note: the specific "jpaAdapter" bean sits in adapter context file -->
|
||||
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
|
||||
|
|
Loading…
Reference in a new issue