I am trying to read data from a text file and input them into a database. I found this example in the SQL docs that fits my case:
LOAD DATA INFILE 'data.txt' INTO TABLE table2 FIELDS TERMINATED BY ',';
So I am trying to write this in Java. So far I have this:
String insertTableSQL = "LOAD DATA INFILE 'C:/Users/Work/Desktop/test/masterDict'"
+ "INTO TABLE masterdict" + "FIELDS TERMINATED BY \',\'"
;
But this gives me the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TERMINATED BY ','' at line 1