I would like to add data from + in the image, but Blank is not allowed in H2 on the spring. "Data conversion error converting" error appears.
This error appears when the type is set to Integer.
·spring(STS)
H2:
STS:
java spring spring-boot
This is because the type of value you are trying to insert is different from the type in the column.
The SQL displayed in the attached image is missing, so I don't know exactly what it is, but the question statement suggests that you are trying to insert the string '
from in the column of type integer
.
In this case, null
should be configured.
Example Execution:
create table my_table(my_column integer);
insert into my_table(my_column) values(');
insert into my_table(my_column) values(null);
Results:
create table my_table(my_column integer);
Number of updates: 0
(1ms)
insert into my_table(my_column) values(');
Error occurred during data conversion "(MY_TABLE:"MY_COLUMN""INTEGER)"
Data conversion error converting ''(MY_TABLE: ''MY_COLUMN''"INTEGER); SQL statement:
insert into my_table(my_column) values(') [22018-200] 22018/22018 (Help)
insert into my_table(my_column) values(null);
Number of updates: 1
(0ms)
© 2024 OneMinuteCode. All rights reserved.