Jan 25th, 2018


Apache Derby

Connect to the database with ij

First run ij tool. The Derby ij tool is a JDBC tool that you can use to run scripts or interactive queries against a Derby database.

java -jar /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/db/lib/derbyrun.jar ij

or if ij is in your PATH (ex: /Applications/NetBeans/glassfish-4.1.1/javadb/bin)


then connect to the database

ij> connect 'jdbc:derby://localhost:1527/sample;user=app;password=app';
ij> connect 'jdbc:derby:retailpos';
ij> connect 'jdbc:derby:memory:retailpos';
ij> connect 'jdbc:derby:/Users/dev/work/workspaces/retailpos/retailpos';

after connecting you can use sql commands.

ij> show tables;
ij> select * from customer;
ij> select * from product;

to exit from ij tools

ij> exit;