Documentation Home
MySQL Connector/J 8.0 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.8Mb
PDF (A4) - 0.8Mb
HTML Download (TGZ) - 146.6Kb
HTML Download (Zip) - 166.0Kb


6.6.2 Fractional Seconds

While a java.sql.TIME instance, according to the JDBC specification, is not supposed to contain fractional seconds by design, because java.sql.TIME is a wrapper around java.util.Date, it is possible to store fractional seconds in a java.sql.TIME instance. However, when Connector/J inserted a java.sql.TIME into the server as a MySQL TIME value, the fractional seconds were always truncated. To allow the fractional seconds to be sent to the server, a connection property, sendFractionalSecondsForTime, has been introduced in release 8.0.23: when the property is true (which is the default value), the fractional seconds for java.sql.TIME are sent to the server; otherwise, the fractional seconds are truncated.

Also, the connection property sendFractionalSeconds has become a global control for the sending of fractional seconds for ALL date-time types since release 8.0.23. As a result, if sendFractionalSeconds=false, fractional seconds are not sent irrespective of the value of sendFractionalSecondsForTime.