Quick disclaimer: we started with a proposal, which included the introduction, objectives, scope, flowchart, and prototypes. After the presentation, we were given the go-ahead to build the system using NetBeans IDE and Microsoft Access
Introduction
Managing data can be a real headache, especially when time is tight. The Blood Donation System helps to keeps track of everything from donors and patients to blood bank supplies. It’s all about making sure the right info is available quickly to help save lives and do it with less hassle. Efficiency and life-saving, all in one system.
Objectives
- Manage patient and donor records with ease.
- Quick access to blood type distribution.
- Add or remove records effortlessly.
- Search for specific blood type records.
- Easily check the amount of available blood.
Scope
- Create an account with personal details (Name, Email, Phone, etc.).
- Manage patient records (Name, ID, Blood Group, Disease, etc.).
- Manage donor records (Name, ID, Blood Group, Medical Report, etc.).
- Manage blood bank records (Name, Address, Donor names, Contact info).
- Search and sort blood donation records.
- View charts from the app’s data.
Flowchart

Database
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
con = DriverManager.getConnection("jdbc:ucanaccess://C:\\path\\to\\your\\database.accdb");
is used to connect to a Microsoft Access database using the Ucanaccess JDBC driver.
Print Screens and Code
1. Authentication



2. Dashboard




Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
con = DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\MSI-PC\\Desktop\\eve\\Y1S3\\Object Oriented Programming
\\Assignment\\Assignment.accdb");
pst=con.prepareStatement("select count(Blood_Bank) from Donars");
rs = pst.executeQuery();
rs.next();
int count=rs.getInt(1);
int s=count;
pst=con.prepareStatement("select count(Patient) from Donars");
rs = pst.executeQuery();
rs.next();
int count1=rs.getInt(1);
int t=count1;
pst=con.prepareStatement("select count(*) from Donars");
rs = pst.executeQuery();
rs.next();
int count2=rs.getInt(1);
int u=count2;
int totalrest=u-s-t+1;
total3.setText(totalrest+" record(s)");
Donars
table
after excluding those that have values in the Blood_Bank
or Patient
columns. The result is displayed in the UI element total3
.


public void tableupdate(){
int c;
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
con = DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\MSI-PC\\Desktop\\eve\\Y1S3\\Object Oriented Programming
\\Assignment\\Assignment.accdb");
pst=con.prepareStatement("select * from Patient");
rs = pst.executeQuery();
ResultSetMetaData rsd= rs.getMetaData();
c=rsd.getColumnCount();
DefaultTableModel dft = (DefaultTableModel)jTablePatient.getModel();
dft.setRowCount(0);
while(rs.next()){
String id=rs.getString("ID");
String name=rs.getString("PName");
String passport=rs.getString("Passport");
String phonenumber=rs.getString("Phone_Number");
String date=rs.getString("Date");
String bloodgroup=rs.getString("Blood_Group");
String disease=rs.getString("Disease");
String tbData[]={id,name,passport,phonenumber,date,bloodgroup,disease};
DefaultTableModel tblModel=(DefaultTableModel)jTablePatient.getModel();
tblModel.addRow(tbData);
}
}
is used to update the data displayed in a Java GUI table and update associated records from a Microsoft Access database using JDBC (Java Database Connectivity). The code specifically deals with data for Donars, Patients, and BloodBanks every time user updates the table.
3. Add Data

private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
con=DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\MSI-PC\\Desktop\\eve\\Y1S3\\
Object Oriented Programming\\Assignment\\Assignment.accdb");
pst=con.prepareStatement("insert into BloodBank(ID, Company_Name, Address, Contact_Number)values(?,?,?,?)");
pst.setString(1,id);
pst.setString(2,company);
pst.setString(3,address);
pst.setString(4,ctcnum);
pst.executeUpdate();
pst=con.prepareStatement("UPDATE Donars set Blood_Bank=? where ID=?");
pst.setString(1,company);
pst.setString(2,id);
pst.executeUpdate();
JOptionPane.showMessageDialog(this,"Record Saved");
}
After connected to the database, the BloodBank
table which then updates the Donars
table.
Conclusion
This project was my first adventure in building a system from scratch using Java, NetBeans IDE, and Microsoft Access as the database. I learned so much along the way and am pretty proud of how it turned out.
Tech Stack


