Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping Db2 Timestamp '0001-01-01 00:00:00.0' #728

Open
clovermen opened this issue Jul 17, 2020 · 0 comments
Open

Mapping Db2 Timestamp '0001-01-01 00:00:00.0' #728

clovermen opened this issue Jul 17, 2020 · 0 comments

Comments

@clovermen
Copy link

sfm version 8.2.2

i have a simple pojo with two timestamp fields

  public class Pojo {

   private LocalDateTime firstTimestamp;
   private LocalDateTime secondTimestamp;

i want to read two timestamps from my db2 table and map these into the pojo object.
The firstTimestamp is '0001-01-01 00:00:00.0' and the second like '2020-07-17 13:30:00'

RowMapper<Pojo> rowMapper = JdbcTemplateMapperFactory.newInstance().newRowMapper(Pojo.class);

List<Pojo> dwhQuittungen = this.jdbcTemplate.query("SELECT FIRST_TIMESTAMP, SECOND_TIMESTAMP FROM TABLE WITH UR", rowMapper)

The mapping of the first Timestamp is wrong. In my object is the first timestamp '0000-12-29T23:53:28' and not '0001-01-01T00:00:00.0'. The mapping of the second timestamp is correct. If I use the normal Spring BeanPropertyRowMapper is also working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant