zoukankan      html  css  js  c++  java
  • springboot整合mybaties

    在pom.xml中添加相关依赖。

            <!--MyBatis分页插件-->
            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper-spring-boot-starter</artifactId>
                <version>1.2.10</version>
            </dependency>
            <!--集成druid连接池-->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>1.1.10</version>
            </dependency>
            <!--Mysql数据库驱动-->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>8.0.15</version>
            </dependency>        

    在application.yml中添加数据源配置和MyBatis的mapper.xml的路径配置。

    server:
      port: 8080
    
    spring:
      datasource:
        url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
        username: root
        password: root
    
    mybatis:
      mapper-locations:
        - classpath:mapper/*.xml
        - classpath*:com/**/mapper/*.xml

    参考文章:https://macrozheng.github.io/mall-learning/#/architect/mall_arch_01

  • 相关阅读:
    驱动程序细节和权衡
    交互
    查找UI元素
    Selenium-Webdriver API命令和操作-Get & Wait
    Selenium的webdriver
    openssl生成ssl证书
    tony_nginx_02_URL重写
    CPA
    消息队列产品比较
    元数据交换绑定的秘密
  • 原文地址:https://www.cnblogs.com/ooo0/p/11434700.html
Copyright © 2011-2022 走看看