```
public void addPhoneInvoice(String IMEI,String price,String name, 
  String pNumber) throws SQLException {

    con = GetConnection.GetConnection();
    stmt = con.createStatement();

    DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
    Date date = new Date();
    String date1 = dateFormat.format(date);

    this.price = Double.parseDouble(price);

    String updatePhn = "DELETE FROM phonestock where IMEI = '"+IMEI+"'";
    int j = stmt.executeUpdate(updatePhn);
    if(j!=0){

    String getDescriptionQuary = "SELECT PhoneName,WarrantyPeriod,YearORMonth FROM      phonestock WHERE IMEI = '"+IMEI+"'";
    ResultSet rs1 = stmt.executeQuery(getDescriptionQuary);

    while(rs1.next()){
        this.phoneName = rs1.getString("PhoneName");
        this.warranty = rs1.getInt("WarrantyPeriod");
        this.yearOrMonth = rs1.getString("YearORMonth");
    }   

    String addPhnTemp = "INSERT INTO invoiceTemp(Description,Date,IMEI,Price,Amount,ContactName,ContactNumber,Warranty,YearOrMonth) VALUES ('"+phoneName+"','"+date1+"','"+IMEI+"',"+price+","+price+",'"+name+"','"+pNumber+"',"+warranty+",'"+yearOrMonth+"')";
    String addPhnPer = "INSERT INTO invoicepermanent(Description,Date,IMEI,Price,Amount,ContactName,ContactNumber,Warranty,YearOrMonth) VALUES ('"+phoneName+"','"+date1+"','"+IMEI+"',"+price+","+price+",'"+name+"','"+pNumber+"',"+warranty+",'"+yearOrMonth+"')";

    int i = stmt.executeUpdate(addPhnTemp);
    i = stmt.executeUpdate(addPhnPer);           

    if(i != 0)
        JOptionPane.showMessageDialog(null,"Success");
    }
    else
        JOptionPane.showMessageDialog(null,"Error");
}       

```

}

this shows Success, but `phoneName`, `warranty`, and `yearOrMonth` didn't return from the database.