public class XSQLVAR
extends java.lang.Object
XSQLDA
is a java mapping of the XSQLVAR server
data structure used to represent one column for input and output.Modifier and Type | Field and Description |
---|---|
java.lang.String |
aliasname |
java.lang.Object |
cachedobject |
protected org.firebirdsql.encodings.Encoding |
coder |
java.lang.String |
ownname |
java.lang.String |
relaliasname |
java.lang.String |
relname |
byte[] |
sqldata |
int |
sqllen |
java.lang.String |
sqlname |
int |
sqlscale |
int |
sqlsubtype |
int |
sqltype |
Constructor and Description |
---|
XSQLVAR() |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(XSQLVAR original)
Copy constructor.
|
void |
copyFrom(XSQLVAR original,
boolean copyData)
Copy constructor.
|
boolean |
decodeBoolean(byte[] data)
Decode boolean from supplied data.
|
java.sql.Date |
decodeDate(byte[] byte_int)
Decode a
byte array into a Date value. |
java.sql.Date |
decodeDate(java.sql.Date d,
java.util.Calendar cal)
Decode a
Date value using a given Calendar . |
java.sql.Date |
decodeDateCalendar(byte[] byte_int,
java.util.Calendar c) |
double |
decodeDouble(byte[] byte_int)
Decode a
byte array into a double value. |
float |
decodeFloat(byte[] byte_int)
Decode a
byte array into a float value. |
int |
decodeInt(byte[] byte_int)
Decode a
byte array into an int value. |
long |
decodeLong(byte[] byte_int)
Decode a
byte array into a long value. |
short |
decodeShort(byte[] byte_int)
Decode a
byte array into a short value. |
java.lang.String |
decodeString(byte[] value,
java.lang.String encoding,
java.lang.String mappingPath)
Decode an encoded
byte array into a String
using a given encoding. |
java.sql.Time |
decodeTime(byte[] int_byte)
Decode a
byte array into a Time value. |
java.sql.Time |
decodeTime(java.sql.Time d,
java.util.Calendar cal,
boolean invertTimeZone)
Decode a
Time value using a given Calendar . |
java.sql.Time |
decodeTimeCalendar(byte[] int_byte,
java.util.Calendar c) |
java.sql.Timestamp |
decodeTimestamp(byte[] byte_int)
Decode a
byte array into a Timestamp . |
java.sql.Timestamp |
decodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal)
Decode a
Timestamp value using a given
Calendar . |
java.sql.Timestamp |
decodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal,
boolean invertTimeZone)
Decode a
Timestamp value using a given
Calendar . |
java.sql.Timestamp |
decodeTimestampCalendar(byte[] byte_int,
java.util.Calendar c) |
XSQLVAR |
deepCopy()
Get a deep copy of this object.
|
byte[] |
encodeBoolean(boolean value)
Encodes boolean to 1 byte data.
|
byte[] |
encodeDate(java.sql.Date d)
Encode a
Date value into a byte array. |
java.sql.Date |
encodeDate(java.sql.Date d,
java.util.Calendar cal)
Encode a given
Date value using a given
Calendar . |
byte[] |
encodeDateCalendar(java.sql.Date d,
java.util.Calendar c) |
byte[] |
encodeDouble(double value)
Encode a
double value as a byte array. |
byte[] |
encodeFloat(float value)
Encode a
float value as a byte array. |
byte[] |
encodeInt(int value)
Encode an
int value as a byte array. |
byte[] |
encodeLocalDate(int year,
int month,
int day)
Encodes a java.time.LocalDate equivalent to date bytes.
|
byte[] |
encodeLocalDateTime(int year,
int month,
int day,
int hour,
int minute,
int second,
int nanos)
Encodes a java.time.LocalDateTime equivalent to timestamp bytes.
|
byte[] |
encodeLocalTime(int hour,
int minute,
int second,
int nanos)
Encodes a java.time.LocalTime equivalent to time bytes.
|
byte[] |
encodeLong(long value)
Encode a
long value as a byte array. |
byte[] |
encodeShort(short value)
Encode a
short value as a byte array. |
byte[] |
encodeString(byte[] value,
java.lang.String encoding,
java.lang.String mappingPath)
Encode a
byte array using a given encoding. |
byte[] |
encodeString(java.lang.String value,
java.lang.String encoding,
java.lang.String mappingPath)
Encode a
String value into a byte array using
a given encoding. |
byte[] |
encodeTime(java.sql.Time d)
Encode a
Time value into a byte array. |
java.sql.Time |
encodeTime(java.sql.Time d,
java.util.Calendar cal,
boolean invertTimeZone)
Encode a given
Time value using a given
Calendar . |
byte[] |
encodeTimeCalendar(java.sql.Time d,
java.util.Calendar c) |
byte[] |
encodeTimestamp(java.sql.Timestamp value)
Encode a
Timestamp as a byte array. |
java.sql.Timestamp |
encodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal)
Encode a
Timestamp using a given Calendar . |
java.sql.Timestamp |
encodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal,
boolean invertTimeZone)
Encode a
Timestamp using a given Calendar . |
byte[] |
encodeTimestampCalendar(java.sql.Timestamp value,
java.util.Calendar c) |
public int sqltype
public int sqlscale
public int sqlsubtype
public int sqllen
public byte[] sqldata
public java.lang.Object cachedobject
public java.lang.String sqlname
public java.lang.String relname
public java.lang.String relaliasname
public java.lang.String ownname
public java.lang.String aliasname
protected org.firebirdsql.encodings.Encoding coder
public XSQLVAR deepCopy()
public void copyFrom(XSQLVAR original)
XSQLVAR
with
values from another instance.original
- The other instance of XSQLVAR
to be used
as the base for initializing this instancepublic void copyFrom(XSQLVAR original, boolean copyData)
XSQLVAR
with
values from another instance.original
- The other instance of XSQLVAR
to be used
as the base for initializing this instancepublic byte[] encodeShort(short value)
short
value as a byte
array.value
- The value to be encodedvalue
encoded as a
byte
arraypublic short decodeShort(byte[] byte_int)
byte
array into a short
value.byte_int
- The byte
array to be decodedshort
value of the decoded
byte
arraypublic byte[] encodeInt(int value)
int
value as a byte
array.value
- The value to be encodedvalue
encoded as a
byte
arraypublic int decodeInt(byte[] byte_int)
byte
array into an int
value.byte_int
- The byte
array to be decodedint
value of the decoded
byte
arraypublic byte[] encodeLong(long value)
long
value as a byte
array.value
- The value to be encodedvalue
encoded as a
byte
arraypublic long decodeLong(byte[] byte_int)
byte
array into a long
value.byte_int
- The byte
array to be decodedlong
value of the decoded
byte
arraypublic byte[] encodeFloat(float value)
float
value as a byte
array.value
- The value to be encodedvalue
encoded as a
byte
arraypublic float decodeFloat(byte[] byte_int)
byte
array into a float
value.byte_int
- The byte
array to be decodedfloat
value of the decoded
byte
arraypublic byte[] encodeDouble(double value)
double
value as a byte
array.value
- The value to be encodedvalue
encoded as a
byte
arraypublic double decodeDouble(byte[] byte_int)
byte
array into a double
value.byte_int
- The byte
array to be decodeddouble
value of the decoded
byte
arraypublic byte[] encodeString(java.lang.String value, java.lang.String encoding, java.lang.String mappingPath) throws java.sql.SQLException
String
value into a byte
array using
a given encoding.value
- The String
to be encodedencoding
- The encoding to use in the encoding processmappingPath
- The character mapping path to be used in the encodingvalue
as a byte
arrayjava.sql.SQLException
- if the given encoding cannot be found, or an error
occurs during the encodingpublic byte[] encodeString(byte[] value, java.lang.String encoding, java.lang.String mappingPath) throws java.sql.SQLException
byte
array using a given encoding.value
- The byte
array to be encodedencoding
- The encoding to use in the encoding processmappingPath
- The character mapping path to be used in the encodingvalue
encoded using the given encodingjava.sql.SQLException
- if the given encoding cannot be found, or an error
occurs during the encodingpublic java.lang.String decodeString(byte[] value, java.lang.String encoding, java.lang.String mappingPath) throws java.sql.SQLException
byte
array into a String
using a given encoding.value
- The value to be decodedencoding
- The encoding to be used in the decoding processmappingPath
- The character mapping path to be used in the decodingString
java.sql.SQLException
- if the given encoding cannot be found, or an
error occurs during the decodingpublic java.sql.Timestamp encodeTimestamp(java.sql.Timestamp value, java.util.Calendar cal)
Timestamp
using a given Calendar
.value
- The Timestamp
to be encodedcal
- The Calendar
to be used for encoding,
may be null
public java.sql.Timestamp encodeTimestamp(java.sql.Timestamp value, java.util.Calendar cal, boolean invertTimeZone)
Timestamp
using a given Calendar
.value
- The Timestamp
to be encodedcal
- The Calendar
to be used for encoding,
may be null
invertTimeZone
- If true
, the timezone offset value
will be subtracted from the encoded value, otherwise it will
be addedTimestamp
public byte[] encodeTimestamp(java.sql.Timestamp value)
Timestamp
as a byte
array.value
- The Timestamp
to be encodedbyte
s that represents the given
Timestamp
valuepublic byte[] encodeTimestampCalendar(java.sql.Timestamp value, java.util.Calendar c)
public java.sql.Timestamp decodeTimestamp(java.sql.Timestamp value, java.util.Calendar cal)
Timestamp
value using a given
Calendar
.value
- The Timestamp
to be decodedcal
- The Calendar
to be used in decoding,
may be null
Timestamp
public java.sql.Timestamp decodeTimestamp(java.sql.Timestamp value, java.util.Calendar cal, boolean invertTimeZone)
Timestamp
value using a given
Calendar
.value
- The Timestamp
to be decodedcal
- The Calendar
to be used in decoding,
may be null
invertTimeZone
- If true
, the timezone offset value
will be subtracted from the decoded value, otherwise it will
be addedTimestamp
public java.sql.Timestamp decodeTimestamp(byte[] byte_int)
byte
array into a Timestamp
.byte_int
- The byte
array to be decodedTimestamp
value from the decoded
byte
spublic java.sql.Timestamp decodeTimestampCalendar(byte[] byte_int, java.util.Calendar c)
public java.sql.Time encodeTime(java.sql.Time d, java.util.Calendar cal, boolean invertTimeZone)
Time
value using a given
Calendar
.d
- The Time
to be encodedcal
- The Calendar
to be used in the encoding,
may be null
Time
public byte[] encodeTime(java.sql.Time d)
Time
value into a byte
array.d
- The Time
to be encodedbyte
s representing the given
Time
public byte[] encodeTimeCalendar(java.sql.Time d, java.util.Calendar c)
public java.sql.Time decodeTime(java.sql.Time d, java.util.Calendar cal, boolean invertTimeZone)
Time
value using a given Calendar
.d
- The Time
to be decodedcal
- The Calendar
to be used in the decoding, may
be null
Time
public java.sql.Time decodeTime(byte[] int_byte)
byte
array into a Time
value.int_byte
- The byte
array to be decodedTime
public java.sql.Time decodeTimeCalendar(byte[] int_byte, java.util.Calendar c)
public java.sql.Date encodeDate(java.sql.Date d, java.util.Calendar cal)
Date
value using a given
Calendar
.d
- The Date
to be encodedcal
- The Calendar
to be used in the encoding,
may be null
Date
public byte[] encodeDate(java.sql.Date d)
Date
value into a byte
array.d
- The Date
to be encodedbyte
s representing the given
Date
public byte[] encodeDateCalendar(java.sql.Date d, java.util.Calendar c)
public java.sql.Date decodeDate(java.sql.Date d, java.util.Calendar cal)
Date
value using a given Calendar
.d
- The Date
to be decodedcal
- The Calendar
to be used in the decoding, may
be null
Date
public java.sql.Date decodeDate(byte[] byte_int)
byte
array into a Date
value.byte_int
- The byte
array to be decodedDate
public java.sql.Date decodeDateCalendar(byte[] byte_int, java.util.Calendar c)
public boolean decodeBoolean(byte[] data)
data
- (expected) 1 bytesfalse
when 0, true
for all other valuespublic byte[] encodeBoolean(boolean value)
value
- Boolean value to encodetrue
as 1, false
as 0.public byte[] encodeLocalTime(int hour, int minute, int second, int nanos)
hour
- Number of hours (is assumed to be 0..23)minute
- Number of minutes (is assumed to be 0..59)second
- Number of seconds (is assumed to be 0..59)nanos
- Sub-second nanoseconds (actual resolution is 100 microseconds, is assumed to be 0 .. 10^9 - 1 ns)public byte[] encodeLocalDate(int year, int month, int day)
year
- Yearmonth
- Month (is assumed to be 1..12)day
- Day (is assumed to be valid for year and month)public byte[] encodeLocalDateTime(int year, int month, int day, int hour, int minute, int second, int nanos)
year
- Yearmonth
- Month (is assumed to be 1..12)day
- Day (is assumed to be valid for year and month)hour
- Number of hours (is assumed to be 0..23)minute
- Number of minutes (is assumed to be 0..59)second
- Number of seconds (is assumed to be 0..59)nanos
- Sub-second nanoseconds (actual resolution is 100 microseconds, is assumed to be 0 .. 10^9 - 1 ns)Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.