Bug #56479 | getTimestamp throws exception | ||
---|---|---|---|
Submitted: | 2 Sep 2010 3:55 | Modified: | 21 Apr 2016 19:37 |
Reporter: | Di-Shi Sun | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 5.1.13 | OS: | Linux (CentOS 5.2) |
Assigned to: | Filipe Silva | CPU Architecture: | Any |
[2 Sep 2010 3:55]
Di-Shi Sun
[3 Sep 2010 14:16]
Dmitry Isakbayev
A work around is to call getString("Updated") instead of rs.getTimestamp("Updated") and then parse the string value into a Date object.
[26 Sep 2011 6:52]
Tonci Grgin
Di-Shi, can you please try the latest driver (5.1.17 at the time) and report back if the error still persists.
[26 Oct 2011 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[29 Apr 2013 13:26]
Alexander Soklakov
Hi Di-Shi, Verified with latest sources. Result set doesn't contain metadata when last rs.getTimestamp("Updated") is called, that causes NPE.
[21 Apr 2016 19:37]
Daniel So
Added the following entry to the MySQL Connector/J 5.1.39 changelog: "Calling getTimestamp() on a timestamp column resulted in a java.sql.SQLException (Cannot convert value ... to TIMESTAMP). That was deal to the missing metadata for each row in the ResultSet, which is now restored with this fix."
[27 Apr 2016 19:08]
Daniel So
Corrected the changelog entry for the bug to the following: "Calling getTimestamp() on a timestamp column resulted in a java.sql.SQLException (Cannot convert value ... to TIMESTAMP). That was due to the missing metadata for each row in the ResultSet. This fix ensures that the metadata is no longer missing."