I implemented a Java Swing application that uses the built-in JavaDB database. The database must be stored somewhere, and the database tables must be created on first start. What is the preferred way to perform these procedures?
Should I always create the database in the local directory and first check if the database file exists, and if it does not exist, let the user create the tables (or at least show a message that the tables will be created).
Or should I let the user choose a path? but then I have to save the path somewhere. Should I save the path with Preferences.systemRoot();and check if this variable is set at startup?
If a user selects a path and saves it in Preferences, can I get any user rights issues? or should it be safe wherever the user stores the database? Or how can I handle this?
Any other suggestions for this procedure?
Jonas source
share