[英]How could I read SQLite file which will be passed as MultipartFile parameter? (in java/kotlin)
I have to write REST API which will parse an SQLite file and parse&save its data into the server's MySQL DB.我必须编写 REST API 它将解析 SQLite 文件并将其数据解析并保存到服务器的 Z497757A01AFA459
The SQLite file will be passed as a.zip file( MultipartFile
), so I have to unzip it, and then read the unzipped file as DTO. SQLite 文件将作为 .zip 文件(
MultipartFile
)传递,所以我必须解压缩它,然后将解压缩的文件作为 DTO 读取。
The code will be as following..代码如下..
fun parseSQLite(zipFile: MultipartFile) {
val file = unzip(zipFile)
val sqliteDB = somethingLibrary.load(file)
doParseTable(sqliteDB.execute("select * from TestTable"))
}
I found there are sqlite-jdbc
library( https://github.com/xerial/sqlite-jdbc ), but it seems like it might not work in my case.我发现有
sqlite-jdbc
库( https://github.com/xerial/sqlite-jdbc ),但它似乎不适用于我的情况。 I think I need mmap I/O, but are there any JAVA library for it?我想我需要 mmap I/O,但是有没有 JAVA 库呢?
Thanks!谢谢!
For those whom may face a similar problem;对于那些可能面临类似问题的人; I decided to add a step that saves "unzipped SQLite DB" into the server's local storage, and then load DB from it.
我决定添加一个步骤,将“解压缩的 SQLite DB”保存到服务器的本地存储中,然后从中加载 DB。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.