cmd_loginActionPerformed

 String sql = "select * from users where first_name=? and password=?";
//        String sql="select * from Modules where username=? and password=?";
        try {
           
            pst = conn.prepareStatement(sql);
            pst.setString(1, txt_username.getText());
            pst.setString(2, txt_password.getText());
            rs= pst.executeQuery();
            if (rs.next()) {
                JOptionPane.showMessageDialog(null, "Username and Password are correct");
            Main s=new Main();
            s.setVisible(true);
           
            }else{
               JOptionPane.showMessageDialog(null, "Username and Password are not correct");
            }
        } catch (Exception e) {
        JOptionPane.showMessageDialog(null, e.getMessage());
       
        }


in the main class
 Connection conn = null;
    ResultSet rs = null;
    PreparedStatement pst = null;

    /** Creates new form Login */
    public Login() {
        initComponents();
        conn = javaconnect.ConnecrDB();
    }

Update Table

  private void update_table() {
        try {
            String sql = "select * from Employeeinfo";
            pst = conn.prepareStatement(sql);
            rs = pst.executeQuery();
            tbl_employee.setModel(DbUtils.resultSetToTableModel(rs));
        } catch (SQLException ex) {
            Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }


for DbUtils.resultSetToTableModel(rs) need to add jar file of  rs2xml.jar

and then
   Connection conn = null;
    ResultSet rs = null;
    PreparedStatement pst = null;

    /**
     * Creates new form NewJFrame
     */
    public NewJFrame() {
        initComponents();
        conn = javaconnect.ConnecrDB();        update_table();    }