I am using http://csvjdbc.sourceforge.net/doc.html to treat CSV files on disk (e.g. 'myFile' in 'myDir') as an SQL DB I can query with SQL syntax:
// create connection
Class.forName("org.relique.jdbc.csv.CsvDriver");
Properties props = new Properties();
props.put("separator", ";");
Connection conn = DriverManager.getConnection("jdbc:relique:csv:" + myDir, props);
// run query
Statement stmt = conn.createStatement();
ResultSet myData = stmt.executeQuery("SELECT * FROM \"" + myFile + "\"");
This works fine, but I run into trouble when the CSV file does not have a header. In that case, the first data line is considered as header and thus not read like the other data lines.
Is there any way to tell the query not to look for a header and treat the first line as data input?