I'm fairly new to Spring boot.
I'm currently writing a small microservice which will bulk load data from a CSV file into a MySQL database table. I understand that there are many ways to achieve this, but one of the ways I was thinking was to use the MySQL LOAD DATA FILE command to parse the csv file and load the data into the database table.
I was wondering if anyone knows of a way that I can invoke the MySQL LOAD DATA command using the Spring boot JPA library ?
Any help/ advice is appreciated.
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 procedure but MySQL does not allow LOAD DATA commands in a stored procedure. Any thoughts?