Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use OAuth 2.0to realize authority authentication mybatis to connect to mysql database

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to use OAuth 2.0 to achieve authority authentication mybatis to connect to mysql database". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Add dependency pom information mysql mysql-connector-java 8.0.18 org.mybatis.spring.boot mybatis-spring-boot-starter 2.1.3 org.mybatis mybatis 3.5.5 Org.mybatis mybatis-spring 2.0.5 com.alibaba druid 1.1.3

Add configuration information

Spring: redis: host: 127.0.0.1 port: 6379 datasource: name: url: jdbc:mysql://mysqlurl:3306/hongyuan?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=UTC username: root password: rootserver: port: 9090mybatis: mapper-locations: classpath:mapper/*.xml type-aliases-package: com.hongyuan.dao

Edit related mapper files

Package com.hongyuan.dao;import com.hongyuan.pojo.UserInfo;import org.apache.ibatis.annotations.Mapper;import org.springframework.stereotype.Repository;import java.util.List / * @ ClassName UserDao * @ PaceageName com.hongyuan.dao * @ Description: user Information Table * @ Author: liuxinzhou * @ Date: 5:26 on 2020-9-22 * @ Version V1.0.0 * / @ Mapperpublic interface UserMapper {/ / obtain all the user information public UserInfo getUserInfo (UserInfo userInfo) based on the user information; / / query all user information public List getUserList ();}

Add an associated xml file

This is the end of user select * from where 1 and username = # {username} select * from "how to use OAuth 2.0 to authenticate mybatis to connect to mysql database". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report