I created a java swing application with apache derby database. I want to know how can i do the following things.
The first time the application is double-clicked by a user, that finds a suitable location for the Derby database on the user's machine, creates the database and defines all the tables, views, etc and loads any initial data. Then, on subsequent runs of the application, it will be able to re-open the database and continue using it.
user.home
property from System.getProperty
which will return you the user's home directory as the main path for the database. On Windows, I would recommend using {user.home}\AppData\Remote\{You application name}
as a base path