Package com.mysql.cj.result
Class SqlTimestampValueFactory
java.lang.Object
com.mysql.cj.result.DefaultValueFactory<T>
com.mysql.cj.result.AbstractDateTimeValueFactory<java.sql.Timestamp>
com.mysql.cj.result.SqlTimestampValueFactory
- All Implemented Interfaces:
ValueFactory<java.sql.Timestamp>
public class SqlTimestampValueFactory extends AbstractDateTimeValueFactory<java.sql.Timestamp>
Value factory to create
Timestamp instances. Timestamp instances are created from fields returned from the db without a timezone. In order
to create a point-in-time, a time zone must be provided to interpret the fields.-
Field Summary
Fields inherited from class com.mysql.cj.result.DefaultValueFactory
jdbcCompliantTruncationForReads, pset -
Constructor Summary
Constructors Constructor Description SqlTimestampValueFactory(PropertySet pset, java.util.Calendar calendar, java.util.TimeZone defaultTimeZone, java.util.TimeZone connectionTimeZone) -
Method Summary
Modifier and Type Method Description java.lang.StringgetTargetTypeName()Get the actual class name of T parameter.java.sql.TimestamplocalCreateFromDate(InternalDate idate)Create a Timestamp from a DATE value.java.sql.TimestamplocalCreateFromDatetime(InternalTimestamp its)java.sql.TimestamplocalCreateFromTime(InternalTime it)Create a Timestamp from a TIME value.java.sql.TimestamplocalCreateFromTimestamp(InternalTimestamp its)Methods inherited from class com.mysql.cj.result.AbstractDateTimeValueFactory
createFromBytes, createFromDate, createFromDatetime, createFromTime, createFromTimestamp, createFromYearMethods inherited from class com.mysql.cj.result.DefaultValueFactory
createFromBigDecimal, createFromBigInteger, createFromBit, createFromDouble, createFromLong, createFromNull, setPropertySet, unsupported
-
Constructor Details
-
SqlTimestampValueFactory
public SqlTimestampValueFactory(PropertySet pset, java.util.Calendar calendar, java.util.TimeZone defaultTimeZone, java.util.TimeZone connectionTimeZone)- Parameters:
pset-PropertySetcalendar- Calendar used to interpret the fields.defaultTimeZone- The local JVM time zone.connectionTimeZone- The server session time zone as defined by connectionTimeZone property.
-
-
Method Details
-
localCreateFromDate
Create a Timestamp from a DATE value.- Returns:
- a timestamp at midnight on the day given by the DATE value
-
localCreateFromTime
Create a Timestamp from a TIME value.- Returns:
- a timestamp at the given time on 1970 Jan 1.
-
localCreateFromTimestamp
-
localCreateFromDatetime
-
getTargetTypeName
public java.lang.String getTargetTypeName()Description copied from interface:ValueFactoryGet the actual class name of T parameter.- Returns:
- class name
-