The spring configuration file is the/web-inf/application.xml file from the last Web. XML Load Spring container

Source: Internet
Author: User

<?xml version= "1.0" encoding= "UTF-8"?>
<beans xmlns= "Http://www.springframework.org/schema/beans"
xmlns:context= "Http://www.springframework.org/schema/context"
xmlns:aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xmlns:p= "http://www.springframework.org/schema/p"
Xsi:schemalocation= "Http://www.springframework.org/schema/beans
Http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
Http://www.springframework.org/schema/context
Http://www.springframework.org/schema/context/spring-context-3.0.xsd
Http://www.springframework.org/schema/aop
Http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">

<!--turn on auto-scan beans--
<context:component-scan base-package= "Com.lovo"/>

<!--enable AOP annotation Support--
<aop:aspectj-autoproxy/>

<!--configuration Data source (C3P0)--
<bean id= "DataSource" class= "Com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method= "Close" >
<!--specified database driver
<property name= "Driverclass" value= "Com.mysql.jdbc.Driver"/>
<!--Specify the database URL--
<property name= "Jdbcurl" value= "jdbc:mysql://localhost:3306/cbd_db"/>
<!--Specify database user name--
<property name= "User" value= "root"/>
<!--Specify a database password--
<property name= "Password" value= "root"/>

<!--Specify the maximum number of connections to the connection pool-
<property name= "maxpoolsize" value= "/>"
<!--Specify the connection pool minimum connection number--
<property name= "Minpoolsize" value= "1"/>
<!--Specify the number of connection pool connections initialized (default 3)-
<property name= "Initialpoolsize" value= "2"/>
<!--Specify the connection pool connection timeout time--
<property name= "maxidletime" value= "/>"
<!--Specify the number of connections created when the connection pool is exhausted--
<property name= "Acquireincrement" value= "2"/>
<!--Specifies the connection pool when the thread interval is detected---
<property name= "idleconnectiontestperiod" value= "/>"
</bean>

<!--configuring JDBC Transaction Management--
<bean id= "TransactionManager" class= "Org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<property name= "DataSource" ref= "DataSource"/>
</bean>

<!--configuration Sqlsessionfactory--
<bean id= "Sqlsessionfactory" class= "Org.mybatis.spring.SqlSessionFactoryBean" >
<property name= "DataSource" ref= "DataSource"/>
<property name= "Typealiasespackage" value= "com.lovo.entity"/>
</bean>

<!--Configure mapper scan mode, all mapper inherit Sqlmapper interface--
<bean class= "Org.mybatis.spring.mapper.MapperScannerConfigurer" >
<property name= "Basepackage" value= "Com.lovo.mapper"/>
<property name= "Markerinterface" value= "Com.lovo.mapper.SqlMapper"/>
</bean>

</beans>

The spring configuration file is the/web-inf/application.xml file from the last Web. XML Load Spring container

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.