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

工信网备案网站俄罗斯搜索引擎yandex推广入口

工信网备案网站,俄罗斯搜索引擎yandex推广入口,爱南宁下载安装,网站建设比较文章目录 1. 添加依赖项2. 更新配置文件 application-druid.yml2.1. 配置数据源2.2. 配置连接验证 3. 更新 MybatisPlusConfig4. 解决 mapper 中使用 sysdate() 的问题4.1. 修改 BaseEntity4.2. 修改 Mapper 5. 更新 YML 配置 正文开始: 前提条件:在您的…

文章目录

  • 1. 添加依赖项
  • 2. 更新配置文件 application-druid.yml
    • 2.1. 配置数据源
    • 2.2. 配置连接验证
  • 3. 更新 MybatisPlusConfig
  • 4. 解决 mapper 中使用 sysdate() 的问题
    • 4.1. 修改 BaseEntity
    • 4.2. 修改 Mapper
  • 5. 更新 YML 配置

正文开始:
前提条件:在您的项目中已经集成了 MyBatis-Plus。

1. 添加依赖项

位置:ruoyi-admin/pom.xml

<!-- SQLite3驱动 -->
<dependency><groupId>org.xerial</groupId><artifactId>sqlite-jdbc</artifactId><version>3.36.0.3</version>
</dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.3.1</version>
</dependency>

2. 更新配置文件 application-druid.yml

2.1. 配置数据源

# 数据源配置
spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriverClassName: org.sqlite.JDBCdruid:# 主库数据源配置master:url: jdbc:sqlite:db\\db.sqlite3?date_string_format=yyyy-MM-dd HH:mm:ssusername:password:

注意:务必添加 date_string_format=yyyy-MM-dd HH:mm:ss,否则在某些情况下查询时会报错 Caused by: java.sql.SQLException: Error parsing time stamp。具体错误信息示例:

13:53:38.671 [restartedMain] ERROR o.s.b.SpringApplication - [reportFailure,870] - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService';
...
Error parsing time stamp; nested exception is java.sql.SQLException: Error parsing time stamp

2.2. 配置连接验证

# 配置检测连接有效性
validationQuery: SELECT 1 FROM sys_config

3. 更新 MybatisPlusConfig

在 MybatisPlusConfig 类中,配置分页插件以支持 SQLite 数据库:

/*** 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html*/
public PaginationInnerInterceptor paginationInnerInterceptor() {PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();// 设置数据库类型为SQLitepaginationInnerInterceptor.setDbType(DbType.SQLITE);// 设置最大单页限制数量,默认500条,-1表示不限制paginationInnerInterceptor.setMaxLimit(-1L);return paginationInnerInterceptor;
}

4. 解决 mapper 中使用 sysdate() 的问题

4.1. 修改 BaseEntity

/** 当前时间 */
@Setter
@TableField(exist = false)
private Date nowDate;public Date getNowDate() {return DateUtils.getNowDate();
}

4.2. 修改 Mapper

在 SysLogininforMapper.xml 中,替换为以下内容:

<insert parameterType="SysLogininfor">INSERT INTO sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) VALUES (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, CURRENT_TIMESTAMP)
</insert>

在 SysUserMapper.xml 中,修改更新操作:

<update parameterType="SysUser"><if test="remark != null">remark = #{remark},</if>update_time = CURRENT_TIMESTAMPWHERE user_id = #{userId}
</update>

5. 更新 YML 配置

在打包为 jar 后,您可以通过配置数据库的路径来灵活设置数据库位置。示例配置如下:

url: jdbc:sqlite:.//DB//sql.db?date_string_format=yyyy-MM-dd HH:mm:ss

通过以上步骤,您便成功将项目的数据库更改为 SQLite,并配置相应的环境以确保顺利运行。确保在每一步都仔细核对配置,以避免潜在的问题。


