0% found this document useful (0 votes)
23 views55 pages

Developing Inventory Management System Application For Small Retail Stores Using Data Structures in Java

The document outlines a research project focused on developing an Inventory Management System Application for small retail stores using Java and data structures. It addresses the challenges faced by retailers in managing inventory effectively and aims to simplify the process while minimizing human errors and ensuring data security. The project is presented by students from the University of Negros Occidental – Recoletos as part of their coursework in Data Structures and Algorithms.

Uploaded by

Maxil Urocay
Copyright
© © All Rights Reserved
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)
23 views55 pages

Developing Inventory Management System Application For Small Retail Stores Using Data Structures in Java

The document outlines a research project focused on developing an Inventory Management System Application for small retail stores using Java and data structures. It addresses the challenges faced by retailers in managing inventory effectively and aims to simplify the process while minimizing human errors and ensuring data security. The project is presented by students from the University of Negros Occidental – Recoletos as part of their coursework in Data Structures and Algorithms.

Uploaded by

Maxil Urocay
Copyright
© © All Rights Reserved
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/ 55

UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS

COLLEGE OF INFORMATION TECHNOLOGY


PAASCU Accredited, CISCO Local Academy,
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Developing Inventory Management System Application for Small Retail Stores using Data

Structures in Java

A Research Project

Data Structures and Algorithms

Presented to the Faculty of the

College of Information Technology

University of Negros Occidental – Recoletos

In Partial Fulfillment of the

Requirements for the Course

CIT10333P

By:

Lance Seman

Chyle Talledo

Josh Valenzuela

December 2024

College of Information Technology

i
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

ACKNOWLEDGEMENT

We would like to express our gratitude for the individuals and organizations who have

provided us with assistance and support throughout the course of the creation and development

of this paper.

First, we would like to thank our advisor, Maxil S. Urocay for his guidance and feedback

that helped complete this research. We are grateful for his patience and continuous support

throughout the development of this research.

We extend our sincere gratitude to the Dean Elmer J. Haro and the faculty of the College

of Information Technology at the University of Negros Occidental - Recoletos, for providing us

with the knowledge and the learning environment that aided us in this research.

We would also like to thank our families for their unwavering support. Their

encouragement and financial support helped us in completing this research. We are also thankful

for our classmates and friends who provided assistance and suggestions for our research.

Lastly, we are thankful to God for the protection, guidance and for providing us with the

knowledge and fortitude to finish the research.

College of Information Technology

ii
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

APPROVAL SHEETS

The research paper here is attached, entitled “Developing Inventory Management

System Application for Small Retail Stores using Data Structures in Java,” was prepared

and submitted by Lance Seman, Chyle Talledo and Josh Valenzuela in partial fulfillment of the

requirements for the course Data Structures and Algorithms is hereby accepted.

Maxil S. Urocay

CIT Faculty / DSA Adviser

Date Signed:

Elmer J. Haro, Ph.D.

Dean, College of Information Technology

Date Signed:

College of Information Technology

iii
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

ABSTRACT

As technology improves, businesses are increasingly relying on systems to speed up

processes and operations such as the POS system that manages sales and inventory. This helps

businesses reduce cost, improve decision-making (Cote, 2015). An effective inventory system

ensures that products are always available while minimizing excess inventory and preventing

running out of stock.

However, many retailers face challenges in affording and operating such systems.

Additionally, issues such as tracking expiration dates can lead to the sale of expired products

which is harmful to the customer (Wedasinghe et al., 2021). To address this, the researchers

develop an application using Java that aims to simplify inventory management focusing on small

retail stores.

This research tackles the problems faced in the development of an inventory management

application. As well as the different tools, techniques and libraries used for the development of

the application. The methods used as well as the findings and recommendations in this research

provides a foundation for future researchers delving in a similar topic as to inventory

management systems.

College of Information Technology

iv
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

TABLE OF CONTENTS

ACKNOWLEDGEMENT............................................................................................................ ii

APPROVAL SHEETS..................................................................................................................iii

ABSTRACT...................................................................................................................................iv

TABLE OF CONTENTS...............................................................................................................v

TABLE OF FIGURES..................................................................................................................vi

GLOSSARY OF TECHNICAL TERMS.................................................................................. vii

CHAPTER I................................................................................................................................... 1

INTRODUCTION..................................................................................................................... 1

1.2 STATEMENT OF THE PROBLEM..............................................................................2

1.3 OBJECTIVES................................................................................................................ 3

1.3.1 Increase inventory management effectiveness......................................................3

1.3.2 Reduce human errors............................................................................................ 4

1.3.4 Simplify inventory managing............................................................................... 4

1.4 SIGNIFICANCE OF THE STUDY.............................................................................. 5

1.4.1 Retail store owners................................................................................................5

1.4.2 Employees.............................................................................................................5

1.4.3 Customers............................................................................................................. 6

1.4.4 Future Researchers................................................................................................6

College of Information Technology

v
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CHAPTER II..................................................................................................................................7

REVIEW OF RELATED LITERATURE..................................................................................7

2.1 HISTORICAL CONTEXT............................................................................................ 7

2.2 CURRENT TRENDS.................................................................................................... 9

2.3 RELATED WORKS.................................................................................................... 10

CHAPTER III.............................................................................................................................. 12

METHODOLOGY.................................................................................................................. 12

3.1 DATA STRUCTURES AND ALGORITHMS............................................................12

3.1.1 Array................................................................................................................... 12

3.1.2 Queues.................................................................................................................12

3.1.3 LinkedList........................................................................................................... 13

3.2 DESIGN AND ANALYSIS.........................................................................................14

CHAPTER IV.............................................................................................................................. 17

IMPLEMENTATION.............................................................................................................. 17

4.1 TOOLS AND TECHNIQUES..................................................................................... 17

4.1.1 Java..................................................................................................................... 17

4.1.2 Java Swing.......................................................................................................... 17

4.1.3 HyperSQL/HSQLDB..........................................................................................18

4.1.4 Apache Netbeans IDE.........................................................................................18

College of Information Technology

v
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

4.1.5 LGoodDatePicker............................................................................................... 19

4.2 RESULTS.....................................................................................................................19

4.3 COMPARISONS......................................................................................................... 28

4.4 LIMITATIONS........................................................................................................ 29

CHAPTER V................................................................................................................................ 30

RESULTS AND DISCUSSIONS............................................................................................ 30

5.1 FINDINGS/ANALYSIS.............................................................................................. 30

5.1.1 How can we make inventory managing quicker and more effective?................ 30

5.1.2 How can we reduce and minimize human errors in inventory management?.... 30

5.1.3 How do we ensure the security and privacy of the store’s data?........................ 31

5.1.4 How can we make managing inventory simpler and easier?..............................31

5.2 CONCLUSION............................................................................................................31

5.3 RECOMMENDATION................................................................................................32

REFERENCES.............................................................................................................................34

APPENDICES.............................................................................................................................. 36

CURRICULUM VITAE.............................................................................................................. 45

College of Information Technology

v
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

TABLE OF FIGURES

Figure 1: Program Flowchart......................................................................................................... 14

Figure 2: Login Interface............................................................................................................... 16

Figure 3: Register and Login Interfaces.........................................................................................20

Figure 4: Dashboard Interface....................................................................................................... 21

Figure 5: Urgent Warnings Interface............................................................................................. 22

Figure 6: Product List Interface..................................................................................................... 23

Figure 7: Pending Changes Dialog Interface................................................................................. 24

Figure 8: Change Logs Interface....................................................................................................25

Figure 9: Add and Edit Product Interface...................................................................................... 26

Figure 10: Date Picker Interface.................................................................................................... 27

Figure 11: Information, Error and Success Dialog Interfaces....................................................... 27

Figure 12: Confirm Dialog Interface............................................................................................. 28

College of Information Technology

vi
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

GLOSSARY OF TECHNICAL TERMS

Small Retail Stores - a store that sells goods to customers in a physical location that operates on

a smaller scale compared to larger retail stores such as malls.

Inventory Management - managing of inventory to ensure that the quantity of products is

available at the right time, minimizing excess inventory and preventing stock outs.

Inventory Management System - allows an employee or user to track and record products and

their details such as their stock.

Traditional Inventory Management - manual and by hand inventory record-keeping usually

written on paper.

Database - manages and stores data in tables and provides useful features such as fast retrieval

and security.

SQL Statements - an instruction sent to the database to perform operations on data that uses

Structured Query Language.

User Interface (UI) - sometimes called the interface, it is a window or a panel that allows the

user to interact or use the application the user interface is implemented in.

College of Information Technology

vii
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CHAPTER I

INTRODUCTION

As we transition and evolve into a more digital society, processes and transactions are

now more convenient and faster. Both customers and businesses alike have started to rely more

on computers and the internet. Specifically, businesses have started to use systems which makes

it easier for them to conduct business. Systems like the POS System which manages sales and

inventory help reduce manual work, human mistakes and speeds up the process of managing

inventory and sales (Lal et al., 2018). This system is used by businesses that deal with sales and

inventories, such as restaurants, grocery stores, convenience stores, and many others. It helps

businesses reduce costs and improve decision making (Cote, 2015). It improves the customer

experience by hastening the sale process (Girsch-Bock, 2013). Deployment of such systems

leads to higher sales, reduced expenses and provides an increase in overall profitability of stores

that not only deploy the technology but also know how to use it (Dion, 2003).

Inventory management is an important function for any organization that deals with

physical goods such as in retail. The goal of inventory management is to ensure that the quantity

of products is available at the right time, minimizing excess inventory and preventing stock outs.

Due to local and global competition all companies strive to effectively manage their inventory

creating a need and use for inventory management systems (Madamidola et al., 2017). However,

not all retailers have the cash and skills needed to own or operate such applications (Seethamraju

et al., 2018). Also, one of the many issues experienced by retail stores is difficulty in tracking

College of Information Technology

1
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

expiration dates leading to selling of expired or close to expiration products (Wedasinghe et al.,

2021). To address this gap, we intend to develop a free application that is easy and simple to use

specifically designed for inventory management in small retail stores that utilizes java. This

application provides comprehensive features such as inventory management and tracking

expiration dates for the products. Our goal is to streamline inventory management and make the

store experience smoother and more effective for both store owners and customers.

In storing the product data the researchers will use the SQL database system HyperSQL

or HSQLDB. It supports SQL statements and has useful functions that can help manage the data

