Class ResultSetMetaData

java.lang.Object
com.mysql.cj.jdbc.result.ResultSetMetaData
All Implemented Interfaces:
java.sql.ResultSetMetaData, java.sql.Wrapper

public class ResultSetMetaData
extends java.lang.Object
implements java.sql.ResultSetMetaData
A ResultSetMetaData object can be used to find out about the types and properties of the columns in a ResultSet
  • Constructor Details

    • ResultSetMetaData

      public ResultSetMetaData​(Session session, Field[] fields, boolean useOldAliasBehavior, boolean treatYearAsDate, ExceptionInterceptor exceptionInterceptor)
      Initialize for a result with a tuple set and a field descriptor set
      Parameters:
      session - this Session
      fields - the array of field descriptors
      useOldAliasBehavior - 'useOldAliasMetadataBehavior' property value
      treatYearAsDate - 'yearIsDateType' property value
      exceptionInterceptor - exception interceptor
  • Method Details

    • getCatalogName

      public java.lang.String getCatalogName​(int column) throws java.sql.SQLException
      Specified by:
      getCatalogName in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnCharacterEncoding

      public java.lang.String getColumnCharacterEncoding​(int column) throws java.sql.SQLException
      What's the Java character encoding name for the given column?
      Parameters:
      column - the first column is 1, the second is 2, etc.
      Returns:
      the Java character encoding name for the given column, or null if no Java character encoding maps to the MySQL character set for the given column.
      Throws:
      java.sql.SQLException - if an invalid column index is given.
    • getColumnCharacterSet

      public java.lang.String getColumnCharacterSet​(int column) throws java.sql.SQLException
      What's the MySQL character set name for the given column?
      Parameters:
      column - the first column is 1, the second is 2, etc.
      Returns:
      the MySQL character set name for the given column
      Throws:
      java.sql.SQLException - if an invalid column index is given.
    • getColumnClassName

      public java.lang.String getColumnClassName​(int column) throws java.sql.SQLException
      Specified by:
      getColumnClassName in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnCount

      public int getColumnCount() throws java.sql.SQLException
      Specified by:
      getColumnCount in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnDisplaySize

      public int getColumnDisplaySize​(int column) throws java.sql.SQLException
      Specified by:
      getColumnDisplaySize in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnLabel

      public java.lang.String getColumnLabel​(int column) throws java.sql.SQLException
      Specified by:
      getColumnLabel in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnName

      public java.lang.String getColumnName​(int column) throws java.sql.SQLException
      Specified by:
      getColumnName in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnType

      public int getColumnType​(int column) throws java.sql.SQLException
      Specified by:
      getColumnType in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getColumnTypeName

      public java.lang.String getColumnTypeName​(int column) throws java.sql.SQLException
      Specified by:
      getColumnTypeName in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getField

      protected Field getField​(int columnIndex) throws java.sql.SQLException
      Returns the field instance for the given column index
      Parameters:
      columnIndex - the column number to retrieve a field instance for
      Returns:
      the field instance for the given column index
      Throws:
      java.sql.SQLException - if an error occurs
    • getPrecision

      public int getPrecision​(int column) throws java.sql.SQLException
      Specified by:
      getPrecision in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getScale

      public int getScale​(int column) throws java.sql.SQLException
      Specified by:
      getScale in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getSchemaName

      public java.lang.String getSchemaName​(int column) throws java.sql.SQLException
      Specified by:
      getSchemaName in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • getTableName

      public java.lang.String getTableName​(int column) throws java.sql.SQLException
      Specified by:
      getTableName in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isAutoIncrement

      public boolean isAutoIncrement​(int column) throws java.sql.SQLException
      Specified by:
      isAutoIncrement in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isCaseSensitive

      public boolean isCaseSensitive​(int column) throws java.sql.SQLException
      Specified by:
      isCaseSensitive in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isCurrency

      public boolean isCurrency​(int column) throws java.sql.SQLException
      Specified by:
      isCurrency in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isDefinitelyWritable

      public boolean isDefinitelyWritable​(int column) throws java.sql.SQLException
      Specified by:
      isDefinitelyWritable in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isNullable

      public int isNullable​(int column) throws java.sql.SQLException
      Specified by:
      isNullable in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isReadOnly

      public boolean isReadOnly​(int column) throws java.sql.SQLException
      Specified by:
      isReadOnly in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isSearchable

      public boolean isSearchable​(int column) throws java.sql.SQLException
      Specified by:
      isSearchable in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isSigned

      public boolean isSigned​(int column) throws java.sql.SQLException
      Specified by:
      isSigned in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • isWritable

      public boolean isWritable​(int column) throws java.sql.SQLException
      Specified by:
      isWritable in interface java.sql.ResultSetMetaData
      Throws:
      java.sql.SQLException
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • isWrapperFor

      public boolean isWrapperFor​(java.lang.Class<?> iface) throws java.sql.SQLException
      Specified by:
      isWrapperFor in interface java.sql.Wrapper
      Throws:
      java.sql.SQLException
    • unwrap

      public <T> T unwrap​(java.lang.Class<T> iface) throws java.sql.SQLException
      Specified by:
      unwrap in interface java.sql.Wrapper
      Throws:
      java.sql.SQLException
    • getFields

      public Field[] getFields()