Class DateParameter
- java.lang.Object
-
- org.mariadb.jdbc.internal.com.send.parameters.DateParameter
-
- All Implemented Interfaces:
java.lang.Cloneable
,ParameterHolder
public class DateParameter extends java.lang.Object implements java.lang.Cloneable, ParameterHolder
-
-
Field Summary
Fields Modifier and Type Field Description private java.sql.Date
date
private Options
options
private java.util.TimeZone
timeZone
-
Fields inherited from interface org.mariadb.jdbc.internal.com.send.parameters.ParameterHolder
BINARY_INTRODUCER, QUOTE
-
-
Constructor Summary
Constructors Constructor Description DateParameter(java.sql.Date date, java.util.TimeZone timeZone, Options options)
Represents a date, constructed with time in millis since epoch.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeLongData()
private byte[]
dateByteFormat()
int
getApproximateTextProtocolLength()
ColumnType
getColumnType()
boolean
isNullData()
java.lang.String
toString()
void
writeBinary(PacketOutputStream pos)
Write data to socket in binary format.void
writeTo(PacketOutputStream os)
Write to server OutputStream in text protocol.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.internal.com.send.parameters.ParameterHolder
writeLongData
-
-
-
-
Field Detail
-
date
private final java.sql.Date date
-
timeZone
private final java.util.TimeZone timeZone
-
options
private final Options options
-
-
Constructor Detail
-
DateParameter
public DateParameter(java.sql.Date date, java.util.TimeZone timeZone, Options options)
Represents a date, constructed with time in millis since epoch.- Parameters:
date
- the datetimeZone
- timezone to useoptions
- jdbc options
-
-
Method Detail
-
writeTo
public void writeTo(PacketOutputStream os) throws java.io.IOException
Write to server OutputStream in text protocol.- Specified by:
writeTo
in interfaceParameterHolder
- Parameters:
os
- output buffer- Throws:
java.io.IOException
- when something goes wrong
-
dateByteFormat
private byte[] dateByteFormat()
-
getApproximateTextProtocolLength
public int getApproximateTextProtocolLength()
- Specified by:
getApproximateTextProtocolLength
in interfaceParameterHolder
-
writeBinary
public void writeBinary(PacketOutputStream pos) throws java.io.IOException
Write data to socket in binary format.- Specified by:
writeBinary
in interfaceParameterHolder
- Parameters:
pos
- socket output stream- Throws:
java.io.IOException
- if socket error occur
-
getColumnType
public ColumnType getColumnType()
- Specified by:
getColumnType
in interfaceParameterHolder
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceParameterHolder
- Overrides:
toString
in classjava.lang.Object
-
isNullData
public boolean isNullData()
- Specified by:
isNullData
in interfaceParameterHolder
-
canBeLongData
public boolean canBeLongData()
- Specified by:
canBeLongData
in interfaceParameterHolder
-
-