This example demonstrates how to use the basic Java SQL API. We assume a simple student database that has a single table: CREATE TABLE students ( regno int(11) NOT NULL default '0', lastname varchar(32) NOT NULL default '', firstname varchar(32) NOT NULL default '' ); The simplest database is sqlite, a database that stores everything in a single file and which is very popular for storing small amounts of structured data that does not need much of concurrent access or access over the network. To create or use a database, simply run from the shell $ sqlite3 students.db where 'students.db' is the file storing the students database. To create the students table, simple type the SQL create statement show above into sqlite3. To insert a row into the SQL table, type the following SQL statement into sqlite3: INSERT INTO students(lastname, firstname, regno) VALUES ('Foo', 'Bert', 1234); To retrieve the content of the table (see definition above), simply run the following shell command: $ sqlite3 --column --header students.db 'select * from students' regno lastname firstname ---------- ---------- ---------- 1234 Foo Bert To delete the student with the registration number 1234, simple run: $ sqlite3 students.db 'delete from students where regno=1234' Note: sqlite does not support all functions that 'bigger' SQL database engines support. For example, sqlite does only support TYPE_FORWARD_ONLY in result sets.