our application will use. In a study, HSQLDB outperformed others such as H2, Apache Derby

and SQLite in most scenarios tested (Hassan et al., 2018). The researchers intend to use Array

where they contain attributes of products such as name, id, quantity and price. It is traversable

using for-loops and simple in terms of accessing its elements and the element’s attributes. It

allows quick random access to elements as long as you are using an index. Queues will be used

to store SQL strings to be performed when the user intends to. It will ensure that the SQL

statements are performed in the same order they were made by the user. Linked List will be used

to store history of changes in product data. It automatically resizes according to its contents and

maintains a linear structure useful for traversing all the data.

1.2 STATEMENT OF THE PROBLEM

With increasing access and demand to products, tracking inventory by hand is becoming

more time consuming. Thanks to technological advancements, inventory management can now

College of Information Technology

2
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

be handled digitally on computers which gave rise to digital inventory management systems.

However, not all retailers implement such systems due to various reasons. Thus, this study aims

to use Java to develop an inventory management system application for small retail store owners.

It seeks to answer the following questions:

1. How can we make inventory managing quicker and more effective?

2. How can we reduce and minimize human errors in inventory management?

3. How do we ensure the security and privacy of the store’s data?

4. How can we make managing inventory simpler and easier?

1.3 OBJECTIVES

This study’s goal to develop a java application for small retail stores that aims to provide

the following benefits and function:

1.3.1 Increase inventory management effectiveness

Manual tracking of inventory has multiple downsides such as high time consumption,

error-prone and high risk of data loss when losing the logbook. An application that solves these

problems along with additional features such as low inventory and expiration notification is

needed. An inventory management system allows an employee or user to track and record

products and their stock to ensure that there is no unexpected low stock or overstock to occur

(Chin et al., 2023).

College of Information Technology

3
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

1.3.2 Reduce human errors

Human errors can occur especially on manual tracking of inventory (Sheng et al., 2023).

The application implements user interfaces designed to reduce human tabulating errors. The user

is given multiple confirmations before making changes to the inventory. The user can review if

the change is correct and can cancel the changes if the changes are incorrect.

1.3.3 Provide and increase security and privacy of data

The application will use login systems which means only authorized users can access it.

This hides the data from unauthorized people. Changes to the data or the inventory can only be

made by authorized users. This is further enhanced by the protection the device the application is

running on uses, especially if the device is password protected. Controlling access to the data

ensures data security by protecting private information against unauthorized access (Mohamed et

al., 2022).

1.3.4 Simplify inventory managing

Using the Java Swing library our application will implement tables and buttons in order

to help users do inventory management more straightforward and easier. It can also act as a way

for us to get inputs from the user such as selected rows from tables and text from text fields.

Allowing for easier date selection and allows the user to make changes to the inventory when

needed.

College of Information Technology

4
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

1.4 SIGNIFICANCE OF THE STUDY

Inventory management is beneficial for most businesses. Proper inventory management

can give you an advantage against other businesses. This study focuses on small retail stores by

providing them with a digital inventory management system. The end goal of this research is an

inventory management Java application which provides a digital way for small retail stores to

properly manage their inventory and stock. It aims to provide significance to the following

persons:

1.4.1 Retail store owners

It is important for stores to use inventory management systems because it consistently

keeps track of item stock which helps improve inventory decisions and reduce inventory related

costs (Cote, 2015). If proper inventory management is implemented it can lower costs and

improve profitability for the business (Frye, 2022). Not only does it save them time and money it

can also help them avoid human errors and improve their business as a whole by doing inventory

management digitally. (Deshmukh, 2022).

1.4.2 Employees

It benefits both the customer and the employees as manual processes are more time

consuming compared to electronic systems which quickens the process (Girsch-Bock, 2013). Not

only that, it can also help reduce human related errors when managing inventory.

College of Information Technology

5
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

1.4.3 Customers

Quicker processing saves customers time and increases their satisfaction towards the

business. On the other hand, if inventory is mismanaged it can lead to dissatisfied consumers and

slower sales (Mehar et al., 2023).

1.4.4 Future Researchers

The findings of the study contribute to the existing body of knowledge in software

development. It can serve as a reference or foundation for future researchers intending to create a

similar study. It can provide them with additional information and knowledge that could be

useful for their study.

College of Information Technology

6
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CHAPTER II

REVIEW OF RELATED LITERATURE

Related studies help the researchers in further understanding about data structures and

algorithms and the development of inventory management systems. This section contains the

summarized results of previous studies that are related to developing inventory management

systems. It discusses the different tools and technologies used in inventory management systems

as well as the limitations and future improvements of the studies.

2.1 HISTORICAL CONTEXT

Algorithms are used by people everyday. Following instructions, commands and cooking

recipes are examples of this. They are step-by-step instructions that are performed in order to

achieve a goal. The word algorithm derives directly from al-Khwarizmi, who is a 9th century

mathematician. In the 12th century, his work and others were translated from Arabic into Latin

which gave the words algorithms or algorismus or algorithmus meaning particular routine

arithmetic procedures. According to the 15th edition of Britannica, the term algorithm is

described as a systematic mathematical procedure in a finite number of steps that produces the

answer or solution to a problem which is similar to today’s definition (Chabert, 1999).

Beginning in the 1810s, Charles Babbage had a vision of mechanically computing

numbers and tables. This machine is now known as the “Analytical Engine” which was the first

true representation of the modern computer. It was a machine that used punch cards to perform

arithmetic operations. Ada Lovelace began working as an assistant to Babbage and during her

College of Information Technology

7
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

work with Babbage, she designed the first computer algorithm, which could compute Bernoulli

numbers (Evans, 2018).

During 1936, Alan Turing invented a theoretical device that was called the “a-machine”

or the automatic machine (Hodges, 2012). These were machines that were not limited to specific

tasks and were later called the “Turing Machine”. Interest and investment in computers increased

during World War 2. It was used for tasks like calculating bomb trajectories and breaking

encryptions. Towards the end of the war in 1945, John von Neumman wrote a paper built on

Alan Turing’s ideas to describe an approach for computers to treat instructions the same way

they treat data. This meant that computers no longer do specific tasks but instead could take in

instructions to perform any task. This was called the von Neumann architecture which modern

devices still use today. Neumann was also the inventor of the merge sort algorithm (Knuth,

1987). In the 1950s and 1960s, many algorithms such as Dijkstra’s algorithm, Quicksort,

Heapsort and others were developed. Data structures such arrays, hash maps and linked lists and

others were also developed during this time. During the 1960s and 1970s, Donald Knuth

published a collection of books that taught fundamental theories of computer programming

which was called the “The Art of Computer Programming”. The book contained descriptions of

data structures and algorithms and its analysis. Knuth popularized the asymptotic notation which

is used when analyzing the efficiency or time complexity of algorithms (Karp, 1986).

As time passed, computers got more powerful and efficient while also getting smaller.

Programming languages evolved from machine to high level readability which allowed more

people to get into programming. Innovations to data structures and algorithms gave rise to

College of Information Technology

8
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

devices such as smartphones and technology like the internet and the world wide web. It brought

positive impacts such as enhanced communication, increased access to information and

economic growth. However, it also brought negative impacts such as privacy and cybersecurity

threats, job displacement and ethical considerations particularly driven by innovations in

Artificial Intelligence and machine learning (Joseph et al., 2023).

2.2 CURRENT TRENDS

Recent technological advancements have impacted the field of inventory management

due to their ability to provide increased flexibility and reliability. Findings reveal that almost all

industries have benefited from the use of inventory management systems through savings in cost

and time (Ahmad et al., 2022).

A review finds that SMEs or Small and Medium-Sized Enterprises do not invest

resources in sophisticated systems; instead, a simple Enterprise Resource Planning (ERP) system

or even programs such as Excel or manual inventories are mainly used. Current tendencies in

inventory management are primarily focused on developing tools that enable retailers to control

product location, detect loss, manage stock, reduce costs and improve service. The study also

acknowledges that not all retailers can employ these technologies because of their high cost of

implementation and maintenance creating a need for cheaper or low investment alternative

software. (Macas et al., 2021).

A study that also employs inventory management systems used web-based languages like

HTML, CSS, PHP and MySQL. In other words it is a web-based application that needs an

College of Information Technology

9
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

internet connection in order to function (Chin et al., 2023). A similar study involving the

development of a web-based intelligent inventory management system also used HTML and

PHP along with Java and MySQL (Madamidola et al., 2017). Our application will use Java

which is platform-independent and does not require internet access which means that all data and

operations will be performed and stored locally in the device.

2.3 RELATED WORKS

A study developed an inventory management system using HTML, CSS, JavaScript and

PHP that aimed to provide free software that can be used by small and medium retail stores that

still manage their inventory manually. The system performed general inventory management

activities with additional features such as feedback and more. The study found many limitations

within their system such as limited inventory locations. Their system can only store and handle

one inventory location and could not support multiple locations. The system did not support

online payment transactions such as credit and debit cards. Lastly, the system did not support

IOT features such as barcode scanning. They also had future enhancements like a deeper search

function and support for product pictures for better product identification. Lastly, as an additional

feature for feedback they intend to make a module that can link feedback with the products that

were purchased (Chin et al., 2023).

A similar study also developed a mobile inventory management application. It focuses on

businesses who experience challenges such as inefficiency, human error and data loss due to

traditional inventory management processes. The application made managing inventory more

College of Information Technology

10
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

efficient, reduced human error and data loss. A survey the study conducted found that the system

lacked clarity in terms of visual elements and when communicating error messages. In the future,

advanced analytics to forecast real-time demands and inventory optimization can be added

(Sheng et al., 2023).

In another study developing an inventory management application utilized Tkinter from

Python and Sqlite to be used in a Raspberry pi. It had a login system to ensure data privacy and

allowed the tracking of changes in products such as who withdrew and when it was withdrawn. It

had inventory management functionalities such as viewing and adding products. It also

supported multiple accounts through the use of twin dedicated login options, one for the user and

one for the administrator. Future inclusions would be RFID scanners and fingerprint sensors for

added security and an automatic emailing system for notification of low product quantity

(Yuvaraj et al., 2020).

A study developing a web-based intelligent inventory management system using PHP,

Java, MySQL and HTML. Similar to other studies it had a login system but with different access

privileges for each user and basic inventory operations such as creating, reading, updating and

removing items or products. Since it is an intelligent system it uses a fuzzy logic approach to

