Super Market Management – Core Java Mini Project

Super Market Core Java Project
Super Market Core Java Project



Download Project Pdf


Download Project PPT
Download Project Code

Module

LOGIN
MAINE
STOCK
SALE
DATABASE CONNECTION

Hardware/Software

MySQL v5.7.14
NetBeans IDE 8.2
JDK 8

Database

MySQL in WAMP server is used.
Database name as supermarket with 5 tables.

Login

database_table1 Login

Employee

database_table2 Employee

Item_details

database_table3 Item Details

Sales

database_table4 Sales

audit

database_table5 audit

Connection with MySQL and Query Execution

Import JDBC packages.
Load and register the JDBC driver.
Open a connection to the database.
Create a statement object to perform a query.
Execute the statement object and return a query resultset.
Process the resultset.
Close the resultset and statement objects.
Close the connection.

Connection Module Coding

import splash.*;import javax.swing.*;

import java.sql.*;

public class Connect extends JFrame {

Connection Conn = null;

PreparedStatement pst = null;

ResultSet rs = null;

public static Connection connectDB() {

Connection con = null;

String url = “jdbc:mysql://localhost:3306/”;

String db = “supermarket”;

String driver = “com.mysql.jdbc.Driver”;

String user = “root”;

String pass = “123”;

try {

Class.forName(driver);

con = DriverManager.getConnection(url + db, user, pass);

if (con == null) {

System.out.println(“Connection cannot be established”);

}

// JOptionPane.showMessageDialog(null,”Welcome User”);

return con;

} catch (ClassNotFoundException | SQLException e) {

//System.out.println(e);

JOptionPane.showMessageDialog(null, “Connection failed”);

JOptionPane.showMessageDialog(null, “Exiting”);

System.exit(0);

}

return null;

}

}

FRONT END

main page image

Splash screen-represents the logo and version of the program

Threading concept used in the progress bar percentage and label name changing

for (int i = 0; i <= 100; i++) {

try {

Thread.sleep(50);

} catch (InterruptedException ex) {

}

Splash.loadingnum.setText(Integer.toString(i) + “%”);

Splash.loadingbar.setValue(i);

switch (i) {

case 10:

Splash.process.setText(“loading dll…”);

break;

case 20:

Splash.process.setText(“connecting database…”);

break;

case 30:

Splash.process.setText(“Finalizing…”);

break;

case 80:

Splash.process.setText(“Opening Main Page…”);

break;

}

if (i == 100) {

Login lg = new Login();

Splash.setVisible(false);

lg.setVisible(true);

}

}

LOGIN FORM

super bajar login form
super bajar login form
Gives Access to software based on two levels

Admin-Full access to all the resources
Sales-Only to sales modules

Interacts with login table and audit table

Connect to database and check if the username, password and type matches with the login
If login is success full then user id with timestamp will be entered in audit table

Successful login opens the main form with username

Main Page

Main Page Form
Main Page Form
Main interface where user can perform various tasks
MDI form is used in order to contain the jinternal forms
Stock-Manage Inventory
Sale-Interface to sale items
Settings-Employee management

Stock (Item Details)

Stock Item
Stock Item

jInternal form used.
jTable is populated with data from item_details table when the for loads
Items saved to items_details when pressed saved after filling all text boxes

Sale Form
Sale form
Sale form

jInternal form used.
jTable is populated with data from item_details table when selected in combo box
Total calculated in total text box
Saved in sale table after pressing cash button

Employee Management
Employee Management
Employee Management

jForm used.
Employee added to employee table once Insert Button is pressed
All the fields should be filled before inserting



Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code