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 intgetCollationIndex()java.lang.StringgetColumnLabel()java.lang.StringgetDatabaseName()intgetDecimals()java.lang.StringgetEncoding()Returns the Java encoding for this field.shortgetFlags()java.lang.StringgetFullName()intgetJavaType()longgetLength()MysqlTypegetMysqlType()intgetMysqlTypeId()java.lang.StringgetName()java.lang.StringgetOriginalName()java.lang.StringgetOriginalTableName()java.lang.StringgetTableName()booleangetValueNeedsQuoting()booleanisAutoIncrement()booleanisBinary()booleanisBlob()booleanisFromFunction()booleanisMultipleKey()booleanisNotNull()booleanisPrimaryKey()booleanisReadOnly()Is this field _definitely_ not writable?booleanisSingleBit()booleanisUniqueKey()booleanisUnsigned()booleanisZeroFill()voidsetBinary()voidsetBlob()voidsetEncoding(java.lang.String javaEncodingName, ServerVersion version)voidsetFlags(short colFlag)voidsetMysqlType(MysqlType mysqlType)voidsetMysqlTypeId(int id)java.lang.StringtoString()
-
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-MysqlTypelength- 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:
toStringin 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)
-