title: How to deploy a Java Swing application with an embedded JavaDB database?
body: <p>I have implemented an Java Swing application that uses an embedded JavaDB database. The database need to be stored somewhere and the database tables need to be created at the first run. What is the preferred way to do these procedures?</p>
  
  <p>Should I always create the database in the local directory, and first check if the database file exist, and if it doesn't exist let the user create the tables (or at least show a message that the tables will be created).</p>
  
  <p>Or should I let the user choose a path? but then I have to save the path somewhere. Should I save the path with <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/prefs/Preferences.html" rel="nofollow noreferrer"><code>Preferences.systemRoot();</code></a>, and check if that variable is set on startup?</p>
  
  <p>If the user choses a path and save it in the <code>Preferences</code>, can I get any problems with user permissions? or should it be safe wherever the user store the database? Or how do I handle this?</p>
  
  <p>Any other suggestions for this procedure?</p>