produce analysis and reports through graphs and summaries of sales activities and re-order

levels. It supported multiple warehouse locations for business operations using the web

(Madamidola et al., 2017).

College of Information Technology

11
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CHAPTER III

METHODOLOGY

In this chapter, the researchers discuss the data structures and algorithms that were used

in this study in order to store the inventory data. This section also contains the program flowchart

detailing the flow of the processes in the system as well as the discussion of the main interface of

the application. This provides the readers with a clear explanation of the applications usage and

functions.

3.1 DATA STRUCTURES AND ALGORITHMS

3.1.1 Array

Arrays were used to store the contents of a product’s attributes such as its name, quantity,

expiration dates and others. Vectors were also used for the table model that stores product data

for the table that displays the product list and its attributes. Vector is a dynamic array that can

dynamically resize.

3.1.2 Queues

Queues were used to store SQL statements that are made when the user performs

operations in the application. It is used to ensure that statements were executed in the same order

that the user made them. It also allows the user to decide whether to save or cancel the changes

made.

College of Information Technology

12
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

3.1.3 LinkedList

LinkedList was used to store the history of changes made in the inventory. It includes the

changes to specific rows and the timestamp of when the change was made. It highlights the

changes made to the values of a row’s attributes. It is also used when Queues are implemented in

the application.

3.1.3 HashMap

HashMaps were used to store indexes of the expired or low stock products. HashMaps

allow instant access to data as long as you have the right key. This was used to identify which

products in the product list table were present in the expired and low stock table. Identifying

which products were expired or low stock allows us to paint the rows of the product list table

according to their status.

College of Information Technology

13
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

3.2 DESIGN AND ANALYSIS

Figure 1: Program Flowchart

College of Information Technology

14
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

3.2.1 Registration

When the program is launched it checks whether there is a database existing for an

inventory. If it does not detect an existing database file it will output a registration interface

where the user can insert the credentials such as the username and password the user will use to

access the inventory management system. However, if a database does exist then it proceeds to

logging in directly.

3.2.2 Login

Before the user gains access to the inventory management system, it is needed to input

the correct login details or credentials which is the username and password the user used during

registration. It will issue alerts if the user inputs incorrect credentials but if successful it proceeds

to the main interface.

3.2.3 Main Interface

After successful login, the inventory database is queried for the inventory data which is

converted into a table model and the user is shown the dashboard interface that contains a

summary of the product statuses. Statuses such as whether they are expired or if they are low on

stock. Products with expired or low on stock are shown in the urgent warnings section. In the

warnings section the user can identify which products to restock or renew. Once identified the

user can proceed to the products list section where they can perform operations such as adding,

editing and deleting products. Adding and editing products outputs another interface where they

can input the products name and other details such as its expiration date, stock and threshold.

College of Information Technology

15
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Performing operations stores the SQL statements in a queue where it is held until the user

decides to either save or cancel the changes. Saving the changes will execute the SQL statements

to the inventory database while cancellation of changes will clear the queue and no changes will

be made. This continues in a loop until the user decides to not make any more changes which

ends and closes the application.

Figure 2: Login Interface

To access the inventory the user needs to input the correct credentials in order to

successfully login. The credentials being the username and password which the user specifies

during the registration when launching the program for the first time. This ensures data security

by not allowing unauthorized access (Mohamed et al., 2022).

College of Information Technology

16
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CHAPTER IV

IMPLEMENTATION

In this chapter, the researchers discuss the detailed implementation of the study.

Specifically, it discusses the different tools and techniques used during the process of

development of the application including the libraries used to enhance the functionality of the

application. It contains all the interfaces used in the application and discusses them

comprehensively in relation to their function and how they benefit the user.

4.1 TOOLS AND TECHNIQUES

4.1.1 Java

Java is a high-level programming language that is object-oriented and was created in

1995. It is known for its simplicity, platform independence, portability, security, multi

multi-threading which makes it an ideal programming language for developing complex and

high-performance software. Java has a large community of developers and has a rich standard

library that is useful for software development like the Swing library for graphical user interface.

Java’s various features and libraries make it a good choice for developing our application.

(Martinez et al., 2023).

4.1.2 Java Swing

Swing is a Java library used to create graphical user interfaces for java applications. It is

built on top of the Java AWT library but it provides lightweight components. It provides

College of Information Technology

17
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

powerful components such as tables, scroll panes and others which are useful for the functions of

our application.

4.1.3 HyperSQL/HSQLDB

HSQLDB or HyperSQL Database is the leading SQL relational database system written

using Java. It offers features such as a small, fast and multi-threaded and transactional database

engine with support for in-memory and disk-based tables and can be launched in embedded and

server mods. In a study, HSQLDB outperformed other database management systems such as

H2, Apache Derby and SQLite in most scenarios tested (Hassan et al., 2018). HSQLDB is

completely free to use and uses a BSD license allowing for commercial use. It will allow the

application to create, read, update and delete data in the database and increases security by only

allowing authorized users to access the data.

4.1.4 Apache Netbeans IDE

Netbeans IDE is a free, open-source, integrated development environment that helps you

develop applications. It supports multiple languages such as Java and others. It can run

Windows, Linux, Mac OS X, and other UNIX-based systems. It has useful features such as the

Java Swing GUI Builder. It was used in order to develop the graphic user interface of our

application. It allows for drag and drop capability for easy and simple creation of the various

interfaces of our application which saves us time.

College of Information Technology

18
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

4.1.5 LGoodDatePicker

LGoodDatePicker is a library that provides an easier way of picking dates for users. It is

compatible with multiple Java IDEs including Netbeans IDE. It is implemented similarly to a

text field where there is a box that the user can type in. Instead of manually typing out the date,

the user can choose to press the button beside the field and a calendar interface pops up and the

user can simply choose what date he intends to pick.

4.2 RESULTS

The developed inventory management system application aims to provide a free

application that can be used by small retail stores to manage their inventory. It helps them keep

track of their product stock and prevent low and overstocking. It aids them in keeping track of

the expiration date of products and whether there are low stock products by notifying them. It

keeps track of changes made to the inventory. It secures their product data through user

authentication where only authorized users or accounts are able to access the data. The

application contains the following interfaces:

College of Information Technology

19
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 3: Register and Login Interfaces.

The login and register interfaces are almost identical differing only on the text labels and

functions. The register interface is only used when it is the first time the user launches the

application and no database was detected. The credentials from the register interface are then

used in order to login in the login interface in order to access the database and the application.

This prevents unauthorized access which ensures data security (Mohamed et al., 2022).

College of Information Technology

20
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 4: Dashboard Interface

The first interface the user sees after they successfully login. It provides them with a

summary or an overview of their inventory. Specifically, it shows the counts of their products

that are near or at their expiration date and those that have crossed the quantity threshold for low

stock.

College of Information Technology

21
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 5: Urgent Warnings Interface

One of the problems that retail stores face is tracking of expiration dates (Wedasinghe et

al., 2021). In order to view the products that are near expiration or considered low stock, the user

can navigate to the Urgent Warnings interface. It lists out two tables displaying the products that

are near expiration and those considered low stock. To address the problematic products the user

can then navigate to the product list interface.

College of Information Technology

22
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 6: Product List Interface

An inventory management system’s main function is to allow employees or managers to

track and record product stocks in order to ensure that there are no stockouts or overstocking

(Chin et al., 2023). It displays the list of products using a table and contains various functions. It

also colors the rows depending on their status where red products are expired, yellow products

are low on stock and purple are both expired and low on stock. This interface contains add, edit

and delete functions that allows the user to manage the inventory database. The changes the user

makes are stored in a Queue and are only executed if the user presses the Save Changes button. It

also contains a search bar when looking for a specific product or attribute.

College of Information Technology

23
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 7: Pending Changes Dialog Interface

When the user performs operations, the changes he makes are not immediately reflected

in the database but are instead temporarily stored in a queue. The changes stored can be viewed

by the user using the view changes button and allows them to review the changes and avoid

making redundant operations.

College of Information Technology

24
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 8: Change Logs Interface

Displays the list of changes made on the inventory database. It shows the specific value

that was changed and the timestamp of when it was changed. This aids in identifying the cause of

discrepancies related to the inventory data when it exists. It can help the user identify whether a

product’s data is accurate and up-to-date, preventing redundant operations.

College of Information Technology

25
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 9: Add and Edit Product Interface

The add and edit product interfaces are almost identical differing only on the text labels

and functions. The add interface’s fields are empty while the edit products fields are filled

according to the row you selected in the product list table. Both these interfaces create an SQL

statement with the add interface performing insert and the edit product performing update. These

statements are then stored in a queue and are executed only when the user presses the save

changes button in the main interface.

College of Information Technology

26
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Figure 10: Date Picker Interface

Contained within the add or edit product interfaces. Allows the user to select specific

dates for the expiration date. Can select today’s date and skip through years using the arrow

buttons.

Figure 11: Information, Error and Success Dialog Interfaces

Dialogs pop out throughout the use of the application to provide the user with

information about their inputs. The information dialog with the blue color provides general

information during the use of the application. The error dialog with the red color indicates that

College of Information Technology

27
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

something went wrong or the input of the user is incorrect. The success dialog with the green

color indicates that the operation was successful.

Figure 12: Confirm Dialog Interface

When the user performs operations on the inventory it is important to ask for

confirmation in order to avoid mistakes and errors in tracking. This acts as a barrier to prevent

accidents such as misclicks and to give the user a little bit of time to decide when saving changes

and performing operations.

4.3 COMPARISONS

Compared to other studies it is similar where it aims to provide a better way of inventory

management and uses computers as a medium. It shares the main functionality of being able to

track and manage inventory stock of products or items. It also uses user authentication as a way

of increasing security and privacy. It takes advantage of graphical user interfaces to aid the user

for easier inventory management.

This study focuses more on small retail stores and aims to provide a more compact

solution for inventory management. It does not rely on web-based technology but instead it uses

College of Information Technology

28
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

only Java and its libraries as well as outside libraries such as HSQLDB and LGoodDatePicker. It

stores inventory data on the device itself instead of a server. This means that it requires less

investment to use as it only requires a computer capable of running Java. It also has a unique

function where it tracks products that are expired or is low on stock and informs the user so that

changes can be made.

4.4 LIMITATIONS

The application stores the data within the device itself. This means that only the device

can modify the inventory data and if the device is lost or corrupted the inventory data is lost as

