It seems that the length of sql cannot exceed 4000 characters. The long type is no longer recommended. It is recommended to use clob fields.
Change the char type in the database to nvarchar2 type, and then you can directly store String type data in it. If you are using an ORACLE database. --.
According to the string splitting function, these data are first converted into datatable type and then inserted into the database. It has been implemented before, but I have forgotten it now. The specific idea is like this. You can try to implement it yourself. .
You set a breakpoint here with stmt.executeUpdate(sql), then copy the SQL value, put it into the database and run it directly. When the copied SQL runs directly, there will be no problem. Then the program will be fine.
You can serialize the string array and convert it into a string, and then save it to a field in the database. When obtaining an array, you can first read a field to obtain the string and then deserialize it to obtain the array.