Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
93 views

System Analysis and Design Lab 7: Question 1: Part A

This document provides instructions for multiple questions related to a system analysis and design lab assignment. It includes: 1) Creating a form with panels for number addition, subtraction, division and multiplication. 2) Creating tables for patients and doctors with a one-to-many relationship and inserting sample data. 3) Developing an application to insert data into the doctor table, including validation of gender values. 4) Modifying the application to allow retrieving a doctor's data by ID.

Uploaded by

007wasr
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

System Analysis and Design Lab 7: Question 1: Part A

This document provides instructions for multiple questions related to a system analysis and design lab assignment. It includes: 1) Creating a form with panels for number addition, subtraction, division and multiplication. 2) Creating tables for patients and doctors with a one-to-many relationship and inserting sample data. 3) Developing an application to insert data into the doctor table, including validation of gender values. 4) Modifying the application to allow retrieving a doctor's data by ID.

Uploaded by

007wasr
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

System Analysis and Design Lab 7

Question 1: Part A In question1 in the last sheet: Put the form contents (Number1and Number2 and Result labels. And the 3 text fields) in a Panel called Number Addition and put in it the Add button and another button called Clear to clear the content of text fields..Outside the panel put a button called Exit to close the whole form, as shown in the next form

Use the following libraries: import java.sql.*; import javax.swing.*; Question 1: Part B Modify the above program to include 4 panels for the Addition, Subtraction, Division and Multiplication of the two numbers

Question 2: Part A Create 2 tables Patient and Doctor where each patient treated with one doctor and the doctor treats many patients. Add the appropriate attributes in each table. Insert 2 records in each table.

Question 2: Part B Create a java application that asks the user for the doctors ID, Name, Age, and Gender (where the Gender attribute is presented by combo box) and then a new row is inserted in the Doctor table. Note that you have to make a panel called Doctor Data as shown:

Reminder: The following code will be used for the connection between the application side and the database created: Connection con = null; Statement st= null; ResultSet rs= null; try { con = DriverManager.getConnection("jdbc:derby://localhost:1527/Databasename", "username", "password"); st= con.createStatement(); rs= st.executeQuery("your Select statement is placed here ); while (rs.next()) { //code for retrieving the result } con.close(); } catch (Exception e) { System.err.println("Exception: "+e.getMessage()); }

Note1: Add check constraint to the gender to make sure that it takes the values Male or Female

Note2: to insert the gender selected from the combo box, you have to cast from object (selected item in the combo box) to string (specified data type of gender attribute in the Doctor table).

Question 2: Part C Modify the program in part B to allow user to retrieve the doctors data by specifying his ID as shown :

Note3: to fill in the combo box with table data you have to initiate an object from the DefaultComboBoxModel class.

You might also like