Java batch imports data, database connection is disconnected?

the database uses msyql, to read files from excel written in java, and imports data by line. There are about 100, 000 entries. In the middle of the import, there will be error messages, too many error messages, and screenshots taken separately. The problem of mysql timeout setting has been searched on the Internet, but my situation is obviously not. Is it because of the problem of inserting or updating too much data in a loop

?.

clipboard.png

clipboard.png

clipboard.png

Jan.10,2022
Try setting the parameter

max_allowed_packet larger


it is recommended that multiple pieces of data be spliced into a sql to insert (insert into tablename (.) in batches. Values (.), (.), (.);), sql performs less naturally and is less likely to go wrong.


Sorry, two great gods upstairs, I forgot to open the connection pool. There will be no such problem after opening it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf5996-4651e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf5996-4651e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?