Skip to content
Vicky AV edited this page Apr 21, 2017 · 4 revisions

Welcome to the DerbyDBWithJava wiki!

This sample aimed at creating a simple Java console application to demonstrate how to connect Derby DB with Java. We have included methods for the following operations.

  • Create Table
  • Check if a Table already Exist
  • Insert Records
  • Delete Table
  • Drop Table

# PREREQUISITES

  • JDK 1.6 or Greater
  • Derby.jar (If you are using JDK Version 1.6 or above, Derby.jar would be available in your JDK itself. Please check db\lib folder under JDK folder for derby jar)

# SET ENVIRONMENT VARIABLES

  • DERBY_INSTALL=C:\Program Files\Java\jdk1.8.0_112\db
  • If you use cmd prompt to run this program, Run the following before running javac

set classpath=C:\Program Files\Java\jdk1.8.0_112\jre\lib;%DERBY_INSTALL%\lib\derby.jar;

  • If you use Eclipse to run this program,

Right click PROJECT in Eclipse -> PROPERTIES -> BUILD PATH -> Add External JARs under LIBRARIES tab -> Add Derby.jar file

# REFERENCES

  1. UNDERSTAND PATH AND CLASSPATH
  2. JAVA DB (DERBY) OFFICIAL DOCUMENTATION
  3. DERBY OFFICIAL SAMPLE APPLICATION
Clone this wiki locally