hi,
i am doing a system in java for my assignment .that system is able to add ,delete,modify records. i have created sql commands for all in my programme.but i don't know how to put codings on above buttons
here i attach some cods.any one please help me.

this is my insert person function where i declared in queries.class.

public int addPerson(int  dd,String namee,String addresse,int phonee,int agee)
     {
         int result =0;
         try
         {
             insertnewperson.setInt(1,dd);
             insertnewperson.setString(2,namee);
             insertnewperson.setString(3,addresse);
             insertnewperson.setInt(4,phonee);
             insertnewperson.setInt(5,agee);

             result =insertnewperson.executeUpdate();

         }
         catch(SQLException sqlException)
         {
             sqlException.printStackTrace();
             close();
         }

     return result;

     }

this is insertbutton syntax.

private void insertButtonActionPerformed(ActionEvent evt){

               int result =personQueries.addPerson(idTextfield.getText(), nameTextfield.getText(),addressTextfield.getText(),phoneTextfield.getText(),ageTextfield.getText());
                 if(result ==1)
            JOptionPane.showMessageDialog(this,"customer added","Customer added",JOptionPane.PLAIN_MESSAGE);
                else
             JOptionPane.showMessageDialog(this,"customer not added","Customer not added",JOptionPane.PLAIN_MESSAGE);
                browseButtonActionPerformed(evt);

            }

when i tried to run the code ,it show a error message like
"addPerson(int,java.lang.String,java.lang.string,int,int)in personqueries cantbe applied to (java.lang.string,java.lang.string,java.lang.string,java.lang.string,java.lang.string,)
incompatiable type
required:int

how to read that integers as text?

Integer.toString ??
Search somewhere, but I think that it's it.

Actually bernadlosini needs to convert the String from the
"ageTextfield.getText" and the others to int: Integer.parseInt("1.0")

int age = Integer.parseInt( ageTextfield.getText() );
This article has been dead for over six months. Start a new discussion instead.