I have been tasked with comparing data in an excel file (in .csv format) to my companies oracle database in Java. Once the data has been compared, I need to write if the data is the same or different to a new .csv file.
I have written the read and write methods to access the excel file.
I do not know how to actually compare columns in excel to columns in the oracle database.
Here is the stringbuilder given to me to actually select the data from the table.
//***********************************************************************
//SQL string builder
//***********************************************************************
StringBuilder sSQL = new StringBuilder("");
sSQL.append("SELECT * FROM NSA_AL.POLVEHICLE PV");
sSQL.append(" WHERE PV.VIN='?'");
sSQL.append(" AND PV.POLICYID='?'");
sSQL.append(" AND PV.SEGEFFDATE<=TO_DATE('06/10/2012 08:00','MM/DD/YYYY HH24:MI')");
sSQL.append(" AND PV.SEGEXPDATE>=TO_DATE('06/10/2012 08:00','MM/DD/YYYY HH24:MI')");
sSQL.append(" AND PV.SEGSTATUS=");
Any help would be appreciated.