I wanted to copy a ".db" file from an SQLite database to memory using JAVA code. How can I do this ?
What you could do is :-
Open an in-memory database and attach the database you want to copy.
Create the tables and copy the data for each table (you can ascertain the table and other entity names from sqlite_master (name, type and table columns))
CREATE TABLE x AS SELECT * FROM attached_database_identifier.x
noting limitations as per [SQL As Understood By SQLite - CREATE TABLE - CREATE TABLE ... AS SELECT Statements] ( https://www.sqlite.org/lang_createtable.html#rowid ))Create the other entities Indexes, Views and Triggers (again the sql column of sqlite_master will hold the SQL to create the entities).
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.