Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2184914 | 7 | Lance Andersen | P3 | Resolved | Fixed | b109 |
JDK-2184923 | 6u18 | Abhijit Saha | P2 | Closed | Fixed | b05 |
JDK-2192910 | 5.0u25 | Yumin Qi | P2 | Closed | Fixed | b02 |
JDK-2184910 | 5.0u24-rev | Yumin Qi | P2 | Closed | Fixed | b06 |
JDK-2192858 | 1.4.2_27 | Yumin Qi | P2 | Closed | Fixed | b02 |
JDK-2184911 | 1.4.2_26-rev | Yumin Qi | P2 | Closed | Fixed | b06 |
be thrown if the date given is not in the JDBC date escape format
(yyyy-mm-dd).
The error is not thrown when I enter the value '20009-10-10'. Instead it
silently stores the value. But later when I do java.sql.toString()
public static void main(String[] args) {
java.sql.Date jsd = java.sql.Date.valueOf("20009-06-26");
System.out.println(jsd);
}
The above program prints
*009-06-26 Where '*' is a non-readable character.
We need fix in valueOf method() to throw the exception if we pass 5 digits to
the API.
From API
valueOf
public static Date valueOf(String s)
Converts a string in JDBC date escape format to a Date value.
Parameters:
s - a String object representing a date in in the format "yyyy-mm-dd"
Returns:
a java.sql.Date object representing the given date
Throws:
IllegalArgumentException - if the date given is not in the JDBC date escape format (yyyy-mm-dd)
- backported by
-
JDK-2184914 java.sql.Date.valueOf no exception if date given is not in the JDBC date escape format(yyyy-mm-dd)
- Resolved
-
JDK-2184910 java.sql.Date.valueOf no exception if date given is not in the JDBC date escape format(yyyy-mm-dd)
- Closed
-
JDK-2184911 java.sql.Date.valueOf no exception if date given is not in the JDBC date escape format(yyyy-mm-dd)
- Closed
-
JDK-2184923 java.sql.Date.valueOf no exception if date given is not in the JDBC date escape format(yyyy-mm-dd)
- Closed
-
JDK-2192858 java.sql.Date.valueOf no exception if date given is not in the JDBC date escape format(yyyy-mm-dd)
- Closed
-
JDK-2192910 java.sql.Date.valueOf no exception if date given is not in the JDBC date escape format(yyyy-mm-dd)
- Closed
- relates to
-
JDK-6912298 Additional fix for # 6898593 to cover invalid day or month
- Resolved
-
JDK-7095853 Date.valueOf Java 1.6.0_22 doesn't accept 1 digit month, but Java 1.6.0_11 does
- Closed
-
JDK-4808839 Enhance efficiency of java.sql.Date valueOf()
- Closed