Apache Derby – Home

Apache Derby is a Relational Database Management System which is fully based on (written/implemented in) Java programming language. It is an open source database developed by Apache Software Foundation.

Audience

This tutorial is prepared for beginners to help them understand the basic concepts related to Apache Derby. This tutorial will give you enough understanding on the various SQL queries of Apache along with JDBC examples.

Prerequisites

Before you start practicing with various types of examples given in this tutorial, I am assuming that you are already aware about what a database is, especially the RDBMS and what is a computer programming language.

Introduction

Apache Derby is a Relational Database Management System which is fully based on (written/implemented in) Java programming language. It is an open source database developed by Apache Software Foundation.

Oracle released the equivalent of Apache Derby with the name JavaDB.

Features of Apache Derby

Following are the notable features of Derby database โˆ’

  • Platform independent โˆ’ Derby uses on-disc database format where the databases in it are stored in a file in the disc within the directory with the same name as the database.
  • No modifying data โˆ’ Because of this, you can move derby databases to other machines without modifying the data.
  • Transactional support โˆ’ Derby provides complete support for transactions ensuring data integrity.
  • Including databases โˆ’ You can include pre-build/existing databases into your current derby applications.
  • Less space โˆ’ Derby database has a small footprint, i.e., it occupies less space and it is easy to use and deploy it.
  • Embed with Java Application โˆ’ Derby provides an embedded database engine which can be embedded in to Java applications and it will be run in the same JVM as the application. Simply loading the driver starts the database and it stops with the applications.

Limitations of Apache Derby

Following are the limitations of Apache Derby โˆ’

  • Derby does not support indexes for datatypes such as BLOB and LONGVARCHAR.
  • If Derby does not have enough disc space, it will shut down immediately.

Data storage

While storing data, Apache Derby follows a concept known as conglomerate. In this, data of a table will be stored in a separate file. In the same way, each index of a table is also stored in a separate file. Thus, there will be a separate file for every table or index in the database.

Apache Derby Library/Components

Apache Derby distribution provides various components. In the lib folder of the apache distribution you have downloaded, you can observe jar files representing various components.

Jar fileComponentDescription
derby.jarDatabase Engine and JDBC driverThe Database engine of Apache Derby is an embedded relational database engine which supports JDBC and SQL APIโ€™s.This also acts as embedded Driver, using which you can communicate to Derby using Java applications.
derbynet.jar derbyrun.jarNetwork serverThe Network Sever of Apache Derby provides the client server functionality, where the clients can connect to the Derby server through a network.
derbyclient.jarNetwork client JDBC driver
derbytools.jarCommand line toolsThis jar file holds tools such as sysinfo, ij, and dblook.
derbyoptionaltools.jarOptional command line utilities (tools)This jar file provides optional tools: databaseMetaData optional tool, foreignViews optional tool, luceneSupport optional tool, rawDBReader optional tool, simpleJson optional tool, etc
derbyLocale_XX.jarJar files to localize messagesIn addition to the above mentioned jar files, you can see several derbyLocale_XX.jar (es, fr, hu, it, ja, etc.). Using these, you can localize the messages of Apache Derby.

Leave a Reply