I have to build an SQL query where I have to replace two params in the String.
- The String variable CLEAN_CSV_PATH which represents a path
- The String variable LINES_TERMINATED_OS which represents a the escape character \r\n that are needed for windows or linux, depends.
The params are provided during Main execution with the Scanner class.
This is my SQL String :
private static String LOAD_ALL_ALIASES = //
"LOAD DATA LOCAL INFILE '" + CLEAN_CSV_PATH + "' INTO TABLE plantbiocore.Alias " //
+ "FIELDS TERMINATED BY ',' " //
+ "OPTIONALLY ENCLOSED BY '\"' "
+ "LINES TERMINATED BY '" + LINES_TERMINATED_OS + "'"
+ "IGNORE 1 LINES " //
+ "(locus_id, organism_id, variable, alias) "; //
Scanner scanner = new Scanner(System.in);
CLEAN_CSV_PATH = scanner.next() // Here the CLEAN_CSV_PATH does not appear in my LOAD_ALL_ALIASES