在这里,使三个框架能很好的搭配起来,最主要的就是要能够做好配置文件。下面直接粘贴我们的配置文件
applicationContext.xml
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
com.bookorder.table
新建的db.properties文件
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc\:mysql\://localhost\:3306/bookorder?characterEncoding\=UTF-8
db.username=root
db.password=950210