Hello the community,

Apparently my prg doesnít use my PersInfo and PersDAO classes and so my datas doesnít inserted .

I put (ex: System.out.println("PersInfo 2this "+ LastName). But always empty.
Whatís stopping me from updating my DB?
Thank you for your help

Dressing up
Code:
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.ArrayList;
import javax.swing.JOptionPane;


public class Ecran extends javax.swing.JFrame implements ActionListener {
private Connection conn;
private ArrayList personsList;
int id,recordNumber,EmployeeNbr,Pourcent,DecNumber;
String LastName,FirstName;
PersonDAO pDAO;

            /**
     * Creates new form NewJFrame
     */
    public Ecran() {
                 EmployeeNbr    = 0;
                Pourcent       = 0;
                DecNumber      = 0;
                Pourcent       = 0;
                LastName       = "";
                FirstName      = ""; 
                id    = 0;     
        initComponents();
           
        	personsList = new ArrayList();
                pDAO = new PersonDAO();	
                
  
		initConn();
    }
//****************************************************************************
      // method used to establish connection with DB
	public void initConn()
	{
		try
		{
			// load driver
			Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
			
                  // establishing connection
                  conn = DriverManager.getConnection("jdbc:ucanaccess://c:/Users\\hab\\Desktop\\Decisions1.accdb","","");
	
                }
                
		catch(Exception e)
		{
			System.out.println("ERREUR");
		}
	}


                   
    
    // Code for dispatching events from components to event handlers.

    public void actionPerformed(java.awt.event.ActionEvent evt) {
        if (evt.getSource() == jButton1) {
            Ecran.this.jButton1ActionPerformed(evt);
        }
    }// </editor-fold>                        

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
    		
                  savePerson();

                  // clear fields
                  clear(); 
            
    }                                        

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Ecran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Ecran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Ecran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Ecran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Ecran().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JLabel LbPourcent;
    private javax.swing.JLabel LblDecNumber;
    private javax.swing.JLabel LblEmployeeNbr;
    private javax.swing.JLabel LblFirstName;
    private javax.swing.JLabel LblLastName;
    private java.awt.TextField TxtFirstName;
    private java.awt.TextField TxtLastName;
    private java.awt.TextField intDecNumber;
    private java.awt.TextField intEmployeeNbr;
    private java.awt.TextField intPourcent;
    private javax.swing.JButton jButton1;
    private java.awt.Panel panel1;
    // End of variables declaration                   
//*****************************************************************************************
	  public void savePerson()
  {  
	/*get values from text fields*/
	EmployeeNbr    = Integer.parseInt(intEmployeeNbr.getText());
	LastName       = TxtLastName.getText();
	FirstName      = TxtFirstName.getText();
        DecNumber      = Integer.parseInt(intDecNumber.getText());
        Pourcent       = Integer.parseInt(intPourcent.getText());
        
System.out.println("Ecran 1 :" + intEmployeeNbr);       
System.out.println("Ecran 1 :" + TxtLastName);

	if(EmployeeNbr==0)
	{
		JOptionPane.showMessageDialog(null, "Please enter person EmployeeNbr.");
	}else
      {

	  /*create a new PersonInfo object and pass it to PersonDAO to save it*/
	  PersonInfo person = new PersonInfo(EmployeeNbr, LastName, FirstName, DecNumber, Pourcent);
	  pDAO.savePerson(person);
            System.out.println("Ecran 2 :" + LastName);
	  JOptionPane.showMessageDialog(null, "Record added");
      }
  }

//*******************************************************************************************************
  public void clear(){
 
	/*clear text fields*/
	intEmployeeNbr.setText("");
	intDecNumber.setText("");
	intPourcent.setText("");
        TxtLastName.setText("");
        TxtFirstName.setText("");
	/*clear contents of arraylist*/
        recordNumber = -1;
	personsList.clear();
	//bForward.setEnabled(true);
	//bBack.setEnabled(true);
  }

}
Code:
public class PersonInfo
{
	private String LastName,FirstName;
	private int id,EmployeeNbr,DecNumber, Pourcent;
       
      // default constructor
      public PersonInfo()
      {       
         
         LastName = "";
         FirstName = "";
         System.out.println("PersInfo 2this "+ LastName);
         id = 0;
         EmployeeNbr = 0;
         DecNumber = 0;  
         Pourcent = 0;
      }

      // param constructor with 5 values 
	public PersonInfo(int EmployeeNbr, int DecNumber, String LastName,String FirstName, int Pourcent)
	{
                this.id = id;           
                this.EmployeeNbr = EmployeeNbr;
                this.DecNumber = DecNumber;
		this.LastName = LastName;
		this.FirstName = FirstName;
                this.Pourcent = Pourcent;
	}
         PersonInfo(int id, int EmployeeNbr, String LastName,int DecNumber , String FirstName, int Pourcent) {
         System.out.println("PersInfo 1"+ LastName);
         
  
    }
        // param construcrtor with 4 values 
	public PersonInfo(int EmployeeNbr, String LastName, String FirstName, int Pourcent)
	{
            //this.DecNumber = DecNumber;
		this.EmployeeNbr = EmployeeNbr;
		this.LastName = LastName;
                this.FirstName = FirstName;
		this.Pourcent = Pourcent;

		
	}

   PersonInfo(String LastName, String FirstName, int Pourcent) {
   }