well. Currently, the database of the application is running in embedded-mode which means that

only the device that contains it can access it. It also means that it cannot be accessed using

networking means. Only one account is created for the database which has to be shared if

multiple employees intend to manage the inventory. Another limitation is whenever a sale is

made, the changes in product stock or quantity is not automatically reflected. An employee has

to update the inventory database every time a sale is made.

College of Information Technology

29
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CHAPTER V

RESULTS AND DISCUSSIONS

In this chapter, the researchers interpret and discuss the results of this study. Comparisons

with previous studies were done to discuss improvements and differences. It also addresses the

challenges encountered during the study as well as the limitations that the study has.

5.1 FINDINGS/ANALYSIS

5.1.1 How can we make inventory managing quicker and more effective?

The use of a computerized system saves time, consumes less energy and increases the

accuracy of data (Pasaribu, 2021). The inventory management system the researchers developed

uses graphical user interfaces that helps the user in tracking inventory quickly and effectively.

Using HSQLDB it allows for fast retrieval and storage of inventory data. It also allows storage of

the change logs and unique queries that can identify near expiration and low stock products.

5.1.2 How can we reduce and minimize human errors in inventory management?

Through the use of automated processes and calculation it reduces human errors

compared to traditional inventory management by hand (Sheng et al., 2023). When creating

product records the user is provided with the different fields required such as the name, quantity

and others. For the expiration date field the user is provided with a date picker which helps

reduce incorrect date selection. The user is also prompted many times during changes for

College of Information Technology

30
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

confirmation as well as when saving the changes to the database to avoid unintentional or

incorrect changes.

5.1.3 How do we ensure the security and privacy of the store’s data?

HSQLDB supports user authentication functionality. When running the application for

the first time, the user is prompted for a username and a password that serves as the credentials

in order to access the database contents and its modification. This ensures that only authenticated

users are able to modify and view the database contents which improves security of privacy of

the store’s data.

5.1.4 How can we make managing inventory simpler and easier?

The application uses graphical user interfaces that allows the user to interact with the

inventory. The interfaces provide an intuitive and simple way of inventory management through

the use of different dialogs and buttons. Different features such as the date pickers, info alerts,

searching and expiration and low stock tracking all help make managing inventory easier.

5.2 CONCLUSION

In conclusion, the rapid advancement of technology has increased the competitiveness of

businesses worldwide. Businesses rely more on technology because of the time and cost it saves.

In retail stores, there are some that still rely on manual or traditional inventory management

which is error-prone and time-consuming (Girsch-Bock, 2013). Increasing competition and the

College of Information Technology

31
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

benefits it gives creates a need and use for inventory management systems (Madamidola et al.,

2017).

Thus, the researchers have created an inventory management system application that

provides a more efficient way of inventory management. By taking advantage of computers and

databases, inventory data retrieval and managing is now quicker and more efficient. Using

automated processes it reduces human error and with features like date picker we are able to

further reduce inaccurate data entries. Security is improved by restricting access, only allowing

authorized users to access the inventory database. Combined, they simplify the process of

inventory management making it more user-friendly and easier.

Through the use of this application, tracking and recording of products and their stock is

possible and ensures that there is no unexpected low stock or over stock to occur (Chin et al.,

2023). It helps stores improve inventory decisions and reduce inventory costs (Cote, 2015). It

can also lead to improved profitability for the business (Deshmukh, 2022). It can also help avoid

unknowingly selling expired products to customers using the expiration tracking function.

5.3 RECOMMENDATION

It is recommended for stores dealing with inventory to take advantage of inventory

management systems. The benefits of reduced cost and increased profitability is a significant

edge in business especially those still relying on manual tracking of inventory.

The application developed functions only as a way of managing inventory. This means

that whenever a sale is made and changes in quantity need to be done, the changes in product

College of Information Technology

32
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

stock or quantity is not automatically performed. An employee has to find the product purchased

in the product list and change the quantity value manually. To further improve efficiency it is

recommended to develop a separate system that can interact with the inventory database.

Specifically, a sales management system where it manages sales and automatically updates the

inventory database every time a sale is completed. Sales data can then be stored in the database

and analysis can be performed and useful information could be found.

Integration of IOT devices can be implemented along with a sales management system.

This quickens both the process of inventory and sales management by scanning the barcodes of

products. By scanning using barcodes it can further reduce the chance for human-error to occur

during sales or inventory management. IOT solutions can also provide the customers with

alternative ways of payment which can enhance customer experience.

College of Information Technology

33
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

REFERENCES

Seethamraju, R., & Diatha, K. S. (2018). Adoption of digital payments by small retail stores.
Wedasinghe, Nirosha & Yasara, Devni. (2021). Effective Use of Retail Store Management
System for Small Retail Store.
Lal, Mukesh & Shukla, Apratul & tarangini, a. (2018). Study of Effectiveness of POS Data in
Managing Supply Chain. Industrial Engineering Journal. 11. 10.26488/IEJ.11.10.1144.
Deshmukh, S., & Tak, S. (2022). Inventory Management System. In International Journal of
Scientific Research & Engineering Trends (Vol. 8, Issue 1, pp. 371–373).
Frye, M. (2022). Exploring Inventory Management’s Effects on a Company’s Profitability.
Undergraduate Honors Theses.
Cote, M. (2015, April). The Power of Point of Sale: Improving Growth, Profit, and Customer
Service in a Retail Business.
Girsch-Bock, M. (2013). Point-of-Sale: A Critical Investment for Retailers. CPA Practice
Advisor, 23(9), 30–32.
Mehar, P. G., Pardhi, A., Borkar, A., Vaidya, D. R., Umredkar, H. R., & Somkuwar, R. (2023).
Development of Inventory Management System Used in Production Industry.
International Journal for Research in Applied Science and Engineering Technology,
11(4), 4540–4543. https://doi.org/10.22214/ijraset.2023.51262
Chabert, J. L. (1999). A History of Algorithms. In Springer eBooks.
https://doi.org/10.1007/978-3-642-18192-4
Evans, Claire L. (2018). Broad Band: The Untold Story of the Women Who Made the Internet.
New York: Portfolio/Penguin. ISBN 9780735211759.
Hodges, Andrew (2012). Alan Turing: The Enigma (The Centenary ed.). Princeton University
Press. ISBN 978-0-691-15564-7.
Knuth, Donald E. (1987). "Von Neumann's First Computer Program". In Aspray, W.; Burks, A.
(eds.). Papers of John von Neumann on computing and computer theory. Cambridge:
MIT Press. pp. 89–95. ISBN 978-0-262-22030-9.
Karp, Richard M. (February 1986). "Combinatorics, Complexity, and Randomness".
Communications of the ACM. 29 (2): 98–109. doi:10.1145/5657.5658.

College of Information Technology

34
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

Macas, Cinthya & Aguirre, Jorge & Arcentales-Carrion, Rodrigo & Pena, Mario. (2021).
Inventory management for retail companies: A literature review and current trends.
71-78. 10.1109/ICI2ST51859.2021.00018.
Chin, Chan & Ramiah, Sathiapriya & Razali, Nurul Farhaini. (2023). Inventory Management
Systems (IMS). 2600-7304.
Sheng, E., & Harun, H. (2023). Design and development of an inventory Management mobile
application. International Journal of Research in Engineering and Science (IJRES) Vol.
11, Issue 9. pp. 38–47.
Dion, J. (April 2003). The Effects of POS Implementation and Retail Technology on Sales and
Profitability for Small to Mid Sized Retailers. Dionco Inc.
Joseph, Sb & Ness, Pedro. (2023). The Relationship Between Computers and Society, Impacts,
Challenges, and Opportunities.
Ahmad, R., Shobowale, K., Idris, M., Dandago, K., Yahaya, J., Zango, M. & Hassan, A. (2022).
Latest advances in inventory management systems: a review. FUW Trends in Science &
Technology Journal, 7(3), 95-105.
Yuvaraj, K., Oorappan, G. M., Megavarthini, K. K., Pravin, M. C., Adharsh, R., & Ashwath
Kumaran, M. (2020). Design and development of an application for database
maintenance in inventory management system using Tkinter and Sqlite platform. IOP
Conference Series: Materials Science and Engineering, 995(1), 012012.
https://doi.org/10.1088/1757-899x/995/1/012012
Madamidola, O. A., Daramola, O. A., & Akintola, K. G. (2017). Web-based intelligent inventory
management system. International Journal of Trend in Scientific Research and
Development, 1(4).
Hassan, Hassan & Sarhan, Qusay. (2018). Performance evaluation of relational embedded
databases: an empirical study. Innovaciencia. 6. 1-8. 10.15649/2346075X.468.
Martinez, Desiree & Remegio, Axl & Lincopinis, Darllaine. (2023). A Review on Java
Programming Language.
Pasaribu, Johni. (2021). Development of a Web Based Inventory Information System.
International Journal of Engineering, Science and Information Technology. 1. 24-31.
10.52088/ijesty.v1i2.51.
Mohamed, A.K.Y.S., Auer, D., Hofer, D. and Küng, J. (2022), "A systematic literature review for
authorization and access control: definitions, strategies and models", International Journal
of Web Information Systems, Vol. 18 No. 2/3, pp. 156-180.
https://doi.org/10.1108/IJWIS-04-2022-0077

College of Information Technology

35
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

