3.jdbc.properties
8.0之前的driver
#driver=com.mysql.jdbc.Driver
8.0之后的driver
driver=com.mysql.cj.jdbc.Driver
#mytest为我本地的数据库名
url=jdbc:mysql://localhost:3306/maven-ssm-demo?serverTimezone=UTC
数据库用户名
username=root
数据库的密码
password=admin
定义初始连接数
initialSize=1
定义最大连接数
maxActive=20
定义最大空闲
maxIdle=20
定义最小空闲
minIdle=1
定义最长等待时间
maxWait=60000
4.log4j.properties
#日志输出级别
log4j.rootLogger=debug,stdout,D,E
#设置stdout的日志输出控制台
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#输出日志到控制台的方式,默认为System.out
log4j.appender.stdout.Target = System.out
#设置使用灵活布局
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#灵活定义输出格式
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} -[%p] method:[%c (%rms)] - %m%n
5.spring-mvc.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns=“http://www.springframework.org/schema/beans”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:context=“http://www.springframework.org/schema/context”
xmlns:mvc=“http://www.springframework.org/schema/mvc”
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/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package=“com.sjsq”/>
mvc:annotation-driven/
mvc:default-servlet-handler/