    PersonInfo(int EmployeeNbr, String LastName, String FirstName, int DecNumber, int Pourcent) {
//        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
      // setters
	public void  setId(int i)
	{
		DecNumber = i;
	
        }
	public void  setEmployeeNbr(int n)
	{
		EmployeeNbr=n;		
	}
	public void  setLastName(String a)
	{
		LastName=a;
	}
	public void  setPourcent(int ph)
	{
		Pourcent=ph;
	}
	public void  setFirstName(String e)
	{
		FirstName=e;
	}

      // getters
	public int getDecNumber( )
	{
		return DecNumber;
      }

	public int getEmployeeNbr()
	{
		return EmployeeNbr;
	}

	public String getLastName()
	{
		return LastName;
	}

	public int getPourcent()
	{
		return Pourcent;
	}

	public String getFirstName()
	{
		return FirstName;
	}

}
Code:
import java.util.*;
import java.sql.*;

public class PersonDAO
{      
      // arraylist used to store PersonInfo objects
	private ArrayList personsList;

	private Connection conn;

//***************************************************************************
     // constructor 
	public PersonDAO()
	{
		personsList = new ArrayList();
		initConn();
	}

//****************************************************************************
      // method used to establish connection with DB
	public void initConn()
	{
		try
		{
			// load driver
			Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
			
                  // establishing connection
                  conn = DriverManager.getConnection("jdbc:ucanaccess://c:/Users\\hab\\Desktop\\Decisions1.accdb","","");
	
                }
                
		catch(Exception e)
		{
			System.out.println("ERREUR");
		}
	}

//****************************************************************************
      // method used to search Person against "EmployeeNbr" provDecNumbered 
	public ArrayList searchPerson(int n)
	{
		try
		{
			String sql = "SELECT * FROM Decisions WHERE EmployeeNbr=?";

			// Create a statement
 			PreparedStatement ps = conn.prepareStatement(sql);
			ps.setInt(1,n);

			// execute the statement
			ResultSet rs = ps.executeQuery();

                  
                  String LastName = "";
                  String FirstName = "";

                  int DecNumber;
                  int Pourcent;
                  int EmployeeNbr;
			// process resultset
			while(rs.next())
			{
                                EmployeeNbr = rs.getInt("EmployeeNbr");
				FirstName = rs.getString("FirstName");
                                LastName = rs.getString("LastName");
                                DecNumber = rs.getInt("DecNumber");
				Pourcent = rs.getInt("Pourcent");
                                
				//Create a PersonInfo object
				PersonInfo person = new PersonInfo(EmployeeNbr,LastName,FirstName,DecNumber, Pourcent);

				//Add the person object to array list
				personsList.add(person);
                                System.out.println("EPersonDAO 1 :" + LastName);
			}
		}
		catch(Exception e)
		{
			System.out.println(e);
		}
           
		return personsList;

	} // end searchPerson() method

//*****************************************************************************************
	public void savePerson(PersonInfo person)
	{
		try
		{
			String sql = "INSERT INTO Decisions(EmployeeNbr, LastName, FirstName, DecNumber, Pourcent) VALUES (?,?,?,?,?) ";

			// Create a statement
 			PreparedStatement ps = conn.prepareStatement(sql);
	
			ps.setInt(1 , person.getEmployeeNbr());
                        ps.setString(2 , person.getLastName());
			ps.setString(3 , person.getFirstName());
                        ps.setInt(4 , person.getDecNumber());
                        ps.setInt(5 , person.getPourcent());
			// execute statement
			ps.executeUpdate();
		}
		catch(Exception e)
		{
			System.out.println(e);
		}
	}

//*********************************************************************************************
	public void updatePerson(PersonInfo person)
	{
		try
		{
			String sql = "UPDATE Decisions SET EmployeeNbr = ?, LastName=? ,FirstName=?, Pourcent=? where DecNumber=?";

			// Create a statement
 			PreparedStatement ps = conn.prepareStatement(sql);
	
			ps.setInt(1 , person.getEmployeeNbr());		
			ps.setString(2 , person.getLastName());
                        ps.setString(3 , person.getFirstName());
			ps.setInt(4 , person.getPourcent());
			
			// execute the statement
			ps.executeUpdate();
		}
		catch(Exception e)
		{
			System.out.println(e);
		}
	}

//************************************************************************************************
	public int removePerson(String EmployeeNbr)
	{
            // used to determine how many records deleted 
            int no = 0;

		try
		{
			String sql = "DELETE FROM Decisions WHERE EmployeeNbr = ?";

			// Create a statement
 			PreparedStatement ps = conn.prepareStatement(sql);
			ps.setString(1, EmployeeNbr);

			// execute the statement
			no = ps.executeUpdate();
		}
		catch(Exception e)
		{
			System.out.println(e);
		}

            return no;
	}

//*************************************************************************************************
	protected void finalize()
	{
		try
		{
                  if (conn != null) {
			  conn.close();
                  }
		}
		catch(Exception e)
		{
			System.out.println(e);
		}
	}

}// end class PersonDAO
Code:
Ecran 1 - EmployeeNbr :java.awt.TextField[textfield0,72,10,82x23,text=2,editable,selection=1-1]
Ecran 1 - TxtLastName :java.awt.TextField[textfield1,72,43,82x23,text=lion,editable,selection=4-4]
Ecran 2 :lion