Conception of Information Systems 2005
! Before doing this and the rest of exercises you have to read the practical guidelines and subscribe your group here.
In this exercise you will learn basic concepts of JSP and JDBC. The goal of
the exercise is to learn how to work with the databases within the web context.
In short, your task will be to create, populate and query a simple database, all
this from JSP pages. Because this task involves quite some detail related to
writing JSP code and working with the J2EE environment we have provided a demo
that will help you to do the exercise more easily. In particular, you will be
able to solve the homework problem by reusing and adapting the code from the
demo application. In what follows we describe how to work with the demo (Part 1
below) and define the homework problem (Part 2). We are assuming that you have
read and understood
guidelines and thus know the meaning of "X" and "Y" below!
Part 1: The Demo Application
The demo application consists of the following three files: create.jsp.txt, select.html.txt and select-response.jsp.txt. We will first go through the steps needed to deploy the demo.
Now, the demo is accessible through the web.
However, before you access it you must start the database server. To do this
execute the command
You can now access the demo from your web browsers at the address
After accessing this page the database
will be created. It has one table (student)
in which two rows have been inserted. Go now to
select * from student into the form. Click
and you will get a table with the rows inserted. You can always run the
pointbase console by typing: /opt/j2ee01/pointbase/tools/serveroption/startconsole.sh
&. The database name is StudentsDB, login is pbpublic and
password is pbpublic.
Part 2: The Homeworks
Let us now turn our attention to the homework problem. The database you will create (let us give it the name bank) consists of four following tables.
account (account_id, type, description, balance);
customer (customer_id, name, address);
tx (tx_id, account_id, amount, description);
customer_account (customer_id, account_id);
Their primary keys are account_id, customer_id, tx_id and the pair (customer_id, account_id) respectively. The fields account_id in the tx and customer_account tables refer to account_id in the account table, while customer_id in the customer_account refers to customer_id in the customer table. The types of the fields are arbitrary, you can choose any types you wish. Please refer to the pointbase documentation (see practical guidelines) for PointBase SQL specifics.
As far as the JSP part of the problem is concerned, we want to have a fully operational application to handle this database. This means:
In total you should produce six pages - two of them can be pure HTML pages (one of them is the index page) and the other four must be JSPs. To see this clearly, just visit the index page.
Your assistant for this exercise is Gleb Skobeltsyn