Java DB Quickstart for Ubuntu
The Linked Guide shows you How to Install and Getting Started with the Oracle Java DB on Ubuntu 14.04 Trusty LTS Linux.
The Oracle Java Derby DB is Included in the Oracle Java SE JDK 7/8 and So you will find Link to Installing the Oracle JDK on Ubuntu Linux.

-
How to Download and Install Oracle JDK with Java DB on Ubuntu
To check your current JDK version:
javac --version && java -XshowSettings:properties -version 2>&1 | grep 'java.vendor'
If it’s the official Oracle JDK, the output will include:
java.vendor = Oracle Corporation
.
Set also the JAVA_HOME Environment Variable! -
Open a Command Line Terminal Shell Session
Ctrl+Alt+t
(Press “Enter” to Execute Commands)In case first see: Terminal QuickStart Guide.
-
Set up PATH and DERBY_HOME Environment Variable.
nano $HOME/.bashrc
Append:
export DERBY_HOME=$JAVA_HOME/db export PATH=$PATH:$DERBY_HOME/bin
Ctrl+x to Save & Exit from ‘nano’ Editor ;)
bash
To Load the New Environment.
-
Download Oracle Java SE JDK Demos and Samples for Linux
-
Double-Click and Extract into /tmp.
Or from Command Line:tar xvzf ~/Downloads/jdk*demos.tar.gz -C /tmp/
-
Relocate JDK Demos & Samples.
mv /tmp/jdk*/demo /tmp/jdk*/sample $JAVA_HOME/
-
Set the Derby Demo Environment.
mkdir ~/derbyDemo
cd ~/derbyDemo
cp $JAVA_HOME/demo/db/programs/toursdb/*.sql .
-
Running Derby CLI ij Tool.
java -jar $DERBY_HOME/lib/derbyrun.jar ij
-
Open Connection and Create a DB using JDBC Driver.
CONNECT 'jdbc:derby:mydb;create=true';
-
Create Table and Insert Records.
CREATE TABLE MYTABLE (ID INT PRIMARY KEY, NAME VARCHAR(12));
INSERT INTO MYTABLE VALUES (1,'ALAN'),(20,'JACQUES'),(300,'MARIO');
Show up the Inserted Values:
SELECT * FROM MYTABLE;
-
Loading Tables and Records from SQL Scripts.
run 'ToursDB_schema.sql';
Populate the Tables with data:
run 'loadTables.sql';
Show up some Inserted Stuff:
SELECT * FROM FLIGHTS
-
Oracle Java DB Online Documentation