log4j.properties 的配置
log4j.rootLogger=DEBUG,stdout
log4j.logger.org.mybatis=DEBUG
#stdoutis
set to be aConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#stdoutusesPatternLayout.
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p
%d %C: %m%n
mybatis-config.xml的配置
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<typeAliases>
<type="com.elife.demo.pojo.Role" alias="role" />
</typeAliases>
数据库 -->
<environments default="development">
<environment id="development">
<transactionManager type="JDBC">
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/test" />
<property name="username"
value="root" />
<property name="password"
value="123456" />
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="com/elife/demo/mapper/RoleMapper.xml" />
</mappers>
</configuration>
jdk 动态代理 el表达式 token