Top Description Fields Constructors Methods
com.mysql.cj.result

public Class SqlTimestampValueFactory

extends AbstractDateTimeValueFactory<Timestamp>
Class Inheritance
Imports
java.sql.Timestamp, java.util.Calendar, .Locale, .TimeZone, java.util.concurrent.locks.Lock, .ReentrantLock, com.mysql.cj.Messages, com.mysql.cj.conf.PropertyKey, .PropertySet, com.mysql.cj.exceptions.DataReadException, .ExceptionFactory, .WrongArgumentException, com.mysql.cj.protocol.InternalDate, .InternalTime, .InternalTimestamp

Value factory to create java.sql.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

Modifier and TypeField and Description
private final Calendar
private final TimeZone
private final TimeZone
private final Lock

Constructor Summary

AccessConstructor and Description
public
SqlTimestampValueFactory(PropertySet pset, Calendar
Calendar used to interpret the fields.
calendar
,
TimeZone
The local JVM time zone.
defaultTimeZone
,
TimeZone
The server session time zone as defined by connectionTimeZone property.
connectionTimeZone
)

Method Summary

Modifier and TypeMethod and Description
public String
getTargetTypeName()

Implements com.mysql.cj.result.ValueFactory.getTargetTypeName.

Get the actual class name of T parameter.

public Timestamp

Returns:

a timestamp at midnight on the day given by the DATE value
localCreateFromDate
(InternalDate idate)

Implements abstract com.mysql.cj.result.AbstractDateTimeValueFactory.localCreateFromDate.

Create a Timestamp from a DATE value.

public Timestamp
public Timestamp

Returns:

a timestamp at the given time on 1970 Jan 1.
localCreateFromTime
(InternalTime it)

Implements abstract com.mysql.cj.result.AbstractDateTimeValueFactory.localCreateFromTime.

Create a Timestamp from a TIME value.

public Timestamp
Inherited from com.mysql.cj.result.AbstractDateTimeValueFactory:
createFromBytescreateFromDatecreateFromDatetimecreateFromTimecreateFromTimestampcreateFromYear

Field Detail

calback to summary
private final Calendar cal
connectionTimeZoneback to summary
private final TimeZone connectionTimeZone
defaultTimeZoneback to summary
private final TimeZone defaultTimeZone
defaultTimeZoneLockback to summary
private final Lock defaultTimeZoneLock

Constructor Detail

SqlTimestampValueFactoryback to summary
public SqlTimestampValueFactory(PropertySet pset, Calendar calendar, TimeZone defaultTimeZone, TimeZone connectionTimeZone)
Parameters
pset:PropertySet

PropertySet

calendar:Calendar

Calendar used to interpret the fields.

defaultTimeZone:TimeZone

The local JVM time zone.

connectionTimeZone:TimeZone

The server session time zone as defined by connectionTimeZone property.

Method Detail

getTargetTypeNameback to summary
public String getTargetTypeName()

Implements com.mysql.cj.result.ValueFactory.getTargetTypeName.

Doc from com.mysql.cj.result.ValueFactory.getTargetTypeName.

Get the actual class name of T parameter.

Returns:String

class name

Annotations
@Override
localCreateFromDateback to summary
public Timestamp localCreateFromDate(InternalDate idate)

Implements abstract com.mysql.cj.result.AbstractDateTimeValueFactory.localCreateFromDate.

Create a Timestamp from a DATE value.

Returns:Timestamp

a timestamp at midnight on the day given by the DATE value

Annotations
@Override
localCreateFromDatetimeback to summary
public Timestamp localCreateFromDatetime(InternalTimestamp its)

Implements abstract com.mysql.cj.result.AbstractDateTimeValueFactory.localCreateFromDatetime.

Annotations
@Override
localCreateFromTimeback to summary
public Timestamp localCreateFromTime(InternalTime it)

Implements abstract com.mysql.cj.result.AbstractDateTimeValueFactory.localCreateFromTime.

Create a Timestamp from a TIME value.

Returns:Timestamp

a timestamp at the given time on 1970 Jan 1.

Annotations
@Override
localCreateFromTimestampback to summary
public Timestamp localCreateFromTimestamp(InternalTimestamp its)

Implements abstract com.mysql.cj.result.AbstractDateTimeValueFactory.localCreateFromTimestamp.

Annotations
@Override