Solved

Saving embedded Derby DB to a file.

Posted on 2006-11-23
1
288 Views
Last Modified: 2010-08-05
To create a derby db and get a connection I do:

        String driver = "org.apache.derby.jdbc.EmbeddedDriver";
        Class.forName(driver).newInstance();
        Properties props = new Properties();
       
        // to create a new database
        props.put("create","true");
       
        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.
0
Comment
Question by:HappyEngineer
1 Comment
 
LVL 14

Accepted Solution

by:
hoomanv earned 500 total points
ID: 18006161
The connection url to create an embedded db is like
    jdbc:derby:directory:C:\name;create=true
And after the db is created you can omit the "create=true" option
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now