First you need to download derby and IJ which is in the same folder:
http://apache.is.co.za//db/derby/db-derby-10.7.1.1/db-derby-10.7.1.1-bin.zip
or if that doesn't work get it here:
http://db.apache.org/derby/derby_downloads.html
Now extract the archive and go to the bin folder:
cd db-derby-10.7.1.1-bin/bin/
Now run IJ:
./ij
Now you need to connect to the database. To connect you need the path as to where the database is kept. Once you have that just type: connect 'jdbc:derby:[PATH_TO_DB_HERE]';
Example:
ij> connect 'jdbc:derby:/database/db1/system/';
Now there's a few normal SQL commands you can run as it really is standard SQL:
show tables;
describe users; //users being a table name
select * from users; //users being a table name
update users SET name = 'jannie' WHERE id = 2; //users being a table name and 2 being the user id
insert into users (`id`,`name`) VALUES (2,'Jannie'); //users being a table name and 2 being the user id
Have fun! And let us know if you're struggling!
If you have any more questions I'm sure you'll find the answers right here as it helped me a lot when trying to connect: http://db.apache.org/derby/papers/DerbyTut/ij_intro.html#ij_connect
By PHPin24 @ 2011-01-11 17:34:19
|