简体   繁体   中英

How to export Derby database to sql insert file using JDBC

I am trying to extract the current database to a .sql insert file. I am using IntelliJ and a Derby embedded database. I know how to do this manual through IntelliJ, but I want to do so through JDBC. I would like to store the file within the project as well, so it can be ran as a sql script to insert to the db later on.

It's not possible to extract a Derby database to a .sql file that can be ran later on.

Instead, simply zip up your Derby database folder and unzip it later on.

http://db.apache.org/derby/docs/10.0/manuals/admin/hubprnt43.html#Backing+Up+a+Database

There is no option for backup as sql file format. However, to perform an offline backup of a database, simply use operating system commands to copy the database directory. The database must be shut down prior to performing an offline backup.

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