I have successfully used the csvjdbc1.0-35 for all of my database retrieval requirements with the exception of the where fieldName Like value% clause. I am connecting to a file system as served via http. Below is my connection sequence
selectPhrase = "Select Amount ";
fromPhrase = " From http://10.31.46.143:8080/Extracts/20210331/DataSet ";
wherePhrase = " Where criteriaField Like '1%'";
sqlStmt = selectPhrase + fromPhrase + wherePhrase;
Class.forName("org.relique.jdbc.csv.CsvDriver");
Connection conn = DriverManager.getConnection("jdbc:relique:csv:class:" +
MyHTTPReader.class.getName());
Statement stmt = conn.createStatement();
ResultSet results = stmt.executeQuery(sqlStmt);
while (results.next()) {
String amtS = results.getString(1);
}
I have not had any issues with any other wherePhrases' (eg: criteriaField = '10', criteriaField <> '15', etc) but when I use the wherePhrase = "criteriaField Like '1%'", results executes but returns as empty. My csv file is approximately 250K records