Custom JDBC will be the best in this case, here is why:
Custom JDBC executes SQL directly, reducing latency and memory usage.
JPA (Hibernate) introduces ORM overhead, persistence context tracking, and automatic flushing, which significantly slow down bulk operations.
JDBC Batch Processing allows optimized bulk inserts/updates, while JPA requires additional configurations.
References:
Bulk insert: JdbcTemplate vs JPA
https://forums.oracle.com/ords/apexds/post/is-jpa-effecient-enough-to-use-bulk-insert-using-jpa-0711
https://medium.com/%40wahyaumau/boost-jpa-bulk-insert-performance-by-90-3a6232d9068d