is it possible?? that
public interface TestRepository extends JpaRepository<Test, Long> {
@Query("LOAD DATA LOCAL FILE ?1 INTO ......")
public void loadCsv(String filePath);
}
because I have to move a lot of data(1M~ rows) to mysql table.
I found some ways for moving data and I am sure LOAD query is fastest. if any guys have any way for solving this problem, please give me advice!
thanks. :)
@Query (value="LOAD DATA LOCAL INFILE 'C:/Users/tester/Documents/transaction_data.txt' INTO TABLE tbl_fin FIELDS TERMINATED BY ',' IGNORE 1 LINES", nativeQuery = true) public void bulkLoadData();However I get the following error.java.sql.SQLException: ResultSet is from UPDATE. No Data.Looking this error up on google, forums have said that this is because the query is not returning data and it should be placed in a stored procedur but MySQL does not allow LOAD DATA commands in a stored procedure. Any thoughts?