Derby
Apache Derby, the embedded Java database: the ij tool, connection URLs and common SQL tasks.
1 min read
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.
java -jar /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/db/lib/derbyrun.jar ijor if ij is in your PATH (ex: /Applications/NetBeans/glassfish-4.1.1/javadb/bin)
java org.apache.derby.tools.ijthen 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;