MyBatis-config配置信息
Posted xiaonihao444
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MyBatis-config配置信息相关的知识,希望对你有一定的参考价值。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybaits-3-config.dtd">
<configuration>
<settings>
<setting = name "logImpl" value = "LOG4J"/> <!-- 指定log4j输出日志 -->
</settings>
<typeAliases>
<package name = "tk.mybatis.simple.model"/> <!-- 设置包的别名 -->
</typeAliases>
<environments default = "developemnt">
<enviroment id = "development">
<transactionManager type = "JDBC">
<property name = "" value = ""/>
</transactionManager>
<!-- 配置数据库链接信息 -->
<dataSource type = "UNPOOLED">
<property name = "driver" value = "com.mysql.jdbc.Driver"/>
<property name = "url" value = "jdbc:mysql://localhost:3306/mybatis"/>
<property name = "username" value = "root"/>
<property name = "password" value = "×××××××"/>
</dataSource>
</enviroment>
</environments>
<!-- 定义映射器 -->
<mappers>
<!-- MyBatis 的SQL语句和映射配置文件 -->
<mapper resource = "tk/mybatis/simple/mapper/CountryMapper.xml"/>
</mappers>
</configuration>
以上是关于MyBatis-config配置信息的主要内容,如果未能解决你的问题,请参考以下文章