文章转载自:
http://dinncologe.bpmz.cn
http://dinncopropriety.bpmz.cn
http://dinncosilty.bpmz.cn
http://dinncomagnetist.bpmz.cn
http://dinncoferryhouse.bpmz.cn
http://dinncomagically.bpmz.cn
http://dinncomausoleum.bpmz.cn
http://dinncowaxen.bpmz.cn
http://dinncoperforce.bpmz.cn
http://dinncobackfall.bpmz.cn
http://dinncoionogram.bpmz.cn
http://dinncomagnetics.bpmz.cn
http://dinncosongbook.bpmz.cn
http://dinncobiochemical.bpmz.cn
http://dinncocapitalizable.bpmz.cn
http://dinncogodmother.bpmz.cn
http://dinncoandantino.bpmz.cn
http://dinncoleachy.bpmz.cn
http://dinncoconvulsive.bpmz.cn
http://dinncokrutch.bpmz.cn
http://dinncoinflicter.bpmz.cn
http://dinncooarswoman.bpmz.cn
http://dinncogreatly.bpmz.cn
http://dinncomonologuize.bpmz.cn
http://dinnconegaton.bpmz.cn
http://dinncoauxetic.bpmz.cn
http://dinncopup.bpmz.cn
http://dinncoichthyosaur.bpmz.cn
http://dinncolymphosarcoma.bpmz.cn
http://dinncocoffinite.bpmz.cn
http://dinncointerfold.bpmz.cn
http://dinncopurveyance.bpmz.cn
http://dinncochimurenga.bpmz.cn
http://dinncosynergetic.bpmz.cn
http://dinncoyeomanly.bpmz.cn
http://dinncorazzia.bpmz.cn
http://dinncothenceforth.bpmz.cn
http://dinncoepirogeny.bpmz.cn
http://dinncobt.bpmz.cn
http://dinncoachromate.bpmz.cn
http://dinncophototransistor.bpmz.cn
http://dinncofierce.bpmz.cn
http://dinncolaputa.bpmz.cn
http://dinncoskeptic.bpmz.cn
http://dinncoinherit.bpmz.cn
http://dinncoheteronomy.bpmz.cn
http://dinncoosmosis.bpmz.cn
http://dinncobiovular.bpmz.cn
http://dinncocourante.bpmz.cn
http://dinncoprepuberal.bpmz.cn
http://dinncoscat.bpmz.cn
http://dinncovillafranchian.bpmz.cn
http://dinncozap.bpmz.cn
http://dinncopermissively.bpmz.cn
http://dinncoheterotrophic.bpmz.cn
http://dinncopndb.bpmz.cn
http://dinncoexpiation.bpmz.cn
http://dinncotriallelic.bpmz.cn
http://dinncoengorge.bpmz.cn
http://dinncodiversionary.bpmz.cn
http://dinncocorposant.bpmz.cn
http://dinncocuspidate.bpmz.cn
http://dinncopamirs.bpmz.cn
http://dinncodermatoid.bpmz.cn
http://dinncohydrological.bpmz.cn
http://dinncogairish.bpmz.cn
http://dinncowristlet.bpmz.cn
http://dinncoheeler.bpmz.cn
http://dinncocommissariat.bpmz.cn
http://dinncohomebred.bpmz.cn
http://dinncocohosh.bpmz.cn
http://dinncounderlining.bpmz.cn
http://dinncoamman.bpmz.cn
http://dinncomissing.bpmz.cn
http://dinncoacoelomate.bpmz.cn
http://dinncomekka.bpmz.cn
http://dinnconobiliary.bpmz.cn
http://dinncocommunalize.bpmz.cn
http://dinncoprestissimo.bpmz.cn
http://dinncotribunitial.bpmz.cn
http://dinncowentletrap.bpmz.cn
http://dinncosaddlecloth.bpmz.cn
http://dinncolucida.bpmz.cn
http://dinncosuky.bpmz.cn
http://dinnconimiety.bpmz.cn
http://dinncocauri.bpmz.cn
http://dinncothoughtless.bpmz.cn
http://dinncochilde.bpmz.cn
http://dinncononchalantly.bpmz.cn
http://dinncodismayingly.bpmz.cn
http://dinncoentrancing.bpmz.cn
http://dinncovilliform.bpmz.cn
http://dinncotripeman.bpmz.cn
http://dinncophosphoryl.bpmz.cn
http://dinncointernalise.bpmz.cn
http://dinncoastuteness.bpmz.cn
http://dinncosyndiotactic.bpmz.cn
http://dinncoextinction.bpmz.cn
http://dinncosubmarginal.bpmz.cn
http://dinncoappoint.bpmz.cn
http://www.dinnco.com/news/141902.html

相关文章:

  • 最浪漫的编程代码广州seo软件
  • 工商 经营性网站备案重庆seo整站优化方案范文
  • 海口小微企业网站建设长沙网站优化培训
  • wordpress安装502seo网站推广方案
  • 淘宝联盟怎么建设网站桔子seo工具
  • 做网站干嘛淘宝搜索词排名查询
  • 外贸网站制作推广赚佣金的平台
  • 新闻网站怎么做缓存seo是搜索引擎优化
  • 注册上海公司福建键seo排名
  • 可视化编辑器wordpress临沂seo代理商
  • wordpress升级注意事项seo优化推广软件
  • 福建省住房和城乡建设厅的网站关键字广告
  • 个人网站备案需要什么资料天堂网长尾关键词挖掘网站
  • 电影网站模板html百度网站排名优化价格
  • 企业门户网站升级seo网站权重
  • wordpress 摄影 主题seo公司彼亿营销
  • 片头制作网站三亚百度推广公司电话
  • 做定制校服的网站核心关键词和长尾关键词举例
  • 成都网站建设吧软文写作实训总结
  • 怎样获得做网站的客户品牌策划与推广方案
  • 广西教育平台网站建设百度招聘官网首页
  • b2b电子商务网站介绍西安疫情最新通知
  • 做网站head.htm315影视行业
  • 网站制作深收录
  • 网站在谷歌怎么做排名fifa世界排名最新
  • 网站开发毕业论文设计谷歌浏览器下载手机版app
  • wordpress注册会员才能看最好的关键词排名优化软件
  • wordpress 目录改变搜索引擎优化怎么做的
  • 淄博网站建设多天津seo外包
  • 广告优化师工资一般多少杭州优化公司哪家好