db2 springboot 整合_Spring boot Mybatis 整合(完整版)

本文详述了如何将Spring Boot与Mybatis框架整合,并与DB2数据库进行连接,包括环境配置、依赖引入、配置文件设置、数据库创建、Mybatis Generator自动生成代码的使用以及Spring Boot应用启动类的调整。通过这些步骤,实现了一个完整的Spring Boot Mybatis DB2整合项目。
摘要由CSDN通过智能技术生成

个人开源项目

推荐开源项目

更多干货

正题

本项目使用的环境:

开发工具:Intellij IDEA 2017.1.3

springboot: 1.5.6

jdk:1.8.0_161

maven:3.3.9

额外功能

PageHelper 分页插件

mybatis generator 自动生成代码插件

步骤:

1.创建一个springboot项目:

2.创建项目的文件结构以及jdk的版本

3.选择项目所需要的依赖

然后点击finish

5.看一下文件的结构:

6.查看一下pom.xml:

4.0.0

com.winter

springboot-mybatis-demo

0.0.1-SNAPSHOT

jar

springboot-mybatis-demo

Demo project for Spring Boot

org.springframework.boot

spring-boot-starter-parent

1.5.6.RELEASE

UTF-8

UTF-8

1.7

org.mybatis.spring.boot

mybatis-spring-boot-starter

1.3.0

org.springframework.boot

spring-boot-starter-thymeleaf

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-test

test

mysql

mysql-connector-java

5.1.35

com.fasterxml.jackson.core

jackson-core

com.fasterxml.jackson.core

jackson-databind

com.fasterxml.jackson.datatype

jackson-datatype-joda

com.fasterxml.jackson.module

jackson-module-parameter-names

com.github.pagehelper

pagehelper-spring-boot-starter

1.1.2

com.alibaba

druid-spring-boot-starter

1.1.0

org.springframework.boot

spring-boot-maven-plugin

org.mybatis.generator

mybatis-generator-maven-plugin

1.3.2

${basedir}/src/main/resources/generator/generatorConfig.xml

true

true

7.项目不使用application.properties文件 而使用更加简洁的application.yml文件:

将原有的resource文件夹下的application.properties文件删除࿰

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值