Hi

 

I have a form with 5 attributes the class Book. The first attribute is primary key.

 

When I click in button "update", I need Recovery only the attribute(s) that I changed.

 

This I managed to do so

 

Book updateBook = new Book();


if(!tf2.getText().equals(aux2)){

   updateBook.setActor(tf2.getText());

   checkFieldUpdate = true;

}


if(!tf3.getText().equals(aux3)){

   updateBook.setEditora(tf3.getText());

   checkFieldUpdate = true;

}

    

if(!tf4.getText().equals(aux4)){

   updateBook.setYear(tf4.getText());

   checkFieldUpdate = true;

}


if(!tf5.getText().equals(aux5)){

   updateBook.setLocal(tf5.getText());

   checkFieldUpdate = true;

}

 

The variabels aux2,aux3,aux4,aux5 I recovered the vlaues When I did the research

 

Here is my problem:

 

      if(checkFieldUpdate ){

          ALDAL.update(updateBook );

      }

 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _

 

 

public static void update(Book updateBook){

     Method mtd;

     String sql = "Update TabBook set ";

 

   After the set, I need to pass only the values that I changed in form.

 

Can anyone help me?

 

Thanks

Marcos Santiago

FacebookTwitterLinkedin
Pin It
Joomla Tutorials for Beginners