APPENDICES
APPENDIX A
if */
InventoryManagementSyste (JOptionPane.showConfirmDialog(this, "Are public class loginUI extends
m.java Code you sure the details written are correct?", "Are javax.swing.JFrame {
package inventorymanagementsystem; you sure?", JOptionPane.YES_NO_OPTION)
== 0) { /**
import java.io.File; try { // SQL connection to create * Creates new form loginUI
/** database and tables then launch login */
* Connection c = public loginUI() {
* @author Josh DriverManager.getConnection("jdbc:hsqldb:fil initComponents();
*/ e:./database/inventorydb", username.getText(), }
public class InventoryManagementSystem { String.valueOf(password.getPassword()));
String sql = "CREATE TABLE private void
/** PRODUCTS(ID INTEGER GENERATED confirmActionPerformed(java.awt.event.Actio
* @param args the command line BY DEFAULT AS IDENTITY PRIMARY nEvent evt) {
arguments KEY , NAME VARCHAR(255), QUANTITY // Check if fields are empty
*/ INT, THRESHOLD INT,PRICE if (username.getText().equals("") ||
public static void main(String[] args) { DOUBLE,LOCATION VARCHAR(255), password.getPassword().length == 0) {
// Check if database exists EXPIRATION DATE, LASTMODIFY errorDialog dialog = new
File file = new TIMESTAMP, SUPPLIER errorDialog(new javax.swing.JFrame(), true,
File("./database/inventorydb.properties"); VARCHAR(255))"; "Fields are empty!");
if (!file.exists()) { // if not then launch Statement state = dialog.setVisible(true);
register c.createStatement(); } else { // If not try to connect to database
new registerUI().setVisible(true); state.execute(sql); using credentials inputted
} else { // if yes launch login sql = "CREATE TABLE try { // If credentials are correct then
new loginUI().setVisible(true); CHANGES(ID INTEGER GENERATED BY launch main ui
} DEFAULT AS IDENTITY PRIMARY KEY, Connection c =
} TIME TIMESTAMP, PRODUCTID DriverManager.getConnection("jdbc:hsqldb:fil
INTEGER, NAME VARCHAR(255), e:./database/inventorydb", username.getText(),
} CHANGES VARCHAR(1000))"; String.valueOf(password.getPassword()));
state.execute(sql); c.close();
c.close(); new mainUI(username.getText(),
APPENDIX B new loginUI().setVisible(true); String.valueOf(password.getPassword())).setV
RegisterUI.java Code this.dispose();
} catch (SQLException ex) {
isible(true);
this.dispose();
package inventorymanagementsystem;
errorDialog dialog = new } catch (SQLException ex) { // This
errorDialog(new javax.swing.JFrame(), true, will be thrown if credentials incorrect
import java.sql.Connection;
"SQL Error!"); errorDialog dialog = new
import java.sql.DriverManager;
dialog.setVisible(true); errorDialog(new javax.swing.JFrame(), true,
import java.sql.SQLException;
} "Login credentials incorrect!");
import java.sql.Statement;
} dialog.setVisible(true);
import javax.swing.JOptionPane;
}
} }
/**
} }
*
* @author Josh
// Variables declaration - do not modify /**
*/
private javax.swing.JButton confirm; * @param args the command line
public class registerUI extends
private javax.swing.JLabel jLabel1; arguments
javax.swing.JFrame {
private javax.swing.JLabel jLabel2; */
private javax.swing.JLabel jLabel3;
/**
private javax.swing.JLabel jLabel4; // Variables declaration - do not modify
* Creates new form registerUI
private javax.swing.JPasswordField private javax.swing.JButton confirm;
*/
password; private javax.swing.JLabel jLabel1;
public registerUI() {
private javax.swing.JTextField username; private javax.swing.JLabel jLabel3;
initComponents();
// End of variables declaration private javax.swing.JLabel jLabel4;
}
} private javax.swing.JPasswordField
password;
private void
private javax.swing.JTextField username;
confirmActionPerformed(java.awt.event.Actio APPENDIX C // End of variables declaration
nEvent evt) {
// Check if fields are not empty LoginUI.java Code }
if (username.getText().equals("") || package inventorymanagementsystem;
password.getPassword().length == 0) {
import java.sql.Connection;
APPENDIX D
errorDialog dialog = new
errorDialog(new javax.swing.JFrame(), true, import java.sql.DriverManager; MainUI.java Code
"Fields are empty!"); import java.sql.SQLException; package inventorymanagementsystem;
dialog.setVisible(true);
} else { // if not empty ask user for /** import java.awt.CardLayout;
confirmation * import java.awt.Color;
* @author Josh import java.awt.Component;

College of Information Technology

36
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

import javax.swing.table.DefaultTableModel; urgentButton.setBackground(new


import java.sql.ResultSet; expiredCount.setText(String.valueOf(expiredT java.awt.Color(102, 102, 255));
import java.util.Vector; ablemodel.getRowCount())); urgentButton.setForeground(new
import java.sql.ResultSetMetaData; java.awt.Color(255, 255, 255));
import java.sql.SQLException; lowStockCount.setText(String.valueOf(lowSto changeLogButton.setBackground(new
import java.text.ParseException; ckTablemodel.getRowCount())); java.awt.Color(255, 255, 255));
import java.text.SimpleDateFormat; changeLogButton.setForeground(new
import java.time.LocalDateTime; productCount.setText(String.valueOf(tablemo java.awt.Color(102, 102, 102));
import java.time.format.DateTimeFormatter; del.getRowCount())); CardLayout cl =
import java.util.Date; (CardLayout)(jPanel2.getLayout());
import java.util.logging.Level; currentDate.setText(getCurrentWordDate()); cl.show(jPanel2, "urgentpanel");
import java.util.logging.Logger; // Store ids of expired products }
import javax.swing.JOptionPane; for (int i = 0; i <
import javax.swing.JTable; expiredTablemodel.getRowCount(); i++) { private void
import java.util.HashMap; expireMap.put((int) productButtonActionPerformed(java.awt.event
import javax.swing.table.TableCellRenderer; expiredTablemodel.getValueAt(i, 0), ""); .ActionEvent evt) {
} // Changes colors of buttons and switches
/* // Store ids of low stock products the card
* Click for (int i = 0; i < urgentButton.setBackground(new
nbfs://nbhost/SystemFileSystem/Templates/Li lowStockTablemodel.getRowCount(); i++) { java.awt.Color(255, 255, 255));
censes/license-default.txt to change this lowStockMap.put((int) urgentButton.setForeground(new
license lowStockTablemodel.getValueAt(i, 0), ""); java.awt.Color(102, 102, 102));
* Click } dashboardButton.setBackground(new
nbfs://nbhost/SystemFileSystem/Templates/G // If there is an expired or low stock java.awt.Color(255, 255, 255));
UIForms/JFrame.java to edit this template product show an info dialog informing the user dashboardButton.setForeground(new
*/ if (!expireMap.isEmpty() || java.awt.Color(102, 102, 102));
!lowStockMap.isEmpty()) { productButton.setBackground(new
/** showInfo("Some Products are expired java.awt.Color(102, 102, 255));
* or low on stock."); productButton.setForeground(new
* @author Josh } java.awt.Color(255, 255, 255));
*/ resizeTable(); // Resize the tables changeLogButton.setBackground(new
public class mainUI extends } java.awt.Color(255, 255, 255));
javax.swing.JFrame { changeLogButton.setForeground(new
public static database dbObject; private void java.awt.Color(102, 102, 102));
private DefaultTableModel tablemodel; dashboardButtonActionPerformed(java.awt.ev CardLayout cl =
private DefaultTableModel ent.ActionEvent evt) { (CardLayout)(jPanel2.getLayout());
expiredTablemodel; // Changes colors of buttons and switches cl.show(jPanel2, "productpanel");
private DefaultTableModel the card table.setModel(tablemodel);
lowStockTablemodel; urgentButton.setBackground(new resizeTable(); // Resize tables
private DefaultTableModel java.awt.Color(255, 255, 255)); }
changeTablemodel; urgentButton.setForeground(new
private DefaultTableModel java.awt.Color(102, 102, 102)); private void
searchTablemodel; productButton.setBackground(new addButtonActionPerformed(java.awt.event.Ac
HashMap<Integer, String> expireMap; java.awt.Color(255, 255, 255)); tionEvent evt) {
HashMap<Integer, String> lowStockMap; productButton.setForeground(new // Launches add product ui
/** java.awt.Color(102, 102, 102)); addProductUI dialog = new
* Creates new form mainUI dashboardButton.setBackground(new addProductUI(new javax.swing.JFrame(),
* @param username java.awt.Color(102, 102, 255)); true);
* @param password dashboardButton.setForeground(new dialog.setVisible(true);
*/ java.awt.Color(255, 255, 255)); }
public mainUI(String username, String changeLogButton.setBackground(new
password) { java.awt.Color(255, 255, 255)); private void
// Initialize objects for database and table changeLogButton.setForeground(new saveButtonActionPerformed(java.awt.event.A
models for the products java.awt.Color(102, 102, 102)); ctionEvent evt) {
dbObject = new database(username, CardLayout cl = // Check if there are changes stored in
password); (CardLayout)(jPanel2.getLayout()); queue
expireMap = new HashMap<>(); cl.show(jPanel2, "dashboardpanel"); if (dbObject.isQueueEmpty()) {
lowStockMap = new HashMap<>(); } showInfo("No changes have been
tablemodel = made.");
buildTableModelProduct(dbObject.getAll()); private void } else if (getConfirm("Are you sure you
expiredTablemodel = urgentButtonActionPerformed(java.awt.event. want to save changes?")) { // if user confirms
buildTableModelProduct(dbObject.getExpired ActionEvent evt) { execute queue
(getCurrentDate())); // Changes colors of buttons and switches dbObject.execute();
lowStockTablemodel = the card // Re-initialize objects and rebuild
buildTableModelProduct(dbObject.getLowSto dashboardButton.setBackground(new models for tables because of changes
ck()); java.awt.Color(255, 255, 255)); expireMap = new HashMap<>();
changeTablemodel = dashboardButton.setForeground(new lowStockMap = new HashMap<>();
buildTableModel(dbObject.getChanges()); java.awt.Color(102, 102, 102)); tablemodel =
initComponents(); productButton.setBackground(new buildTableModelProduct(dbObject.getAll());
// Setting the dashboard counts of java.awt.Color(255, 255, 255)); table.setModel(tablemodel);
expired, low stock and total product counts productButton.setForeground(new expiredTablemodel =
and date today java.awt.Color(102, 102, 102)); buildTableModelProduct(dbObject.getExpired
(getCurrentDate()));

College of Information Technology

37
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

try { // Get expiration date value from


expireTable.setModel(expiredTablemodel); expireTable.getColumnModel().getColumn(1). selected row and parse into string
lowStockTablemodel = setPreferredWidth(150); dateParser =
buildTableModelProduct(dbObject.getLowSto sdf.parse(table.getValueAt(row, 6).toString());
ck()); expireTable.getColumnModel().getColumn(2). format = "MMMM d, yyyy";
setPreferredWidth(10); sdf.applyPattern(format);
stockTable.setModel(lowStockTablemodel); date = sdf.format(dateParser);
changeTablemodel = expireTable.getColumnModel().getColumn(3). } catch (ParseException ex) {
buildTableModel(dbObject.getChanges()); setPreferredWidth(10);
Logger.getLogger(mainUI.class.getName()).lo
changeTable.setModel(changeTablemodel); expireTable.getColumnModel().getColumn(4). g(Level.SEVERE, null, ex);
// Count amount of expired, low stock setPreferredWidth(25); }
and total of products // Store values in row into array
expireTable.getColumnModel().getColumn(6). Object[] obj = {table.getValueAt(row,
expiredCount.setText(String.valueOf(expiredT setPreferredWidth(50); 1), table.getValueAt(row, 2),
ablemodel.getRowCount())); table.getValueAt(row, 3),
expireTable.getColumnModel().getColumn(7). table.getValueAt(row, 4),
lowStockCount.setText(String.valueOf(lowSto setPreferredWidth(100); table.getValueAt(row, 5),
ckTablemodel.getRowCount())); date, table.getValueAt(row, 8),
expireTable.getColumnModel().getColumn(8). table.getValueAt(row, 0)};
productCount.setText(String.valueOf(tablemo setPreferredWidth(150); // Launch edit product ui and pass the
del.getRowCount())); obj array as argument
editProductUI dialog = new
currentDate.setText(getCurrentWordDate()); stockTable.getColumnModel().getColumn(0).s editProductUI(new javax.swing.JFrame(),
// Store ids of expired products etPreferredWidth(10); true, obj);
for (int i = 0; i < dialog.setVisible(true);
expiredTablemodel.getRowCount(); i++) { stockTable.getColumnModel().getColumn(1).s } catch
expireMap.put((int) etPreferredWidth(150); (java.lang.IndexOutOfBoundsException e) { //
expiredTablemodel.getValueAt(i, 0), ""); if no row is selected
} stockTable.getColumnModel().getColumn(2).s showInfo("No row selected.");
// Store ids of low stock products etPreferredWidth(10); }
for (int i = 0; i < }
lowStockTablemodel.getRowCount(); i++) { stockTable.getColumnModel().getColumn(3).s
lowStockMap.put((int) etPreferredWidth(10); private void
lowStockTablemodel.getValueAt(i, 0), ""); deleteButtonActionPerformed(java.awt.event.
} stockTable.getColumnModel().getColumn(4).s ActionEvent evt) {
resizeTable(); // resize table etPreferredWidth(25); // Asks user for confirmation to delete
showSuccess("Changes saved try {
successfully!"); stockTable.getColumnModel().getColumn(6).s if (getConfirm("Are you sure you want
} etPreferredWidth(50); to delete this product?")) {
// if yes get id of the selected row
} stockTable.getColumnModel().getColumn(7).s int row = table.getSelectedRow();
private void resizeTable() { etPreferredWidth(100); int id =(int) table.getValueAt(row,
// Resizes each column of all tables 0);
stockTable.getColumnModel().getColumn(8).s // get name of row
table.getColumnModel().getColumn(0).setPref etPreferredWidth(150); String name = (String)
erredWidth(10); table.getValueAt(row, 1);
// SQL Statement to add to queue
table.getColumnModel().getColumn(1).setPref changeTable.getColumnModel().getColumn(0 String str = "DELETE FROM
erredWidth(150); ).setPreferredWidth(100); PRODUCTS WHERE ID=?";
dbObject.addToQueue(str, id, name);
table.getColumnModel().getColumn(2).setPref changeTable.getColumnModel().getColumn(1 // add to queue
erredWidth(10); ).setPreferredWidth(10); showSuccess("Successfully added
removal to changes list.");
table.getColumnModel().getColumn(3).setPref changeTable.getColumnModel().getColumn(2 }
erredWidth(10); ).setPreferredWidth(150); } catch
(java.lang.IndexOutOfBoundsException e) { //
table.getColumnModel().getColumn(4).setPref changeTable.getColumnModel().getColumn(3 if no row is selected
erredWidth(25); ).setPreferredWidth(500); showInfo("No row selected.");
} }
table.getColumnModel().getColumn(6).setPref private void }
erredWidth(50); editButtonActionPerformed(java.awt.event.Ac
tionEvent evt) { private void
table.getColumnModel().getColumn(7).setPref // Launches edit ui changeLogButtonActionPerformed(java.awt.e
erredWidth(100); try { vent.ActionEvent evt) {
int row = table.getSelectedRow(); // Change button color and switch card
table.getColumnModel().getColumn(8).setPref // Date format variables urgentButton.setBackground(new
erredWidth(150); String format = "yyyy-MM-dd"; java.awt.Color(255, 255, 255));
SimpleDateFormat sdf = new urgentButton.setForeground(new
SimpleDateFormat(format); java.awt.Color(102, 102, 102));
expireTable.getColumnModel().getColumn(0). Date dateParser; dashboardButton.setBackground(new
setPreferredWidth(10); String date = "October 7, 2024"; java.awt.Color(255, 255, 255));

College of Information Technology

38
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

dashboardButton.setForeground(new changesDialog dialog = new // add values of row to row vector


java.awt.Color(102, 102, 102)); changesDialog(new javax.swing.JFrame(), for (int i = 1; i <=
productButton.setBackground(new true, dbObject.getChangeList()); metaData.getColumnCount(); i++) {
java.awt.Color(255, 255, 255)); dialog.setVisible(true); row.add(rs.getObject(i));
productButton.setForeground(new } }
java.awt.Color(102, 102, 102)); } // after the for loop finishes add the
changeLogButton.setBackground(new row vector to the values vector
java.awt.Color(102, 102, 255)); public static DefaultTableModel values.add(row);
changeLogButton.setForeground(new buildTableModel(ResultSet rs) { }
java.awt.Color(255, 255, 255)); ResultSetMetaData metaData; // Stores // close result set connection
CardLayout cl = data about result set rs.close();
(CardLayout)(jPanel2.getLayout()); Vector<String> headers = new } catch (SQLException ex) {
cl.show(jPanel2, "changepanel"); Vector<String>(); // Vector of Header System.out.println("SQL Error");
} Vector<Vector<Object>> values = new }
Vector<Vector<Object>>(); // Vector of table return new DefaultTableModel(values,
private void try { headers) {
searchButtonActionPerformed(java.awt.event. metaData = rs.getMetaData(); @Override // override for product list
ActionEvent evt) { int columnCount = tables to specify class of each column
// Search metaData.getColumnCount(); public Class getColumnClass(int
if(!("".equals(searchField.getText()))) { // // loop through every column and add column)
if field is not empty their name to headers vector {
if for (int column = 1; column <= switch (column) {
(searchType.getSelectedItem().toString().equal columnCount; column++) { case 0:
s("ID")) { // if search type is ID perform return Integer.class;
searchID method headers.add(metaData.getColumnName(colum case 2:
searchTablemodel = n)); return Integer.class;
buildTableModelProduct(dbObject.searchID(s } case 3:
earchType.getSelectedItem().toString(), // loop through result set return Integer.class;
searchField.getText())); while (rs.next()) { case 4:
} else { // if not then perform normal Vector<Object> row = new return Double.class;
search method Vector<Object>(); case 6:
searchTablemodel = // add values of row to row vector return Object.class;
buildTableModelProduct(dbObject.search(sear for (int i = 1; i <= case 7:
chType.getSelectedItem().toString(), metaData.getColumnCount(); i++) { return Object.class;
searchField.getText())); default:
} row.add(rs.getObject(i)); return String.class;
// set table model } }
table.setModel(searchTablemodel); // after the for loop finishes add the };
resizeTable(); // resize table row vector to the values vector };
} else { // if field is empty values.add(row); }
showInfo("Search field is empty."); }
} // close result set connection public static String getCurrentTime() { //
} rs.close(); returns string of current time
} catch (SQLException ex) { LocalDateTime now =
private void System.out.println("SQL Error"); LocalDateTime.now();
cancelButtonActionPerformed(java.awt.event. } DateTimeFormatter format =
ActionEvent evt) { return new DefaultTableModel(values, DateTimeFormatter.ofPattern("yyyy-MM-dd
// Cancel changes stored in Queue headers); HH:mm:ss");
if(dbObject.isQueueEmpty()) { // if queue } return now.format(format);
is empty public static DefaultTableModel }
showInfo("No changes have been buildTableModelProduct(ResultSet rs) { public static String getCurrentDate() { //
made."); ResultSetMetaData metaData; // stores returns string of current date
} else if (getConfirm("Are you sure you data about result set LocalDateTime now =
want to cancel changes?")) { // if not empty Vector<String> headers = new LocalDateTime.now();
then ask confirmation Vector<String>(); // Vector of header DateTimeFormatter format =
dbObject.clearQueue(); // if yes then Vector<Vector<Object>> values = new DateTimeFormatter.ofPattern("yyyy-MM-dd")
clear the queue Vector<Vector<Object>>(); // Vector of table ;
showSuccess("Successfully cancelled try { return now.format(format);
changes."); metaData = rs.getMetaData(); }
} int columnCount = public static String getCurrentWordDate() {
} metaData.getColumnCount(); // returns word string of current date
// loop through every column and add LocalDateTime now =
private void their name to headers vector LocalDateTime.now();
viewChangesButtonActionPerformed(java.awt for (int column = 1; column <= DateTimeFormatter format =
.event.ActionEvent evt) { columnCount; column++) { DateTimeFormatter.ofPattern("MMMM dd,
// View changes yyyy");
if(dbObject.isQueueEmpty()) { // if queue headers.add(metaData.getColumnName(colum return now.format(format);
is empty n)); }
showInfo("No changes have been } public boolean getConfirm(String message)
made."); // loop through result set { // ask user for confirmation
} else { // if not empty then launch the while (rs.next()) { return
changes dialog passing the change list from db Vector<Object> row = new JOptionPane.showConfirmDialog(this,
object Vector<Object>();

College of Information Technology

39
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

message, "Are you sure?", private javax.swing.JScrollPane String sql = "INSERT INTO
JOptionPane.YES_NO_OPTION) == 0; jScrollPane5; PRODUCTS(NAME,
} private javax.swing.JLabel lowStockCount; QUANTITY, THRESHOLD,
public void showError(String message) { // private javax.swing.JButton productButton; PRICE, LOCATION,
show dialog of error private javax.swing.JLabel productCount; EXPIRATION, LASTMODIFY,
errorDialog dialog = new private javax.swing.JButton saveButton; SUPPLIER) VALUES(?, ?, ?, ?,
errorDialog(new javax.swing.JFrame(), true, private javax.swing.JButton searchButton; ?, ?, ?, ?)";
message); private javax.swing.JTextField searchField; // Add statement to queue
dialog.setVisible(true); private javax.swing.JComboBox<String>
} searchType; mainUI.dbObject.addToQueue(ar
public void showSuccess(String message) { private javax.swing.JTable stockTable; ray, sql);
// show dialog of success private javax.swing.JTable table;
successDialog dialog = new private javax.swing.JButton urgentButton; showSuccess("Successfully added
successDialog(new javax.swing.JFrame(), private javax.swing.JButton product to changes list.");
true, message); viewChangesButton; this.dispose();
dialog.setVisible(true); // End of variables declaration }
} } catch
public void showInfo(String message) { // (java.lang.NumberFormatExcepti
show dialog of info APPENDIX E on e) { // if numeric values are
infoDialog dialog = new infoDialog(new addProductUI.java Code not use for numeric fields
javax.swing.JFrame(), true, message); package inventorymanagementsystem; showError("Please use numbers for
dialog.setVisible(true); numeric fields!");
} import java.time.LocalDate; } catch
public boolean isInExpired(JTable table, int import java.time.format.DateTimeFormatter; (java.time.format.DateTimeParse
row) { // check if row's id is present in expired import java.util.Locale; Exception e) { // If date is
HashMap improperly picked
return expireMap.containsKey((int) /** showError("Please use the date picker
table.getValueAt(row, 0)); * for dates!") ;
} * @author Josh }
public boolean isLowStock(JTable table, int */ }
row) { // check if row's id is present in low public class addProductUI extends
stock HashMap javax.swing.JDialog { public void showError(String message) { //
return lowStockMap.containsKey((int) show error dialog
table.getValueAt(row, 0)); /** errorDialog dialog = new
} * Creates new form addProductUI errorDialog(new
// Variables declaration - do not modify */ javax.swing.JFrame(), true,
private javax.swing.JButton addButton; public addProductUI(java.awt.Frame parent, message);
private javax.swing.JButton cancelButton; boolean modal) { dialog.setVisible(true);
private javax.swing.JButton super(parent, modal); }
changeLogButton; initComponents(); public void showSuccess(String message) {
private javax.swing.JTable changeTable; } // show success dialog
private javax.swing.JLabel currentDate; successDialog dialog = new
private javax.swing.JButton private void successDialog(new
dashboardButton; confirmActionPerformed(java.aw javax.swing.JFrame(), true,
private javax.swing.JButton deleteButton; t.event.ActionEvent evt) { message);
private javax.swing.JButton editButton; // TODO add your handling code here: dialog.setVisible(true);
private javax.swing.JTable expireTable; try { }
private javax.swing.JLabel expiredCount; // check if name field is empty
private javax.swing.JLabel jLabel1; if ("".equals(name.getText())) { // Variables declaration - do not modify
private javax.swing.JLabel jLabel10; showError("Name cannot be private javax.swing.JButton confirm;
private javax.swing.JLabel jLabel15; empty!"); private
private javax.swing.JLabel jLabel3; } else { // if not perform add com.github.lgooddatepicker.comp
private javax.swing.JLabel jLabel6; // Date format variables onents.DatePicker expiration;
private javax.swing.JLabel jLabel8; DateTimeFormatter format = private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1; DateTimeFormatter.ofPattern("M private javax.swing.JLabel jLabel10;
private javax.swing.JPanel jPanel10; MMM d, yyyy", private javax.swing.JLabel jLabel12;
private javax.swing.JPanel jPanel11; Locale.ENGLISH); private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel12; LocalDate dateParser = private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel15; LocalDate.parse(expiration.getTe private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel2; xt(), format); private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel3; String date = dateParser.toString(); private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel4; // store values from fields to array private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel5; Object[] array = {name.getText(), private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel6; quantity.getValue(), private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel7; threshold.getValue(), private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel8; price.getText(), public javax.swing.JTextField location;
private javax.swing.JPanel jPanel9; location.getText(), date, public javax.swing.JTextField name;
private javax.swing.JScrollPane private javax.swing.JTextField price;
jScrollPane1; mainUI.getCurrentTime(), public javax.swing.JSpinner quantity;
private javax.swing.JScrollPane supplier.getText() public javax.swing.JTextField supplier;
jScrollPane2; }; public javax.swing.JSpinner threshold;
private javax.swing.JScrollPane // SQL statement to add product // End of variables declaration
jScrollPane3; }

College of Information Technology

40
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

showSuccess("Successfully added counter++;


APPENDIX F change to changes list."); }
editProductUI.java Code } else { // if no changes are made System.out.println(changes);
package inventorymanagementsystem; showInfo("No changes made."); // returns true if counter is more than 0
} return counter > 0;
import java.time.LocalDate; this.dispose(); }
import java.time.format.DateTimeFormatter; } catch
import java.util.Locale; (java.lang.NumberFormatExcepti public void showError(String message) { //
on e) { // If numeric fields are not show error dialog
/** numeric errorDialog dialog = new
* showError("Please use numbers for errorDialog(new
* @author Josh numeric fields!"); javax.swing.JFrame(), true,
*/ } catch message);
public class editProductUI extends (java.time.format.DateTimeParse dialog.setVisible(true);
javax.swing.JDialog { Exception e) { // If expiratoin }
private int id; date is not properly picked public void showInfo(String message) { //
private static Object[] obj; showError("Please use the date picker show info dialog
private static String changes; for dates!") ; infoDialog dialog = new infoDialog(new
} javax.swing.JFrame(), true,
/** } message);
* Creates new form addProductUI dialog.setVisible(true);
*/ private boolean checkChanges() { }
public editProductUI(java.awt.Frame // checks if changes are made public void showSuccess(String message) {
parent, boolean modal, Object[] int counter = 0; // show success dialog
obj) { changes = ""; successDialog dialog = new
super(parent, modal); // if changes are made, the changes are successDialog(new
// initialize obj array with value of array stored in a string and counter is javax.swing.JFrame(), true,
passed incremented message);
this.obj = obj; if (!obj[0].equals(name.getText())) { dialog.setVisible(true);
initComponents(); changes += "Name from " + obj[0] + " }
to " + name.getText() + " | ";
} counter++;
}
private void if (!obj[1].equals(quantity.getValue())) { // Variables declaration - do not modify
confirmActionPerformed(java.aw changes += "Quantity from " + obj[1] private javax.swing.JButton confirm;
t.event.ActionEvent evt) { + " to " + quantity.getValue() + " | private
"; com.github.lgooddatepicker.comp
try { counter++; onents.DatePicker expiration;
// check if changes are made } private javax.swing.JLabel jLabel1;
if (checkChanges()) { if (!obj[2].equals(threshold.getValue())) { private javax.swing.JLabel jLabel10;
// Date format variables changes += "Threshold from " + obj[2] private javax.swing.JLabel jLabel12;
DateTimeFormatter format = + " to " + threshold.getValue() + " private javax.swing.JLabel jLabel3;
DateTimeFormatter.ofPattern("M | "; private javax.swing.JLabel jLabel4;
MMM d, yyyy", counter++; private javax.swing.JLabel jLabel5;
Locale.ENGLISH); } private javax.swing.JLabel jLabel6;
LocalDate dateParser = if private javax.swing.JLabel jLabel7;
LocalDate.parse(expiration.getTe (!((Double.parseDouble(String.va private javax.swing.JLabel jLabel8;
xt(), format); lueOf(obj[3]))) == private javax.swing.JLabel jLabel9;
String date = dateParser.toString(); (Double.parseDouble(price.getTe private javax.swing.JPanel jPanel1;
// array that stores values of each xt())))) { private javax.swing.JPanel jPanel2;
field changes += "Price from " + obj[3] + " public javax.swing.JTextField location;
Object[] array = {name.getText(), to " + public javax.swing.JTextField name;
quantity.getValue(), Double.parseDouble(price.getTex public javax.swing.JTextField price;
threshold.getValue(), t()) + " | "; public javax.swing.JSpinner quantity;
price.getText(), counter++; public javax.swing.JTextField supplier;
location.getText(), date, } public javax.swing.JSpinner threshold;
if (!obj[4].equals(location.getText())) { // End of variables declaration
mainUI.getCurrentTime(), changes += "Location from " + obj[4] }
supplier.getText() + " to " + location.getText() + " |
}; ";
// SQL statement for updating or counter++; APPENDIX G
editing } database.java Code
String sql = "UPDATE PRODUCTS if package inventorymanagementsystem;
SET NAME=?, QUANTITY=?, (!(String.valueOf(obj[5])).equals(
THRESHOLD=?, PRICE=?, expiration.getText())) { import java.sql.Connection;
LOCATION=?, EXPIRATION=?, changes += "Expiration from " + obj[5] import java.sql.DriverManager;
LASTMODIFY=?, SUPPLIER=? + " to " + expiration.getText() + " import java.sql.SQLException;
WHERE ID=?"; | "; import java.sql.PreparedStatement;
// Add statement to queue counter++; import java.sql.ResultSet;
} import java.util.LinkedList;
mainUI.dbObject.addToQueue(ar if (!obj[6].equals(supplier.getText())) { import java.util.Queue;
ray, sql, id, changes); changes += "Supplier from " + obj[6] + import java.util.logging.Level;
" to " + supplier.getText(); import java.util.logging.Logger;

College of Information Technology

41
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

public ResultSet getLowStock() { state.setInt(3, (int) array[2]);


/** try { state.setDouble(4,
* // Queries database of all products Double.parseDouble((String)
* @author Josh whose quantity is below the array[3]));
*/ threshold state.setString(5, (String) array[4]);
public class database { sql = "SELECT * FROM PRODUCTS state.setString(6, (String) array[5]);
private Connection c; WHERE THRESHOLD >= state.setString(7, (String) array[6]);
private String sql; QUANTITY"; state.setString(8, (String) array[7]);
private Queue<PreparedStatement> PreparedStatement state = // add statement to queue
statementQueue; c.prepareStatement(sql); statementQueue.add(state);
private LinkedList<String> changeList; ResultSet r = state.executeQuery(); // add to change list the changes made
state.close(); addChangeToQueue(0, (String)
public database(String username, String return r; array[0], "Added new product to
password) { } catch (SQLException ex) { database.");
try { System.out.println("SQL Error"); System.out.println(statementQueue);
// create connection } } catch (SQLException ex) {
c= return null;
DriverManager.getConnection("jd } Logger.getLogger(database.class.
bc:hsqldb:file:./database/inventor getName()).log(Level.SEVERE,
ydb", username, password); public ResultSet getChanges() { null, ex);
// initialize SQL statement squeue and try { }
Linked list of changes // Queries database of changes from }
statementQueue = new CHANGES table
LinkedList<>(); sql = "SELECT TIME, PRODUCTID, //SQL Update or Edit
changeList = new LinkedList<>(); NAME, CHANGES FROM public void addToQueue(Object[] array,
} catch (SQLException ex) { CHANGES"; String str, int id, String change) {
System.out.println("SQL Error"); PreparedStatement state = try {
} c.prepareStatement(sql); // Edits a row or product in the
} ResultSet r = state.executeQuery(); database
state.close(); PreparedStatement state =
public ResultSet getAll() { return r; c.prepareStatement(str);
try { } catch (SQLException ex) { // set placeholders (?) to values from
// Queries database of all products from System.out.println("SQL Error"); array
PRODUCTS table } state.setString(1, (String) array[0]);
sql = "SELECT * FROM PRODUCTS return null; state.setInt(2, (int) array[1]);
ORDER BY ID"; } state.setInt(3, (int) array[2]);
PreparedStatement state = state.setDouble(4,
c.prepareStatement(sql); // SQL Delete Double.parseDouble((String)
ResultSet r = state.executeQuery(); public void addToQueue(String str, int id, array[3]));
state.close(); String name) { state.setString(5, (String) array[4]);
return r; try { state.setString(6, (String) array[5]);
} catch (SQLException ex) { // Deletes product from database state.setString(7, (String) array[6]);
System.out.println("SQL Error"); according to id state.setString(8, (String) array[7]);
} PreparedStatement state = state.setInt(9, id);
return null; c.prepareStatement(str); // add statement to queue
} // set placeholders (?) to id passed statementQueue.add(state);
state.setInt(1, id); // add to change list the changes made
public ResultSet getExpired(String // add statement to queue addChangeToQueue(id, (String)
currentDate) { statementQueue.add(state); array[0], change);
try { // add to change list the changes made System.out.println(statementQueue);
// Queries database of all products that addChangeToQueue(id, (String) name, } catch (SQLException ex) {
are expired or 1 month close from "Removed product from
being expired database."); Logger.getLogger(database.class.
sql = "SELECT * FROM PRODUCTS System.out.println(statementQueue); getName()).log(Level.SEVERE,
WHERE EXPIRATION <= ? OR } catch (SQLException ex) { null, ex);
EXPIRATION BETWEEN ? }
AND DATEADD(MONTH, 1, Logger.getLogger(database.class. }
?)"; getName()).log(Level.SEVERE, // SQL to add changes to CHANGES table
PreparedStatement state = null, ex); private void addChangeToQueue(int id,
c.prepareStatement(sql); } String name, String changes) {
// set placeholders (?) to date today } try {
state.setString(1, currentDate); // adds record of changes in database
state.setString(2, currentDate); // SQL Add String str = "INSERT INTO
state.setString(3, currentDate); public void addToQueue(Object[] array, CHANGES(TIME,
ResultSet r = state.executeQuery(); String str) { PRODUCTID, NAME,
state.close(); try { CHANGES) VALUES(?, ?, ?,
return r; // Adds product to database ?)";
} catch (SQLException ex) { PreparedStatement state = PreparedStatement state =
System.out.println("SQL Error"); c.prepareStatement(str); c.prepareStatement(str);
} // set placeholders (?) to values from // set placeholders (?) to values from
return null; array parameters
} state.setString(1, (String) array[0]); state.setString(1, (String)
state.setInt(2, (int) array[1]); mainUI.getCurrentTime());

College of Information Technology

42
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

state.setInt(2, id); getName()).log(Level.SEVERE, super(parent, modal);


state.setString(3, name); null, ex); // loop through list
state.setString(4, changes); } for (String i : list) {
// add statement to queue // Clear queue and change list // splits into 3 columns ID, Name and
statementQueue.add(state); statementQueue.clear(); Changes
// add changes to linked list of changes changeList.clear(); String[] arr = i.split("<!>");
changeList.add(id + "<!>" + name + tableModel.addRow(arr); // add row to
"<!>" + changes); System.out.println(statementQueu table model
System.out.println(statementQueue); e.size()); }
} catch (SQLException ex) { } initComponents();
// Clears the statement queue and change list // Set column widths
Logger.getLogger(database.class. public void clearQueue() {
getName()).log(Level.SEVERE, try { jTable1.getColumnModel().getCo
null, ex); // Loop through everyting in statement lumn(0).setPreferredWidth(10);
} queue
} for (PreparedStatement state : jTable1.getColumnModel().getCo
// SQL search for Strings statementQueue) { lumn(1).setPreferredWidth(150);
public ResultSet search(String column, // close statements
String search) { state.close(); jTable1.getColumnModel().getCo
try { } lumn(2).setPreferredWidth(500);
// Case insensitive search depending on } catch (SQLException ex) { }
search type selected
sql = "SELECT * FROM PRODUCTS Logger.getLogger(database.class. private void
WHERE UPPER("+ column +") getName()).log(Level.SEVERE, closeButtonActionPerformed(java
LIKE UPPER(?)"; null, ex); .awt.event.ActionEvent evt) {
PreparedStatement state = } // Close dialog
c.prepareStatement(sql); // Clear queue and change list this.dispose();
// set placeholders (?) to string that will statementQueue.clear(); }
be searched changeList.clear();
state.setString(1, "%" + search + "%"); /**
ResultSet r = state.executeQuery(); System.out.println(statementQueu * @param args the command line
state.close(); e.size()); arguments
return r; } */
} catch (SQLException ex) {
System.out.println("SQL Error"); public boolean isQueueEmpty() {
} // checks if statement queue contains // Variables declaration - do not modify
return null; statements private javax.swing.JButton closeButton;
} return statementQueue.isEmpty(); private javax.swing.JPanel jPanel1;
// SQL search for ID } private javax.swing.JScrollPane
public ResultSet searchID(String column, jScrollPane2;
String search) { public LinkedList<String> getChangeList() private javax.swing.JTable jTable1;
try { { // End of variables declaration
sql = "SELECT * FROM PRODUCTS // returns the Linked list of changes }
WHERE "+ column +" LIKE ?"; return changeList;
PreparedStatement state = }
c.prepareStatement(sql); APPENDIX I
// set placeholders (?) to id that will be } successDialog.java Code
searched package inventorymanagementsystem;
state.setString(1, "%" + search + "%");
ResultSet r = state.executeQuery(); APPENDIX H /**
state.close(); changeDialog.java Code *
return r; package inventorymanagementsystem; * @author Josh
} catch (SQLException ex) { */
System.out.println("SQL Error"); import java.util.LinkedList; public class successDialog extends
} import javax.swing.table.DefaultTableModel; javax.swing.JDialog {
return null;
} /** /**
// Executes every statement in the statement * * Creates new form errorDialog
queue * @author Josh */
public void execute() { */ public successDialog(java.awt.Frame
try { public class changesDialog extends parent, boolean modal, String
// Loop through everyting in statement javax.swing.JDialog { message) {
queue private DefaultTableModel tableModel = super(parent, modal);
for (PreparedStatement state : new DefaultTableModel(new initComponents();
statementQueue) { String[] {"ID", "NAME", // Sets label according to message passed
// execute then close the statement "CHANGES"}, 0); this.message.setText(message);
state.execute(); /** }
state.close(); * Creates new form errorDialog
} */
} catch (SQLException ex) { public changesDialog(java.awt.Frame
parent, boolean modal,
Logger.getLogger(database.class. LinkedList<String> list) {

College of Information Technology

43
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) /**


{ * @param args the command line arguments
// Close dialog */
this.dispose();
}
// Variables declaration - do not modify
/** private javax.swing.JButton closeButton;
* @param args the command line arguments private javax.swing.JLabel jLabel2;
*/ private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel message;
// Variables declaration - do not modify // End of variables declaration
private javax.swing.JButton closeButton; }
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2; APPENDIX K
private javax.swing.JLabel message; errorDialog.java Code
// End of variables declaration package inventorymanagementsystem;
}
/**
APPENDIX J *
* @author Josh
infoDialog.java Code */
package inventorymanagementsystem; public class errorDialog extends javax.swing.JDialog {

/** /**
* * Creates new form errorDialog
* @author Josh */
*/ public errorDialog(java.awt.Frame parent, boolean modal, String
public class infoDialog extends javax.swing.JDialog { message) {
super(parent, modal);
/** initComponents();
* Creates new form errorDialog // set label to message passed
*/ this.message.setText(message);
public infoDialog(java.awt.Frame parent, boolean modal, String message) }
{
super(parent, modal); private void closeButtonActionPerformed(java.awt.event.ActionEvent
initComponents(); evt) {
// Sets label according to message passed // Close dialog
this.message.setText(message); this.dispose();
} }
// Variables declaration - do not modify
private void closeButtonActionPerformed(java.awt.event.ActionEvent private javax.swing.JButton closeButton;
evt) { private javax.swing.JLabel jLabel2;
// Close dialog private javax.swing.JPanel jPanel1;
this.dispose(); private javax.swing.JPanel jPanel2;
} private javax.swing.JLabel message;
// End of variables declaration

College of Information Technology

44
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

CURRICULUM VITAE
PERSONAL INFORMATION

Name: Lance Seman

Date of Birth:

Age:

Program: 2nd year, BS

Email:

Address:

PERSONAL INFORMATION

Name: Chyle Talledo

Date of Birth: September 27, 2004

Age: 20

Program: 2nd year, BSCS

Email: [email protected]

Address: Pedro Zayco Sr Street, Barangay 1, Kabankalan City, Negros Occidental

College of Information Technology

45
UNIVERSITY OF NEGROS OCCIDENTAL – RECOLETOS
COLLEGE OF INFORMATION TECHNOLOGY
PAASCU Accredited, CISCO Local Academy
and Center of Development in Information Technology Education
Lizares Avenue, Bacolod City 6100

PERSONAL INFORMATION

Name: Josh B. Valenzuela

Date of Birth: January 11, 2005

Age: 19

Program: 2nd year, BSCS

Email: [email protected]

Address: Lumina Homes, Brgy. Vista Alegre, Bacolod City, Negros Occidental

College of Information Technology

46

You might also like