Derby Command Line Quick Start

While you can find this information on the derby website, in a grossly large Derby Basics document, isn’t it nicer to just copy and paste? I just don’t understand why developers like to write documents that make you take so much time to get started.

tar -xvzf db-derby-
sudo mv db-derby- /usr/local/
export DERBY_INSTALL=/usr/local/db-derby-
export CLASSPATH=$DERBY_INSTALL/lib/derby.jar:$DERBY_INSTALL/lib/derbytools.jar:.

Once you’re in, you can issue the following commands…

connect 'jdbc:derby:MyDbTest;create=true';
drop table derbyDB;
create table derbyDB(num int, addr varchar(40));
insert into derbyDB values (1956,'Webster St.');
insert into derbyDB values (1910,'Union St.');
update derbyDB set num=180, addr='Grand Ave.' where num=1956;
select * from derbyDb;