当前位置: 首页 > news >正文

网站建设的基本过程包括WordPress主题安全吗

网站建设的基本过程包括,WordPress主题安全吗,哪里有门户网站开发公司,有需要做网站的吗1. 说明 SpringBoot项目#xff0c;连接MySQL数据库#xff0c;使用Mybatis框架。 本篇文章作为 SpringBoot 使用 Mybatis 的入门。 2. 依赖 2.1. MySQL驱动依赖 MySQL驱动#xff0c;使用SpringBoot版本对应的默认版本#xff0c;不需要手动指定版本。 比如#xf…1. 说明 SpringBoot项目连接MySQL数据库使用Mybatis框架。 本篇文章作为 SpringBoot 使用 Mybatis 的入门。 2. 依赖 2.1. MySQL驱动依赖 MySQL驱动使用SpringBoot版本对应的默认版本不需要手动指定版本。 比如SpringBoot 版本为 2.7.15对应的 MySQL 驱动的版本为 8.0.33 dependencygroupIdcom.mysql/groupIdartifactIdmysql-connector-j/artifactIdscoperuntime/scope/dependency2.2. Mybatis依赖 MyBatis版本使用SpringBoot版本推荐的版本在新建项目时会根据SpringBoot版本自动生成对应的MyBatis版本。 比如SpringBoot 版本为 2.7.15对应的 MyBatis 的版本为 2.3.1 dependencygroupIdorg.mybatis.spring.boot/groupIdartifactIdmybatis-spring-boot-starter/artifactIdversion2.3.1/version/dependency3. 配置数据源 application.yml 文件中配置数据源MySQL数据库。 包括数据库url用户名密码驱动 spring:datasource:url: jdbc:mysql://localhost:3306/mybatisplus?serverTimeZoneUTCcharacterEncodingutf8useUnicodetrueuseSSLfalseusername: rootpassword: passworddriver-class-name: com.mysql.cj.jdbc.Drivermysql驱动使用的是新版驱动 com.mysql.cj.jdbc.Driver使用旧版驱动在项目启动的时候会报错。 4. Controller - Service - Mapper - Entity 4.1. 图示 4.2. Entity package com.example.web.entity;import lombok.Data;Data public class User {private Long id;private String name;private Integer age;private String email; }4.3. Mapper 4.3.1. Mapper.java package com.example.web.mapper;import com.example.web.entity.User; import org.apache.ibatis.annotations.Mapper;import java.util.List;Mapper public interface UserMapper {ListUser listAll(); } 4.3.2. Mapper.xml 注意这个 Mapper.xml 文件所在的路径 com.example.web.mapper默认情况必须和 Mapper.java 文件的路径一致否则会报错找不到映射文件Mapper.xml。 ?xml version1.0 encodingUTF-8? !DOCTYPE mapperPUBLIC -//mybatis.org//DTD Mapper 3.0//ENhttp://mybatis.org/dtd/mybatis-3-mapper.dtd mapper namespacecom.example.web.mapper.UserMapperselect idlistAll resultTypecom.example.web.entity.Userselect * from user/select/mapper4.4. Service 4.4.1. Service接口 package com.example.web.service;import com.example.web.entity.User;import java.util.List;public interface UserService {ListUser listAll(); } 4.4.2. Service实现 package com.example.web.service.impl;import com.example.web.entity.User; import com.example.web.mapper.UserMapper; import com.example.web.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;import java.util.List;Service public class UserServiceImpl implements UserService {Autowiredprivate UserMapper userMapper;Overridepublic ListUser listAll() {return userMapper.listAll();} } 4.5. Controller package com.example.web.controller;import com.example.web.entity.User; import com.example.web.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;import java.util.List;RestController RequestMapping(users) public class UserController {Autowiredprivate UserService userService;GetMappingpublic ListUser selectAll() {return userService.listAll();}} 5. 接口请求与数据 5.1. 接口请求示例 5.2. 数据库中的表和数据 6. SpringBoot项目创建时添加mysql驱动和mybatis依赖 这里创建新项目使用的是STSSpringToolSuite4因为 IDEA 社区版没法创建SpringBoot项目。 MySQL的驱动版本不需要指定。有和SpringBoot版本适配的默认版本。 7. 对比“MySQL驱动”指定版本和不指定版本 7.1. 指定版本 7.2. 不指定版本跟随SpringBoot版本 8. MySQL驱动的maven仓库坐标变化 MySQL驱动的maven仓库坐标发生了变化。 官方将原来的 mysql-connector-java 改为了 mysql-connector-j。 测试时间点为2023年9月3日 。
http://www.hkea.cn/news/14531808/

相关文章:

  • 弘泽建设集团网站做外贸铝材哪个网站比较好
  • 网站建设 首选百川互动广州网站公司推广建设
  • 网盘搜索 网站开发thinkphp网站开发实战教程
  • 北京网站建设dqcxwordpress 装插件 长时间提示正在解压安装包
  • 品牌网站建设的关键事项设计软件有哪些手机版
  • 网站做电话线用有网站前台
  • 最新备案的网站郑州网页制作案例教程
  • 外贸网站打开速度多城市分站网站建设
  • 做阿里巴巴的网站的费用吗企业网站管理系统 开源
  • 设计好的网站腾讯云一键wordpress
  • 人才招聘网站建设方案诗词门户网站
  • 商务网站内容建设包括做网站美工
  • 重庆网站建设制作设计公司哪家好网站数据模板
  • 公司网站的主页优化三亚的私人电影院
  • 网站建设销售员话术网站建设郑州公司
  • 国内网站制作公司排名wordpress文字添加图片不显示图片
  • 搭建租号网的网站wordpress建企业网站
  • 网站搜索结果页面怎么做找人做网站会不会被偷
  • 怎么在网站挂黑链接h5制作工具手机版
  • wordpress英语培训主题烟台网站的优化
  • 建设企业网站需要多少钱企业品牌推广网站
  • 行业网站联盟网站制作推广招聘
  • 深圳网站建设的费用潍坊市城乡建设局网站
  • 网站厨师短期培训班福州电商网站设计
  • 网站怎么做导航条企业邮箱注册哪个好
  • 怎么用阿里云服务器做网站黄岛网站建设多少钱
  • 亚马逊网站特色wordpress图片768好吗
  • 网站群建设费用网站渗透
  • 做课件需要的纯音乐网站做网站 挣广告联盟的佣金
  • 深圳宝安专业做网站公司做网站的大小