Package com.mysql.cj.result
Class Field
java.lang.Object
com.mysql.cj.result.Field
- All Implemented Interfaces:
ProtocolEntity
public class Field extends java.lang.Object implements ProtocolEntity
Field is a class used to describe fields in a ResultSet
-
Constructor Summary
Constructors Constructor Description Field(LazyString databaseName, LazyString tableName, LazyString originalTableName, LazyString columnName, LazyString originalColumnName, long length, int mysqlTypeId, short colFlag, int colDecimals, int collationIndex, java.lang.String encoding, MysqlType mysqlType)
Field(java.lang.String tableName, java.lang.String columnName, int collationIndex, java.lang.String encoding, MysqlType mysqlType, int length)
Used by prepared statements to re-use result set data conversion methods when generating bound parameter retrieval instance for statement interceptors. -
Method Summary
Modifier and Type Method Description int
getCollationIndex()
java.lang.String
getColumnLabel()
java.lang.String
getDatabaseName()
int
getDecimals()
java.lang.String
getEncoding()
Returns the Java encoding for this field.short
getFlags()
java.lang.String
getFullName()
int
getJavaType()
long
getLength()
MysqlType
getMysqlType()
int
getMysqlTypeId()
java.lang.String
getName()
java.lang.String
getOriginalName()
java.lang.String
getOriginalTableName()
java.lang.String
getTableName()
boolean
getValueNeedsQuoting()
boolean
isAutoIncrement()
boolean
isBinary()
boolean
isBlob()
boolean
isFromFunction()
boolean
isMultipleKey()
boolean
isNotNull()
boolean
isPrimaryKey()
boolean
isReadOnly()
Is this field _definitely_ not writable?boolean
isSingleBit()
boolean
isUniqueKey()
boolean
isUnsigned()
boolean
isZeroFill()
void
setBinary()
void
setBlob()
void
setEncoding(java.lang.String javaEncodingName, ServerVersion version)
void
setFlags(short colFlag)
void
setMysqlType(MysqlType mysqlType)
void
setMysqlTypeId(int id)
java.lang.String
toString()
-
Constructor Details
-
Field
public Field(LazyString databaseName, LazyString tableName, LazyString originalTableName, LazyString columnName, LazyString originalColumnName, long length, int mysqlTypeId, short colFlag, int colDecimals, int collationIndex, java.lang.String encoding, MysqlType mysqlType) -
Field
public Field(java.lang.String tableName, java.lang.String columnName, int collationIndex, java.lang.String encoding, MysqlType mysqlType, int length)Used by prepared statements to re-use result set data conversion methods when generating bound parameter retrieval instance for statement interceptors.- Parameters:
tableName
- not usedcolumnName
- not usedcollationIndex
- the MySQL collation/character set indexencoding
- encoding of data in this fieldmysqlType
-MysqlType
length
- length in characters or bytes (for BINARY data).
-
-
Method Details
-
getEncoding
public java.lang.String getEncoding()Returns the Java encoding for this field.- Returns:
- the Java encoding
-
setEncoding
-
getColumnLabel
public java.lang.String getColumnLabel() -
getDatabaseName
public java.lang.String getDatabaseName() -
getDecimals
public int getDecimals() -
getFullName
public java.lang.String getFullName() -
getLength
public long getLength() -
getMysqlTypeId
public int getMysqlTypeId() -
setMysqlTypeId
public void setMysqlTypeId(int id) -
getName
public java.lang.String getName() -
getOriginalName
public java.lang.String getOriginalName() -
getOriginalTableName
public java.lang.String getOriginalTableName() -
getJavaType
public int getJavaType() -
getTableName
public java.lang.String getTableName() -
isAutoIncrement
public boolean isAutoIncrement() -
isBinary
public boolean isBinary() -
setBinary
public void setBinary() -
isBlob
public boolean isBlob() -
setBlob
public void setBlob() -
isMultipleKey
public boolean isMultipleKey() -
isNotNull
public boolean isNotNull() -
isPrimaryKey
public boolean isPrimaryKey() -
isFromFunction
public boolean isFromFunction() -
isReadOnly
public boolean isReadOnly()Is this field _definitely_ not writable?- Returns:
- true if this field can not be written to in an INSERT/UPDATE statement.
-
isUniqueKey
public boolean isUniqueKey() -
isUnsigned
public boolean isUnsigned() -
isZeroFill
public boolean isZeroFill() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
isSingleBit
public boolean isSingleBit() -
getValueNeedsQuoting
public boolean getValueNeedsQuoting() -
getCollationIndex
public int getCollationIndex() -
getMysqlType
-
setMysqlType
-
getFlags
public short getFlags() -
setFlags
public void setFlags(short colFlag)
-