MyBatis xml配置文件
XML(eXtensible Markup Language)是一种可扩展的标记语言,用来描述“结构化数据”。简单说:
像 HTML,但标签可以自己发明;
纯文本,跨平台、跨语言;
核心作用:存储/传输数据,而不是展示数据。
xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.itheima.mapper.UserMapper"><select id="findall" resultType="com.itheima.pojo.User">select id,username,password,name,age from user</select>
</mapper>
辅助配置
#日志输出
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl#指定xml配置
mybaits.mapper-locations=classpath:mapper/*.xml