The sql statement of mysql can be operated successfully in the database, but execute is not successful in the code.

The sql statement of

mysql can be operated successfully in the database, but execute is not successful in the code.

String comput_rsi= "update price set rsi6= (100*aver_up_6) / (aver_up_6-aver_down_6)";
/ / "update price set rsi6=123"; A fixed value such as 123 can be written in Java code.
/ / rsi6,aver_up_6,aver_down_6 are all in the same data
stmt.execute (comput_rsi);

or how to add two fields in the same data to another field of this data, is the SQL statement I wrote is not correct

throws this exception
java.sql.SQLIntegrityConstraintViolationException: Le champ "rsi6" ne peut tre vide (null)

Nov.05,2021
There is nothing wrong with the

statement, and the phenomenon of the card owner should be in execution. Do you want to update the rsi6 of the whole table, so that each row of data needs to be calculated, and if the amount of data is large, it will be executed for a long time. If you do not want to update the whole table, it is recommended to add where conditions to limit the specific data rows.


find out what the problem is. The divisor of
cannot be 0, and the divisor of
is 0. The program reports an error and the card owner

Menu