I'm storing measurements in a MySQL database. The measurements contain a timestamp field which stores timestamps in the following format:
2015-10-10 10:10:10.11 (so with two digits of milliseconds)
In my Java code I retrieve this value with:
resultSet.getTimestamp(id)
When I print this value it gives me:
2015-10-10 11:11:11.000000011
So I'm trying to figure out WHY it behaves like this and HOW I should solve this issue so I get the right value?
EDIT:
The values show correctly inside the database itself when using select * from measurement
My guess it should be somewhere in the way it is retrieved by Java / JDBC. Both getTimestamp and getString give me the same result.
EDIT 2:
resultSet = statement.executeQuery("select * from measurement");
Measurement m;
while(resultSet.next()) {
m = new Measurement(
resultSet.getString(1),
resultSet.getString(2),
resultSet.getDouble(4),
resultSet.getTimestamp(3));
System.out.println(m);
}