Recently we upgraded java runtime environment in UNIX from jdk 1.4 to jdk 8. What we found is, the date that is getting inserted in oracle database is with timestamp (dd-mm-yyyy hh:mm:ss). Before upgrade, it was only date (dd-mm-yyyy). Is this is due to jdk upgrade. Same build is used which was running in JDK 1.4 after upgrading to JDK 8 also. We are facing this issue with JDK 6 also.
Did any one came across this kind of situation. I am not able to understand, just upgrading the java environment is creating this issue as there are no code changes.
Is the default date format in JDK 1.4 is different from JDK8 or 6.
Is there any way we can overcome this issue without code modifications like converting date to the required format using SimpleDateFormat etc. Below is the code we are using to convert date in to required format.
SimpleDateFormat sdf = new SimpleDateFormat("dd-mm-yyyy");
java.util.Date d = sdf.parse(inputDate);
stmt.setDate(1, new java.sql.Date(d.getTime()));