寒光博客

SpringBoot application.yml
application.yml server: port: 8081 spring: #数据库连接配置 ...
扫描右侧二维码阅读全文
29
2021/06

SpringBoot application.yml

application.yml

server:
  port: 8081
spring:
  #数据库连接配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/_6_29?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
    username: root
    password: 123456

#mybatis的相关配置
mybatis:
  #mapper配置文件
  mapper-location: classpath:mapper/*.xml

mapper

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.example.demo.mapper.UserMapper">
    <select id="findAll" resultType="com.example.demo.entity.User">
        SELECT * FROM user
    </select>
</mapper>
本文作者:Author:     文章标题:SpringBoot application.yml
本文地址:https://dxoca.cn/java/389.html       百度已收录
版权说明:若无注明,本文皆为“Dxoca's blog (寒光博客)”原创,转载请保留文章出处。
Last modification:June 29th, 2021 at 04:04 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment