- Derby: A Database for All Seasons
- What Is Derby?
- How to Use Derby
- Setting Up Your CLASSPATH
- Testing Your Setup
- Running Your First Derby Program
- Derby Application Components
- Derby Application Startup
- Loading the Derby Driver
- Database and Connection Creation
- Statement Creation
- Table Creation
- Table Access
- Shutdown
- Running the Code
How to Use Derby
The novice Derby user might be a little confused by all the documentation that comes with the product. This wealth of detail somewhat belies the fact that Derby is an open source product! However, Derby also comes complete with fully worked examples that describe how to use the product.
Getting Started
The first step is to download and install a copy of Derby. Next, open a command prompt and change the directory to the folder demo\simple underneath your Derby install folder. On my PC, the full path is this:
C:\java\db-derby-10.1.2.1-bin\demo\simple
In the remainder of the article, we’ll be using the Java program called SimpleApp.java contained in this folder. There are just a couple of steps required to get this program up and running. These steps are the usual pesky CLASSPATH things that go with using Java. So, let’s get these out of the way.