This java video tutorial demonstrates how to start the Apache Derby database network connection and to create a Derby database. We also show you how to create a JDeveloper connection to a Derby database. The Derby database is a free database provided by Apache. It has a very small memory and disk footprint. It is not meant for production, but it is great for testing JDBC functionality with Java programs (and others as well!)
To install the Apache Derby database, you’ll need to perform the following steps:
- Download Apache Derby from https://db.apache.org/derby/derby_downloads.html .
- Unzip the file you just downloaded to any location on your local file system. The folder created is your Derby home.
- Add the %DERBY_HOME%bin directory to your PATH environment variable.
- Add the %DERBY_HOME%libderby.jar, %DERBY_HOME%libderbyClient.jar, %DERBY_HOME%libderbyTools.jar to your CLASSPATH environment variable.
- Ensure you have a Java Runtime Environment installed on your machine.
- From a command prompt, run the following:java -jar derbyrun.jar server start This will start the Derby network server. DON’T CLOSE THE WINDOW! This program needs to be running in order for you to connect to your Derby database.
- Open a second command prompt. Type: ij This starts the Derby command-line client in interactive mode.
- To create a new database along with a user, type the following: connect ‘jdbc:derby:MyDB;user=student;password=student;create=true’ This creates a database called MyDB and defines the user credentials.
- To show the tables, type: show tables;