Reputation: 417
I have to import data from a CSV file into MySQL database using JSP/Servlet. While searching I got this link! where it is said that we can use MySQL command "LOAD DATA INFILE ..." in hibernates createSQLQuery.
But in my case the table in which I need to upload the data is distributed on multiple database server. I would be getting a API through which I would get the connection to the database.
My query is, where should I save the CSV file -- in my tomcat server or on the system where I would be executing the "LOAD DATA INFILE ..." command.
Upvotes: 1
Views: 2445
Reputation: 10512
CSV file should be saved on server running MySQL DB. Also access privileges should be set that the user which MySQL Server is run under is allowed to access this file.
You might also find article on LOAD DATA INFILE from MySQL docs useful.
Upvotes: 1