javaoracle-databaseoracle-sqldeveloperlocal-database

Export SQL Database for local use Java


I'm working on a desktop Java app that requires a local database (server isn't an option). Every install of the application should come with the database. I'm using SQL Developer but don't how to 'export' the database (not the schema)? Is that even possible?

If the application has to create the database upon install, what would the connection string look like (in particular, the user and password fields)?

My current set up has a user that I made and a link from IntelliJ to the database, but I'm not sure this will work elsewhere since the user won't exist.

Thanks!


Solution

  • You can use H2 Data Base to set up an in memory data base and it is closed once the application closes. You need to store the application data in the client machine upon closing the application and load it back on startup.

    Here is a good place to get started with H2 Database with Spring.