简体   繁体   中英

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.

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.

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. I think I need mmap I/O, but are there any JAVA library for it?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM