I'm trying to setup an embedded Derby database for a standalone Java application, but after pouring through all sorts of documentation, I just can't seem to find any simple explanations or examples. I'm using Eclipse with the Derby plugin and have enabled Derby nature for my project.
I found an example of using an embedded Derby database in a standalone address book as well as an overview of using Derby in Eclipse (that doesn't seem to cover the embedded deployment), but I still feel like I'm missing something fundamental.
This is my first time attempting to use a database with Java, and I'm a little confused, so here are my basic questions:
Snippets of code would be very helpful!
To use Derby in Java in embedded mode, we need to do the following steps:
org.apache.derby.jdbc.EmbeddedDriver
driver, located in
the derbyclient
Maven dependencyjdbc:derby:dbname
System.setProperty("derby.system.home", "/home/janbodnar/.derby");
DriverManager.getConnection("jdbc:derby:;shutdown=true");
Full working examples can be found at my Java JDBC Derby programming tutorial.