I have LATEST_MODIFICATION_DATE
field in my database table which is timestamp datatype.
I am using plane jdbcTemplate
for database execute queries.
Below is part of my code which is working fine. But I see an issue on the line
latestModDate = rowSet.getString("LATEST_MODIFICATION_DATE");
Because I am trying to treat LATEST_MODIFICATION_DATE
timestamp datatype field as a string it might create problem in my code in future.
I tried to update the line below and then declare LATEST_MODIFICATION_DATE
as timestamp
datatype but getting error as oracle.sql.timestamp cannot be cast to java.util.date
.
latestModDate = rowSet.getTimestamp("LATEST_MODIFICATION_DATE");
I really dont know how to treat LATEST_MODIFICATION_DATE
as timestamp. I really dont want to make change in system property like below as i want to handle this issue in code:
java -Doracle.jdbc.J2EE13Compliant=true YourApplication
or
System.getProperties().setProperty("oracle.jdbc.J2EE13Compliant", "true")
Below is part of my code:
String orderID = null, extOrdId = null, latestModDate = null;
while (rowSet.next()) {
latestModDate = rowSet.getString("LATEST_MODIFICATION_DATE");
}