- 项目结构(所需jar包,配置文件)
- sqlMapConfig.xml的配置内容如下:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE PUBLIC "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- <settings> <!-- <setting <!-- <setting <!-- <setting </settings> <typeAliases> <!-- 自定义别名: type:要定义别名的数据类型 alias:别名的内容 --> <!-- 非自定义别名: 在jdk中的所用的类的别名直接只用类名即可(不区分大小写) 如果是基本数据类型的包装类还可以使用基本数据类型的名字 --> <typeAlias <typeAlias </typeAliases> <!-- <environments <environment <transactionManager <dataSource <property <property <property <property </dataSource> </environment> </environments> <!-- <mappers> <mapper <mapper <mapper <mapper <mapper </mappers> </configuration> |
- sqlMapGenerator.xml的配置如下:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE <generatorConfiguration> <!-- <classPathEntry <!-- <context <commentGenerator> <!-- <property </commentGenerator> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/mybatis" userId="root" password="123456"/> <!-- <javaModelGenerator targetProject="mybatis0420" <!-- <sqlMapGenerator targetProject="mybatis0420" <!-- <table enableUpdateByExample="false" enableSelectByExample="false" <table enableUpdateByExample="false" enableSelectByExample="false" </context> </generatorConfiguration> |
- log4j.properties的配置内容如下:
log4j.rootLogger=DEBUG, Console #Console log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4j.PatternLayout log4j.appender.Console.layout.ConversionPattern=%d log4j.logger.java.sql.ResultSet=INFO log4j.logger.org.apache=INFO log4j.logger.java.sql.Connection=DEBUG log4j.logger.java.sql.Statement=DEBUG log4j.logger.java.sql.PreparedStatement=DEBUG |
- ehcache.xml的配置内容如下:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../config/ehcache.xsd"> <diskStore <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" maxElementsOnDisk="10000000" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU"> <persistence </defaultCache> </ehcache> |