Load CSV file to MySQL server using Java
<p>I am struggling with loading a CSV file into a table in MySQL server. It gives me the working directory error, and I am guessing that </p>

<pre class="lang-none prettyprint-override"><code>C://Users//SCSC//Desktop//district.csv
</code></pre>

<p>this is where I am typing in a wrong syntax. I have tried double back slashes, forward slash, but none of them works.</p>

<pre><code>public void readCsvUsingLoad(Connection conn, String district) {
    try {
        String loadQuery = "LOAD DATA LOCAL INFILE 'C://Users//SCSC//Desktop//district.csv' INTO TABLE district FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (District_ID, A2, A3, A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16);";
        System.out.println(loadQuery);
        Statement stmt = conn.createStatement();
        stmt.execute(loadQuery);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
</code></pre>