Derby
January 25, 2018

References

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.

1
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)

1
java org.apache.derby.tools.ij

then connect to the database

1
2
3
4
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.

1
2
3
ij> show tables;
ij> select * from customer;
ij> select * from product;

to exit from ij tools

1
ij> exit;