Professional Documents
Culture Documents
Chapter 1
INTRODUCTION
A database is a collection of related data, typically stored on disk, and accessible by
possibly many concurrent users. Databases are generally separated into application areas.
For example,databases may contain Human Resource data, sales data,accounting data.
1. A database represents some aspect of the real world, sometimes called the miniworld
or the Universe of Discourse. Changes in the real world will be reflected in the
database.
2. A database is a logically coherent collection of data with some inherent meaning. A
random assortment of data cannot be referred to as a database.
3. A database is designed, built, and populated with data for a specific purpose. It has an
intended group of users and some predefined applications in which these users are
interested.
Databases are managed by a Database Management System.
Hospital Management System includes registration of patients, storing their details into
the system. It also includes doctor details. The software (NETBEANS and Oracle) used
has the unique facility to give a unique ID for every patient and stores the details of every
patient and staff automatically. User can search availability of a doctor and the details of
a patient using the ID.
The Hospital Management System can be logged in using the username and
password. It is accessible by the receptionist. Only they can add data into the database.
The data can be retrieved easily. The interface is very user-friendly. The data are well
protected for personal use and makes the data processing very fast.
The purpose of developing Hospital Management System is to computerize the
traditional way of keeping the record.
Structured Query Language (SQL) is a programming language used for storing and
managing data in Relational DBMS (RDBMS). SQL was the first commercial language
introduced for E.F Codd's Relational model. Today almost all RDBMS (MySql, Oracle,
Infomix, Sybase, MS Access) uses SQL as the standard database language. SQL is used
to perform all type of data operations in RDBMS.
SQL Command
SQL defines following data languages to manipulate data of RDBMS.
Command Description
insert to insert a new row
update to update existing row
delete to delete a row
merge merging two rows or two tables
Banking system: For storing customer info, tracking day to day credit and debit
transactions, generating bank statements etc. All this work has been done with the
help of Database management systems.
Education sector: Database systems are frequently used in schools and colleges to
store and retrieve the data regarding student details, staff details, course details,
exam details, payroll data, attendance details, fees details etc. There is a lot of
inter-related data that needs to be stored and retrieved in an efficient manner.
Online shopping: Online shopping websites such as Amazon, Flipkart etc., stores
product information, customer’s addresses and preferences, credit details and
provide customers with the relevant list of products based on their query. All this
involves a Database management system.
Chapter 2
RESOURCE REQUIREMENTS
2.1 Hardware Requirements
The Hardware requirements are very minimal and the program can be run on most of the
machines.
Chapter 3
DESIGN
3.1 E-R Model
ER diagram should have mainly three components namely, entity, attribute, relationship.
The notations shown in Fig.3.1.1 can be used for drawing an ER diagram.
The relational schema diagram gives the relation of one entity with another as well as the
information about the key constraints. Fig.3.2.1 shows the relational schema diagram of
student attendance management system in which the attributes that are underlined are the
primary key and the arrow line is used to represent the mapping.
Chapter 4
IMPLEMENTATION
4.1 Tables and their description
TNAME TABTYPE
ADDDOCTOR TABLE
ADDPATIENT TABLE
ADDSTAFF TABLE
USERS TABLE
Table 4.1.1 shows the list of tables used in implementation of student attendance
management system.
user_login
Table 4.1.2 Login Details
Table 4.1.2 shows the description of user_login table. This table is used to authenticate
the user who is logging into the system.
Table 4.1.3 shows the description of Doctor details. This table is used to add doctors into
a particular hospital.
Table 4.1.4 shows the description of patient details. This table is used to add patient into
a particular hospital.
Table 4.1.5 shows the description of staff details. This table is used to add staff into a
particular hospital.
CODES
Insertion code
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String Name=name.getText();
String Doctor_id=d_id.getText();
String Address=address.getText();
String PNo=phno.getText();
String Qualification=qualification.getText();
String Dep=department.getText();
String Fee=fee.getText();
String FeeVali=feevlid.getText();
String DOJ=doj.getText();
String CabinNo=cbno.getText();
String WorkingT=wrkhrs.getText();
JOptionPane.showMessageDialog(null,"welcome doctor!!");
try
{
Class.forName("oracle.jdbc.OracleDriver");
Connection
conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","ke
dar","kedar");
PreparedStatement ps =conn.prepareStatement("insert into adddoctor
values(?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,Name);
ps.setString(2,Doctor_id);
ps.setString(3,Address);
ps.setString(4,PNo);
ps.setString(5,Qualification);
ps.setString(6,Dep);
ps.setString(7,Fee);
ps.setString(8,FeeVali);
ps.setString(9,DOJ);
ps.setString(10,CabinNo);
ps.setString(11,WorkingT);
ps.executeUpdate();
new Add().setVisible(true);
this.setVisible(false);
Connection
conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","ke
dar","kedar");
Statement stmt=conn.createStatement();
String DOCTOR_NUMBER=d_id.getText();
String SQL = "DELETE FROM adddoctor where
DOCTORID="+DOCTOR_NUMBER;
System.out.println("the contents are " + SQL);
stmt.executeQuery(SQL);
JOptionPane.showMessageDialog(this,"DELETION SUCCESS");
}
catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(Add_Doctor.class.getName()).log(Level.SEVERE,
null, ex);
JOptionPane.showMessageDialog(this, ex);
}
}
UPDATION CODE
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String CurrentDoctorNumber=curr_dno.getText();
String changeDoctorNumber=new_dno.getText();
String patientNumber=pno.getText();
try
{
Class.forName("oracle.jdbc.OracleDriver");
Connection
conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","ke
dar","kedar");
PreparedStatement ps =conn.prepareStatement("update addpatient set
doctorid=? where patient_number=?");
ps.setString(1,changeDoctorNumber);
ps.setString(2,patientNumber);
ps.executeUpdate();
Chapter 5
RESULTS
Fig. 5.1.1 shows the login form used to enter into the Login page.
Fig. 5.1.4 displays the Welcome page of the hospital and allows you to add, update,
delete and view the records available in the Hospital management database.
Fig. 5.1.5 This frame allows you to add new doctors, patient and staff into the Hospital.
Fig. 5.1.6 Allows you to add new doctor into the hospital.
Fig. 5.1.7 Allows you to add new patient into the hospital.
Fig. 5.1.8 Allows you to add new patient into the hospital.
Fig. 5.1.10 Allows you to view the records of doctors, patients, staff and users.
Chapter 6
Hospital management system is developed using NetBeans 8.2. Project facilitates the
receptionist to generate the report at any time to know the overall status of the hospital,
status of a particular doctor appointment to a patient.
The system can be enhanced by including more facilities like the billing system,
impatient room allotment for the admitted patients and the stock details of the medicines
in the pharmacy. Providing such feature enable the users to include more comments into
the system.
BIBLIOGRAPHY
[2] Raghu Ramakrishnan and Johannes Gehrke, Database Management Systems, Tata
McGraw-Hill, 3rd Edition, 2003, ISBN- 0-07-123151-X.
[3] Silberschatz, Korth and Sudarshan, Database System Concepts, Tata McGraw-Hill, 5th
Edition, 2002, ISBN- 007-124476-X.