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.String
getTargetTypeName()
Get the actual class name of T parameter.java.sql.Timestamp
localCreateFromDate(InternalDate idate)
Create a Timestamp from a DATE value.java.sql.Timestamp
localCreateFromDatetime(InternalTimestamp its)
java.sql.Timestamp
localCreateFromTime(InternalTime it)
Create a Timestamp from a TIME value.java.sql.Timestamp
localCreateFromTimestamp(InternalTimestamp its)
Methods inherited from class com.mysql.cj.result.AbstractDateTimeValueFactory
createFromBytes, createFromDate, createFromDatetime, createFromTime, createFromTimestamp, createFromYear
Methods 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
-PropertySet
calendar
- 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:ValueFactory
Get the actual class name of T parameter.- Returns:
- class name
-