## com.mysql.jdbc
Class Field

    java.lang.Object
      com.mysql.jdbc.Field

    public class Field

extends java.lang.Object

Field is a class used to describe fields in a ResultSet

Field Summary
`protected int` `defaultValueLength`
`protected int` `defaultValueStart`

Constructor Summary

`Field(MySQLConnection conn, byte[] buffer, int databaseNameStart, int databaseNameLength, int tableNameStart, int tableNameLength, int originalTableNameStart, int originalTableNameLength, int nameStart, int nameLength, int originalColumnNameStart, int originalColumnNameLength, long length, int mysqlType, short colFlag, int colDecimals, int defaultValueStart, int defaultValueLength, int charsetIndex)`
Constructor used when communicating with 4.1 and newer servers

`Field(MySQLConnection conn, byte[] buffer, int nameStart, int nameLength, int tableNameStart, int tableNameLength, int length, int mysqlType, short colFlag, int colDecimals)` Constructor used when communicating with pre 4.1 servers
`Field(java.lang.String tableName, java.lang.String columnName, int jdbcType, int length)` Constructor used by DatabaseMetaData methods.
`Field(java.lang.String tableName, java.lang.String columnName, int charsetIndex, int jdbcType, int length)` Used by prepared statements to re-use result set data conversion methods when generating bound parmeter retrieval instance for statement interceptors.

Method Summary
`java.lang.String` `getCharacterSet()` Returns the character set (if known) for this field.
`java.lang.String` `getCollation()`
`java.lang.String` `getColumnLabel()`
`java.lang.String` `getDatabaseName()` DOCUMENT ME!
`(package private) int` `getDecimals()`
`java.lang.String` `getFullName()` DOCUMENT ME!
`java.lang.String` `getFullOriginalName()` DOCUMENT ME!
`long` `getLength()` DOCUMENT ME!
`int` `getMaxBytesPerCharacter()`
`int` `getMysqlType()` DOCUMENT ME!
`java.lang.String` `getName()` DOCUMENT ME!
`java.lang.String` `getNameNoAliases()`
`java.lang.String` `getOriginalName()` DOCUMENT ME!
`java.lang.String` `getOriginalTableName()` DOCUMENT ME!
`int` `getPrecisionAdjustFactor()` Returns amount of correction that should be applied to the precision value.
`int` `getSQLType()` DOCUMENT ME!
`java.lang.String` `getTable()` DOCUMENT ME!
`java.lang.String` `getTableName()` DOCUMENT ME!
`java.lang.String` `getTableNameNoAliases()`
`protected boolean` `getvalueNeedsQuoting()`
`boolean` `isAutoIncrement()` DOCUMENT ME!
`boolean` `isBinary()` DOCUMENT ME!
`boolean` `isBlob()` DOCUMENT ME!
`boolean` `isMultipleKey()` DOCUMENT ME!
`(package private) boolean` `isNotNull()`
`(package private) boolean` `isOpaqueBinary()`
`boolean` `isPrimaryKey()` DOCUMENT ME!
`(package private) boolean` `isReadOnly()` Is this field _definitely_ not writable?
`protected boolean` `isSingleBit()`
`boolean` `isUniqueKey()` DOCUMENT ME!
`boolean` `isUnsigned()` DOCUMENT ME!
`boolean` `isZeroFill()` DOCUMENT ME!
`void` `setCharacterSet(java.lang.String javaEncodingName)`
`void` `setConnection(MySQLConnection conn)` DOCUMENT ME!
`(package private) void` `setMysqlType(int type)`
`void` `setUnsigned()`
`protected void` `setUseOldNameMetadata(boolean useOldNameMetadata)`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### defaultValueLength

    protected int defaultValueLength

### defaultValueStart

    protected int defaultValueStart

Constructor Detail

### Field

    Field(MySQLConnection conn,
          byte[] buffer,
          int databaseNameStart,
          int databaseNameLength,
          int tableNameStart,
          int tableNameLength,
          int originalTableNameStart,
          int originalTableNameLength,
          int nameStart,
          int nameLength,
          int originalColumnNameStart,
          int originalColumnNameLength,
          long length,
          int mysqlType,
          short colFlag,
          int colDecimals,
          int defaultValueStart,
          int defaultValueLength,
          int charsetIndex)
    throws java.sql.SQLException

  Constructor used when communicating with 4.1 and newer servers

  Throws:
    `java.sql.SQLException`

