Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
─◊◊◊─
- 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
• Khai báo DNS với tên user DNS bắt buộc là VCD
• 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 )
Chú ý : có 3 điều khiển TextField ghi chú như trên hình , hình ảnh trên