Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Beginning from MySQL 5.6.4, milliseconds support is provided for date columns like DATETIME etc.

I just created a table to check if its working:

create table testdata(startime  DATETIME(5));

However, when I save some DATE(java.lang.Date) value using iBATIS framework it is ignoring milliseconds and storing:

2012-04-16 17:54:55.00000

Any idea how to resolve this issue?

When I use an SQL query like INSERT INTO testdata VALUES ('2012-04-16 17:54:55.32345') it stores milliseconds properly. I want it to work via iBATIS.

share|improve this question
Your problem is iBATIS, not MySQL. Perhaps better asked on StackOverflow? – gbn Apr 16 '12 at 13:45
MySQL 5.6 is not officially released yet. So it may be a problem from that side or from iBATIS side or from the way you are connecting these two. – ypercubeᵀᴹ May 17 '12 at 6:46
You could also test with MariaDB 5.5 which is a GA release and has milliseconds support (since 5.2 version I think). – ypercubeᵀᴹ May 17 '12 at 6:47

Similar issue (both Hibernate and MyBatis don't store milliseconds) was solved by upgrading the MySQL driver from mysql-connector-java-5.1.17.jar to mysql-connector-java-5.1.26.jar.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.