0

I'm currently developing a JavaFX application which uses embedded Derby database. The application needs fixed data of around 13000 products. I can deploy app without any problem, and after deployment, if I copy database files to deployed app's directory, the app can find and use that database. My question is what is the best practice to deploy this kind of application with the initial data? Thanks!

(Note: I'm using Intellij IDE and Maven if it helps deployment for my purpose.)

Mert Akozcan
  • 163
  • 1
  • 10
  • Possible duplicate of https://stackoverflow.com/questions/33008711/how-to-access-derby-database-from-executable-jar-file or https://stackoverflow.com/questions/12330496/attach-derby-database-into-jar-file or https://stackoverflow.com/questions/30182333/how-to-embed-database-derby-in-jar-file or https://stackoverflow.com/questions/4393385/setting-up-an-embedded-derby-database-in-a-standalone-java-application?rq=1 among others – Bryan Pendleton Feb 01 '18 at 18:39
  • Actually, my question is about publishing the app with already filled database. I don't have any problems with creating or connecting to the database, so links you shared don't help. – Mert Akozcan Feb 06 '18 at 08:03

1 Answers1

2

I would use flywaydb to run database initialization scripts upon startup. I have done this in the past and it works well.

It has the additional benefit in that if you release a new version, you can just include scripts to evolve the schema for that new version if necessary.

BillRobertson42
  • 12,602
  • 4
  • 40
  • 57