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
然后就可以正常使用了
分类:
spring boot
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2021-08-24 springboot2.1.3配置sftp,自定义sftp连接池(转)