I have written a simple SQL query to fetch few columns from a table. I have created a OIM Script, which is currently running a SQL query and exporting that in a CSV. However, I am looking for to add date in the file name but not able to find any clue.
I am using CSVWritter.
CSVWriter writer = new CSVWriter(new FileWriter("Path", false));
ResultSetMetaData Mdata = rs.getMetaData();
What is the exact statement what to add in this to get the date in the file name?
Expected file name: Filename_Date.csv
Maybe get the current Date as a string when creating the filewriter and then just append it to the name as follows:
You can also change the format of the timestamp using the formatting rules of the simple date format: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html