Sei sulla pagina 1di 5

PRACTICAL QUESTION PAPER

QUESTION 1
Develop a Java application which allows user to browse the database for vcd information.

Database specification

Student is required to create the VCD database in SQL server, create the table
and insert data as in the following description: [5 marks]
- Table name: VcdRecords
Fields: Sr int not NULL , Primary Key // Sr. Number
Title nvarchar (50) NULL , // VCD Title
Star nvarchar (50) NULL , // Film Star
Ratings int NULL , // 1 for Adult Video,
// 2 for General Viewing,
// 3 for Childrens
Picture nvarchar (50) NULL // filename
- Insert data (must exactly same as in the following):
Sr Title Star Ratings Picture
1 Guns of Navarone Gregory Peck 2 1.jpg
2 Die Another Day James Bond 2 2.jpg
3 City Lights Charlie Chaplin 3 3.jpg
4 Playboy Anna Anna Nicole 1 4.jpg
5 The Tuxedo Jackie Chan 2 5.jpg
6 Britney Music Britney Spears 1 6.jpg
7 Java Bean Show Mr. Bean 3 7.jpg
8 Never Say Again James Bond 2 8.jpg
9 Greatest Plays Jordon 3 9.jpg
10 Beauty n Beast Walt Disney 3 10.jpg

Notes:
- Students are provided 10 image files (1.jpg, … 10.jpg) for testing the program.
- Students do not need to submit the database files, but if the program does not conform to the
database specification above, your work will NOT be evaluated.
- The system DNS (if it is used) must be named as VCD

Application

The Java application is developed to retrieve data from the database and present
them as in the following description and the illustration of figure 1: 25 marks]
- The label Browse Database for the application title
- Four other labels: Sr, Title, Star, Ratings
- Three textfields: reveal the data Sr, Title, Star retrieved from the database
- Three radio buttons: reveal the data Ratings retrieved from the database. They must represent
appropriately: Adult Video for Rating 1, General Viewing for Rating 2, and Childrens for Rating 3.
- Four other buttons for navigating the records in the database: Go First, Go Previous, Go
Next, and Go Last within the record set.
(The appropriate image files are provided to students.)

- One Image Icon shows the picture that is loaded from the appropriate image file.

Java Part 2 – Set 01 Page 1


Figure 1

─◊◊◊─

Biên bản chấm Java Part 2 Set 1 – ACCP2005

- Giáo viên chấm bài đã có 2 file : VCD_Data.mdf và VCD_log.ldf do bộ phận giáo vụ cung cấp
- Attach 2 file này vào SQL Server của giáo viên chấm bài

Java Part 2 – Set 01 Page 2


Click vao đây để
tìm location của 2
file : mdf và ldf

Java Part 2 – Set 01 Page 3


Tìm đến thư mục bài làm của
học viên và chọn – nhấn OK

• Khai báo DNS với tên user DNS bắt buộc là VCD

Phần 1 – Database : ( 5 điểm )

• Giáo viên chạy bài của học viên

• Nếu hiện được màn hình ứng dụng thì làm bước kế tiếp dưới đây, nếu không cho 0 điểm và
không tiếp tục chấm vì kết nối database không được.
o Sửa tên DNS trong ODBC thành : AptechVCD và chạy lại lệnh như hình trên nếu
vẩn chạy hiện ra giao diện có dữ liệu : cho 0 điểm và chấm rớt
• Nếu sửa DNS mà bài không chạy : chứng tỏ bài làm có kết nối với database thì chấm : 5 điểm
• Sau đó : sửa DNS trở lại thành VCD

Application : ( 25 điểm )

Java Part 2 – Set 01 Page 4


TextField

Chú ý : có 3 điều khiển TextField ghi chú như trên hình , hình ảnh trên

• Hiện được Form : (2 điểm)


• 6 label , 3 textfield hay textarea , 3 radiobutton , 4 button : mổi control là 0.25 điểm  0.25
x 16 = (4 điểm)
• Hiển thị đúng hình trên 4 nút navigation : mổi hình 0.5 điểm
0.5 x 4 = (2 điểm)
• Khi display form , hiển thị được data của record đầu tiên như hình trên : (3 điểm)
• Kiểm tra các radiobutton có thành Group hay không : ( 2 điểm )
o Click vào 1 radiobutton khác thì nút hiện hành sẽ không chọn
Thí dụ : click vào Adult Video thì Childrens sẽ không chọn
• Khi bấm nút : : hiển thị data ở record tương ứng trong databse – (3 điểm)
• Khi bấm nút : : hiển thị data ở record tương ứng trong databse – (3 điểm)
• Khi bấm nút : : hiển thị data ở record tương ứng trong databse – (3 điểm)
• Khi bấm nút : : hiển thị data ở record tương ứng trong databse – (3 điểm)

------------------------------------------ END ---------------------------------------------------

Java Part 2 – Set 01 Page 5

Potrebbero piacerti anche