Java 3680
BCIS 3680 Enterprise Programming Assignment 5 ‐ 1
BCIS 3680 Enterprise Programming Instructor: Dr. Andy Wu
Assignment 5
Now you will build database‐driven pages on the JHealth site. You will modify the existing
main.jsp and doctors.jsp, and create another JSP file, doctordetail.jsp.
1. Make a copy of your deployment folder for Assignment 4 and rename it for Assignment 5.
2. Start MySQL and once you are logged in to MySQL, create a new database by the name
<YourLastname><YourFirstInitial>, e.g., Justin Case would create casej.
3. Download the two script files for the clinic database to use for this assignment.
4. In MySQL, use the source command to run createclinic.sql and then addclinic.sql. This should create three tables ‐ doctor, patient, and visit ‐ and populate those tables with data.
5. Run show tables to make sure that you see all the three tables.
6. For each table, run the select * command to check whether you have data in the table. For example, run select * from doctor and you should see six rows of data:
7. The doctors.jsp page and every new JSP file from now on should use JSP directives to include
the header and footer. The title bars of the JSP files should be specific to the nature of the
page, instead of a generic title.
BCIS 3680 Enterprise Programming Assignment 5 ‐ 2
8. In login.htm, change the radio button that is pre‐selected when the page is loaded from system admin to staff. This will make your code testing easier:
9. Again, a successful login will take the user to main.jsp. On surface, the page looks exactly the same like in Assignment 4. But behind the scene, modify the code of this page so that a session
variable is created to store the user’s username.
10. Now, when the user clicks the Click here link in main.jsp, doctors.jsp will show up and display information about the doctors. Take all necessary actions (the lib subfolder in WEB-INF and its content, database connection code in doctors.jsp, etc.) so that doctors.jsp is able to connect to the database and retrieve info from there.
BCIS 3680 Enterprise Programming Assignment 5 ‐ 3
Specifications of this page:
The username of the logged‐in user appears after the wording Report prepared for (it doesn’t have to be colored).
For each doctor, add a radio button at the beginning of his/her row. Set the value attribute of the radio button to the doctor ID (the did column in the doctor table) of that doctor. Name the radio button group selDID. No further coding is needed at this point.
For each doctor, display his/her degree(s), education, and specialty as retrieved from the doctor table. A doctor’s years in practice is calculated as 2020 minus the year in which he/she graduated from medical school (the gradyear column in the doctor table). If a doctor is accepting new patients, then display Yes in the Accepting New Patients column of the HTML table; display No if he/she is not. The values in the newpatient column in the doctor table indicates whether a doctor is accepting new patients (1 means yes; 0 means no). For each doctor, display his/her full name in one column (instead of first name and last name in their own columns). Also make this full name a clickable hyperlink, with
destination being doctordetail.jsp and append a manually crafted query string that will pass the doctor’s last name to that page.
11. The name of each doctor is displayed as a hyperlink. When clicked, doctordetail.jsp should appear. It contains the last name of the doctor in both the page title and the heading of the body
text. For example, clicking the doctor Pete Armstrong, the title displayed in doctordetail.jsp will be Dr. Armstrong and the first line of text (heading) is Information on Dr. Armstrong. The page simply says Information on this doctor will be available soon.
BCIS 3680 Enterprise Programming Assignment 5 ‐ 4
Submission
Due Date: Monday, April 27, 2020 (11:59 PM)
Below are steps to follow for submission:
Submit your assignments only through Canvas. Assignments submitted to the instructor or grader by email will NOT be graded, unless you
are instructed to do so.
Zip the folder into 3680‐HW5‐YourLastName‐YourFirstName.zip (RAR is fine too). Submit the zip file as an attachment on Canvas. Before the assignment is due, you may resubmit your work for unlimited times. Simply
attach a new version of your assignment. Only the attachment with the latest timestamp will
be graded.
Failure to comply with these requirements will cause point deduction.