TechieDrill Your World Of Technical Tutorials

Executing SQL from Apache Derby

11.20.2009 · Posted in Java

Execute SQL statements

If connection is established properly with the Apache Derby, you can now execute simple sequel statements from your command prompt ij tool as shown below

Creating tables using ij tool

ij> create table table_name(roll_no int, first_name varchar(10), last_name varchar(10));

Inserting values into the table

ij> insert into table_name values (197878,’jack’,'Samurai’);

ij> insert into table_name values (197823,’Corsa’,'Neo’);

ij> insert into table_name values (197823,’Corsa’,'Morpheus’);

Updating values in a table

ij> update table_name set roll_no=197776, first_name=’Bruce’ where roll_no=197878;

View the Table

ij> select * from table_name;

ij> select * from table_name where roll_no=197776;

Leave a Reply

You must be logged in to post a comment.