Super Market Management Mini Java project Super Market Management Presented by: Mushrif Ali Siyamoi Freshta
INTRODUCTION What is POS Point Of Sale. How Supermarket Management is Related to POS 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 Employee Item_details Sales 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 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..."); case 30: Splash.process.setText("Finalizing..."); case 80: Splash.process.setText("Opening Main Page..."); if (i == 100) { Login lg = new Login(); Splash.setVisible(false); lg.setVisible(true);
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 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 Admin-Full access to all the resources Sales-Only to sales modules
Stock (Item Details) 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 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 jForm used. Employee added to employee table once Insert Button is pressed All the fields should be filled before inserting
Limitations Limited knowledge in Advance Java Time constrain
Future Plans Validation modules Report generation Tax implementation module Accounting module HR Module Encryption Module
THANK YOU…