Please indent your code and use the code button, which will make the code easier to read. You can hide all sorts of errors behind badly‑formatted code. I think you have added mistakes when copying your code; you wrote oClie ntes when I think you meant oClientes.
Please start by disconnecting your code from the GUI. Print out the results to System.out. It is much more difficult to find errors via a GUI.
I shall add you to our Databases forum.
I think you shouldn't add a GUI until you have the program working correctly at the command line/terminal. The more intermediate stages you have, the more opportunity there is for something to go wrong, and the more difficult it is to find the error. What happens when you use that query directly on the database?
Thank you for your answer, I will have to rediseign my program to do it without GUI.
When I use the Query :
In the images that I attached, you can see that in the screenshot 4 The query do the operation ok but in a new line I would need insert it at the end of the same row, but the second problem is when i run for the second time it duplicate all the registers as you can see in the screenshot 6.
I have this methods in the frm:
This is for the table
This is to show the data from the database in the table
This is to catch the data from the boxes in the GUI
This is to clean the boxes
AND THIS do the query to insert data in the database
This is the mehot that I tried to insert the SUM It works but not As i Need you can see it in the screenshot 7
This is my table in the database,(screenshot 8) may be if I can use an excep or a validator to avoid the duplicate data, may be the query that a i use is wrong or what i am trying to do it's wrong from the root jeje
What if you did it with two SQL calls instead of one. The first to add the two columns and put the result in the total column. The second step to sum the total column and insert a new record. Of course if you want to run step two another time you'd have to delete the total record at the end first.