### Field

    Field(MySQLConnection conn,
          byte[] buffer,
          int nameStart,
          int nameLength,
          int tableNameStart,
          int tableNameLength,
          int length,
          int mysqlType,
          short colFlag,
          int colDecimals)
    throws java.sql.SQLException

  Constructor used when communicating with pre 4.1 servers

  Throws:
    `java.sql.SQLException`

### Field

    Field(java.lang.String tableName,
          java.lang.String columnName,
          int jdbcType,
          int length)

  Constructor used by DatabaseMetaData methods.

### Field

    Field(java.lang.String tableName,
          java.lang.String columnName,
          int charsetIndex,
          int jdbcType,
          int length)

  Used by prepared statements to re-use result set data conversion methods when generating bound parmeter retrieval instance for statement interceptors.

  Parameters:
    `tableName` - not used
    `columnName` - not used
    `charsetIndex` - the MySQL collation/character set index
    `jdbcType` - from java.sql.Types
    `length` - length in characters or bytes (for BINARY data).

Method Detail

### getCharacterSet

    public java.lang.String getCharacterSet()
                                     throws java.sql.SQLException

  Returns the character set (if known) for this field.

  Returns:
    the character set
  Throws:
    `java.sql.SQLException`

### setCharacterSet

    public void setCharacterSet(java.lang.String javaEncodingName)
                         throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getCollation

    public java.lang.String getCollation()
                                  throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getColumnLabel

    public java.lang.String getColumnLabel()
                                    throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getDatabaseName

    public java.lang.String getDatabaseName()
                                     throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getDecimals

    int getDecimals()

### getFullName

    public java.lang.String getFullName()
                                 throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getFullOriginalName

    public java.lang.String getFullOriginalName()
                                         throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getLength

    public long getLength()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### getMaxBytesPerCharacter

    public int getMaxBytesPerCharacter()
                                throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getMysqlType

    public int getMysqlType()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### getName

    public java.lang.String getName()
                             throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getNameNoAliases

    public java.lang.String getNameNoAliases()
                                      throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getOriginalName

    public java.lang.String getOriginalName()
                                     throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getOriginalTableName

    public java.lang.String getOriginalTableName()
                                          throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getPrecisionAdjustFactor

    public int getPrecisionAdjustFactor()

  Returns amount of correction that should be applied to the precision value. Different versions of MySQL report different precision values.

  Returns:
    the amount to adjust precision value by.

### getSQLType

    public int getSQLType()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### getTable

    public java.lang.String getTable()
                              throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getTableName

    public java.lang.String getTableName()
                                  throws java.sql.SQLException

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException`

### getTableNameNoAliases

    public java.lang.String getTableNameNoAliases()
                                           throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### isAutoIncrement

    public boolean isAutoIncrement()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### isBinary

    public boolean isBinary()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### isBlob

    public boolean isBlob()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### isMultipleKey

    public boolean isMultipleKey()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### isNotNull

    boolean isNotNull()

### isOpaqueBinary

    boolean isOpaqueBinary()
                     throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### isPrimaryKey

    public boolean isPrimaryKey()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### isReadOnly

    boolean isReadOnly()
                 throws java.sql.SQLException

  Is this field _definitely_ not writable?

  Returns:
    true if this field can not be written to in an INSERT/UPDATE statement.
  Throws:
    `java.sql.SQLException`

### isUniqueKey

    public boolean isUniqueKey()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### isUnsigned

    public boolean isUnsigned()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### setUnsigned

    public void setUnsigned()

### isZeroFill

    public boolean isZeroFill()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### setConnection

    public void setConnection(MySQLConnection conn)

  DOCUMENT ME!

  Parameters:
    `conn` - DOCUMENT ME!

### setMysqlType

    void setMysqlType(int type)

### setUseOldNameMetadata

    protected void setUseOldNameMetadata(boolean useOldNameMetadata)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### isSingleBit

    protected boolean isSingleBit()

### getvalueNeedsQuoting

    protected boolean getvalueNeedsQuoting()