随笔 - 835  文章 - 1 评论 - 40 阅读 - 102万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

Springboot+JPA+Sqlite整合demo参考: https://afu-bob.blog.csdn.net/article/details/90294553

 简单使用:

1.依赖

复制代码
<!-- https://mvnrepository.com/artifact/com.github.gwenn/sqlite-dialect -->
<dependency>
    <groupId>com.github.gwenn</groupId>
    <artifactId>sqlite-dialect</artifactId>
    <version>0.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
<dependency>
    <groupId>org.xerial</groupId>
    <artifactId>sqlite-jdbc</artifactId>
    <version>3.28.0</version>
</dependency>
复制代码

2. properties 配置文件上  data source 配置

复制代码
# 数据库连接信息 JDBC url
spring.datasource.url=jdbc:sqlite:D://data/sqlite/test.db
# 数据库驱动名称
spring.datasource.driverClassName=org.sqlite.JDBC
# 数据库用户名
spring.datasource.username=
# 数据库密码
spring.datasource.password=
# Dialect
spring.jpa.database-platform=org.hibernate.dialect.SQLiteDialect
# spring.jpa.hibernate.use-new-id-generator-mappings=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.open-in-view=true
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=trace
复制代码

 

然后就可以正常使用了

 

posted on   lshan  阅读(945)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2021-08-24 springboot2.1.3配置sftp,自定义sftp连接池(转)
点击右上角即可分享
微信分享提示