Saving embedded Derby DB to a file.

To create a derby db and get a connection I do:

        String driver = "org.apache.derby.jdbc.EmbeddedDriver";
        Properties props = new Properties();
        // to create a new database
        return DriverManager.getConnection(dbUri, props);

I then do normal JDBC operations on that connection to create tables and insert values into those tables.

Then what do I do? How do I tell it to store that data on disk somewhere so that I can open it again later? I assume that the "createFrom" property would be used to reopen an existing derby db. But, I don't see a property that specifies how to save the data there in the first place.
Who is Participating?
hoomanvConnect With a Mentor Commented:
The connection url to create an embedded db is like
And after the db is created you can omit the "create=true" option
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.