You are on page 1of 2

Software Engineering and Management

TIG019 - Programming
Assignment 2

Autumn 2009

Assignment 3 The Small Library Revisited

In this assignment you will get some experience in handling JDBC and creating simple graphical
interfaces using Java Swing.

The assignment is divided into three parts or programs that will give bonus points on the exam.
50% of the points will be given up to the level of pass, and the rest after attaining the passing level.

 Passing level 1 that consists of program 1 will give you 2 bonus points.
 Passing level 2 that consists of program 1 and 2 will give 4 bonus points.
 Passing level 3 that consists of program 1, 2 and 3 will give you 6 bonus points.

Program 1

Rewrite the first program from Assignment 2 so that it will use JDBC to create a database with
table(s) containing all the error-free books instead of writing the result to the NewBooks.txt file.
Everything else is exactly the same, i.e. the same error-checking must be applied. The program must
also read the file Borrowers.txt from the second program in Assignment 2 and create an borrowers
table in the database (but it shall not create any receipts for overdue books, only read the Borrowers
file). The program asks the user the name of the database to use. If the database and its tables
already exist, the tables must be emptied before new tuples are inserted. If the database doesn't exist
all the necessary tables must be created.

Program 2
The second program must both use JDBC and have a GUI created with Java Swing. The purpose of
the program is to give the librarians an interface to insert new borrowers and books into the
database. Relevant error-checking must be performed.

Program 3

The third program shall provide a graphical interface to help a borrower in borrowing books using
the tables created in the previous programs. The program asks the borrower for an ISBN number
and if the book isn't currently borrowed by someone, update the information for the book and set
the return date to 14 days later than today's date. If all books with the requested ISBN number are
currently borrowed, then an appropriate message must be printed. If the ISBN number does not
exist, an appropriate error message shall be written. A single borrower shall be given the
opportunity to borrow any number of books. An receipt must be created after the borrower has
borrowed all the books that he/she wants.

Non Functional Requirements


Your source code must follow the “Code Conventions for the Java Programming Language”, see
http://java.sun.com/docs/codeconv/index.html
Software Engineering and Management
TIG019 - Programming
Assignment 2

Autumn 2009

Your source code must be relevantly commented.

All programs must be commented with Javadoc.

Submission
Must include the following files:

 A Readme-file, containing name, personalnumber and emailaddress of the person/persons


handing in. Instructions how to run the programs. Any assumptions made should also be
stated.
 All java-files (no class-files)
 An description of all the database tables used in the programs.

You might also like