I'm parsing a large text file to add it into mySQL database, the file is more than 10K lines, each lines with more than 20 columns (line seperated by ",").
Before I start coding, I wanted to know which is the best way (in term of memory and execution time) between those two solutions :
- The easy way : Line by line
Adding row by row (more than 10K insert into) : The easiest way
- Complicated way
Parsing the whole file, creating ArrayList for each column, then inserting all the data in only one statement.
Does the "complicated way" save me a lot in the execution time ?
Thanks