[Java] Column name list when connection.getMetaData().getColumns() of MySQL Table is performed with JDBC

less than 1 minute read

A completely personal memorandum for retrieving schema information for a table using JDBC. They are in index order. I will add a description

Column name Description Example value
TABLE_CAT database name database_name
TABLE_SCHEM   null
TABLE_NAME Table name table_name
COLUMN_NAME column name id
DATA_TYPE   4
TYPE_NAME   INT UNSIGNED
COLUMN_SIZE   10
BUFFER_LENGTH   65535
DECIMAL_DIGITS   null
NUM_PREC_RADIX   10
NULLABLE   0
REMARKS Comments on columns Column comments
COLUMN_DEF   null
SQL_DATA_TYPE   0
SQL_DATETIME_SUB   0
CHAR_OCTET_LENGTH   null
ORDINAL_POSITION   1
IS_NULLABLE   NO
SCOPE_CATALOG   null
SCOPE_SCHEMA   null
SCOPE_TABLE   null
SOURCE_DATA_TYPE   null
IS_AUTOINCREMENT   YES
IS_GENERATEDCOLUMN   NO