pom.xml 文件
mysql 配置文件 jdbc.properties
jdbc_driverClassName=com.mysql.jdbc.Driver
jdbc_url=jdbc:mysql://******:3306/new_schema?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
jdbc_username=****
jdbc_password=****
配置application.xml 文件用于注入service , mapper, dao , 以及serviceImpl 实现方法添加事物回滚
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-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/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
mybatis-config.xml
mongodb 配置文件 mongodb.properties
mongo.dbname = *****
mongo.username =
mongo.password =
mongo.host = *****
mongo.port= 27017
mongo.connectionsPerHost= 8
mongo.threadsAllowedToBlockForConnectionMultiplier= 4
mongo.connectTimeout= 1500
mongo.maxWaitTime= 1500
mongo.autoConnectRetry= true
mongo.socketKeepAlive= true
mongo.socketTimeout=1500
mongo.slaveOk=true
mongdb xml配置 spring-mongodb.xml
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:mongo="http://www.springframework.org/schema/data/mongo" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
connect-timeout="1500" max-wait-time="1500"
socket-keep-alive="true" socket-timeout="1500" />
配置文件结构预览
web.xml