com.amazon.redshift.jdbc

## Class MetadataAPIHelper

- java.lang.Object
- - com.amazon.redshift.jdbc.MetadataAPIHelper

Direct Known Subclasses:
  MetadataAPIPostProcessing, MetadataServerAPIHelper

    public class MetadataAPIHelper
    extends Object

### Nested Class Summary

Nested Classes
`static interface` `MetadataAPIHelper.enumFunc<T extends Enum<T>>`
`static class` `MetadataAPIHelper.GetCatalogs_Metadata`
`static class` `MetadataAPIHelper.GetColumns_Metadata`
`static class` `MetadataAPIHelper.GetSchemas_Metadata`
`static class` `MetadataAPIHelper.GetTables_Metadata`

### Field Summary

Fields
`protected RedshiftConnectionImpl` `connection`
`protected Field[]` `GET_CATALOGS_COLS`
`protected Field[]` `GET_COLUMNS_COLS`
`protected Field[]` `GET_SCHEMAS_COLS`
`protected Field[]` `GET_TABLES_COLS`
`static String` `SHOW_COLUMNS_CHARACTER_MAXIMUM_LENGTH`
`static String` `SHOW_COLUMNS_COLUMN_DEFAULT`
`static String` `SHOW_COLUMNS_COLUMN_NAME`
`static String` `SHOW_COLUMNS_DATA_TYPE`
`static String` `SHOW_COLUMNS_DATABASE_NAME`
`static String` `SHOW_COLUMNS_IS_NULLABLE`
`static String` `SHOW_COLUMNS_NUMERIC_PRECISION`
`static String` `SHOW_COLUMNS_NUMERIC_SCALE`
`static String` `SHOW_COLUMNS_ORDINAL_POSITION`
`static String` `SHOW_COLUMNS_REMARKS`
`static String` `SHOW_COLUMNS_SCHEMA_NAME`
`static String` `SHOW_COLUMNS_TABLE_NAME`
`static String` `SHOW_DATABASES_DATABASE_NAME`
`static String` `SHOW_SCHEMAS_DATABASE_NAME`
`static String` `SHOW_SCHEMAS_SCHEMA_NAME`
`static String` `SHOW_TABLES_DATABASE_NAME`
`static String` `SHOW_TABLES_REMARKS`
`static String` `SHOW_TABLES_SCHEMA_NAME`
`static String` `SHOW_TABLES_TABLE_NAME`
`static String` `SHOW_TABLES_TABLE_TYPE`
`protected String` `SQL_PREP_SHOWCOLUMNS`
`protected String` `SQL_PREP_SHOWDATABASES`
`protected String` `SQL_PREP_SHOWDATABASESLIKE`
`protected String` `SQL_PREP_SHOWSCHEMAS`
`protected String` `SQL_PREP_SHOWSCHEMASLIKE`
`protected String` `SQL_PREP_SHOWTABLES`
`protected String` `SQL_SHOWCOLUMNS`
`protected String` `SQL_SHOWCOLUMNSLIKE`
`protected String` `SQL_SHOWDATABASES`
`protected String` `SQL_SHOWDATABASESLIKE`
`protected String` `SQL_SHOWSCHEMAS`
`protected String` `SQL_SHOWSCHEMASLIKE`
`protected String` `SQL_SHOWTABLES`
`protected String` `SQL_SHOWTABLESLIKE`

### Constructor Summary

Constructors
Constructor and Description
`MetadataAPIHelper(RedshiftConnectionImpl connection)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected boolean` `checkNameIsExactName(String name)`
`protected boolean` `checkNameIsNotPattern(String name)`
`protected ResultSet` `createEmptyRs(Field[] col, int size)`
`protected PreparedStatement` `createMetaDataPreparedStatement(String sql)`
`protected Statement` `createMetaDataStatement()`
`protected ResultSet` `createNullRs(Field[] col, int size)`
`protected ResultSet` `createRs(Field[] col, List<Tuple> data)`
`protected byte[]` `encodeStr(String str)`
`protected String` `getAutoIncrement(String colDef)`
`protected String` `getColumnSize(String rsType, String character_maximum_length, String numeric_precision)`
`protected String` `getDecimalDigit(String rsType, String numeric_scale, int precision, boolean customizePrecision)`
`protected byte[][]` `getEmptyTuple(Field[] col, int size)`
`protected List<Tuple>` `getEmptyTupleList(Field[] col, int size)`
`static <T extends Enum<T> & MetadataAPIHelper.enumFunc<T>> Field[]` `getField(Supplier<T[]> enumObject)`
`protected String` `getNullable(String nullable)`
`protected byte[][]` `getNullTuple(int size)`
`protected List<Tuple>` `getNullTupleList(int size)`
`protected String` `getNumPrefixRadix(String rsType)`
`protected String` `getRSType(String rsType)`
`protected String` `getSQLType(String rsType)`
`protected ResultSet` `runQuery(String sql)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### connection

    protected final RedshiftConnectionImpl connection

#### GET_CATALOGS_COLS

    protected final Field[] GET_CATALOGS_COLS

#### GET_SCHEMAS_COLS

    protected final Field[] GET_SCHEMAS_COLS

#### GET_TABLES_COLS

    protected final Field[] GET_TABLES_COLS

#### GET_COLUMNS_COLS

    protected final Field[] GET_COLUMNS_COLS

#### SHOW_DATABASES_DATABASE_NAME

    public static final String SHOW_DATABASES_DATABASE_NAME

See Also:
  Constant Field Values

#### SHOW_SCHEMAS_DATABASE_NAME

    public static final String SHOW_SCHEMAS_DATABASE_NAME

See Also:
  Constant Field Values

#### SHOW_SCHEMAS_SCHEMA_NAME

    public static final String SHOW_SCHEMAS_SCHEMA_NAME

See Also:
  Constant Field Values

#### SHOW_TABLES_DATABASE_NAME

    public static final String SHOW_TABLES_DATABASE_NAME

See Also:
  Constant Field Values

#### SHOW_TABLES_SCHEMA_NAME

    public static final String SHOW_TABLES_SCHEMA_NAME

See Also:
  Constant Field Values

#### SHOW_TABLES_TABLE_NAME

    public static final String SHOW_TABLES_TABLE_NAME

See Also:
  Constant Field Values

#### SHOW_TABLES_TABLE_TYPE

    public static final String SHOW_TABLES_TABLE_TYPE

See Also:
  Constant Field Values

#### SHOW_TABLES_REMARKS

    public static final String SHOW_TABLES_REMARKS

See Also:
  Constant Field Values

#### SHOW_COLUMNS_DATABASE_NAME

    public static final String SHOW_COLUMNS_DATABASE_NAME

See Also:
  Constant Field Values

#### SHOW_COLUMNS_SCHEMA_NAME

    public static final String SHOW_COLUMNS_SCHEMA_NAME

See Also:
  Constant Field Values

#### SHOW_COLUMNS_TABLE_NAME

    public static final String SHOW_COLUMNS_TABLE_NAME

See Also:
  Constant Field Values

#### SHOW_COLUMNS_COLUMN_NAME

    public static final String SHOW_COLUMNS_COLUMN_NAME

See Also:
  Constant Field Values

#### SHOW_COLUMNS_ORDINAL_POSITION

    public static final String SHOW_COLUMNS_ORDINAL_POSITION

See Also:
  Constant Field Values

#### SHOW_COLUMNS_COLUMN_DEFAULT

    public static final String SHOW_COLUMNS_COLUMN_DEFAULT

See Also:
  Constant Field Values

#### SHOW_COLUMNS_IS_NULLABLE

    public static final String SHOW_COLUMNS_IS_NULLABLE

See Also:
  Constant Field Values

#### SHOW_COLUMNS_DATA_TYPE

    public static final String SHOW_COLUMNS_DATA_TYPE

See Also:
  Constant Field Values

#### SHOW_COLUMNS_CHARACTER_MAXIMUM_LENGTH

    public static final String SHOW_COLUMNS_CHARACTER_MAXIMUM_LENGTH

See Also:
  Constant Field Values

#### SHOW_COLUMNS_NUMERIC_PRECISION

    public static final String SHOW_COLUMNS_NUMERIC_PRECISION

See Also:
  Constant Field Values

#### SHOW_COLUMNS_NUMERIC_SCALE

    public static final String SHOW_COLUMNS_NUMERIC_SCALE

See Also:
  Constant Field Values

#### SHOW_COLUMNS_REMARKS

    public static final String SHOW_COLUMNS_REMARKS

See Also:
  Constant Field Values

#### SQL_SHOWDATABASES

    protected final String SQL_SHOWDATABASES

See Also:
  Constant Field Values

#### SQL_SHOWDATABASESLIKE

    protected final String SQL_SHOWDATABASESLIKE

See Also:
  Constant Field Values

#### SQL_SHOWSCHEMAS

    protected final String SQL_SHOWSCHEMAS

See Also:
  Constant Field Values

#### SQL_SHOWSCHEMASLIKE

    protected final String SQL_SHOWSCHEMASLIKE

See Also:
  Constant Field Values

#### SQL_SHOWTABLES

    protected final String SQL_SHOWTABLES

See Also:
  Constant Field Values

#### SQL_SHOWTABLESLIKE

    protected final String SQL_SHOWTABLESLIKE

See Also:
  Constant Field Values

#### SQL_SHOWCOLUMNS

    protected final String SQL_SHOWCOLUMNS

See Also:
  Constant Field Values

#### SQL_SHOWCOLUMNSLIKE

    protected final String SQL_SHOWCOLUMNSLIKE

See Also:
  Constant Field Values

#### SQL_PREP_SHOWDATABASES

    protected final String SQL_PREP_SHOWDATABASES

See Also:
  Constant Field Values

#### SQL_PREP_SHOWDATABASESLIKE

    protected final String SQL_PREP_SHOWDATABASESLIKE

See Also:
  Constant Field Values

#### SQL_PREP_SHOWSCHEMAS

    protected final String SQL_PREP_SHOWSCHEMAS

See Also:
  Constant Field Values

#### SQL_PREP_SHOWSCHEMASLIKE

    protected final String SQL_PREP_SHOWSCHEMASLIKE

See Also:
  Constant Field Values

#### SQL_PREP_SHOWTABLES

    protected final String SQL_PREP_SHOWTABLES

See Also:
  Constant Field Values

#### SQL_PREP_SHOWCOLUMNS

    protected final String SQL_PREP_SHOWCOLUMNS

See Also:
  Constant Field Values

### Constructor Detail

#### MetadataAPIHelper

    public MetadataAPIHelper(RedshiftConnectionImpl connection)

### Method Detail

#### getField

    public static <T extends Enum<T> & MetadataAPIHelper.enumFunc<T>> Field[] getField(Supplier<T[]> enumObject)

#### createMetaDataStatement

    protected Statement createMetaDataStatement()
                                         throws SQLException

Throws:
  `SQLException`

#### createMetaDataPreparedStatement

    protected PreparedStatement createMetaDataPreparedStatement(String sql)
                                                         throws SQLException

Throws:
  `SQLException`

#### createEmptyRs

    protected ResultSet createEmptyRs(Field[] col,
                                      int size)
                               throws SQLException

Throws:
  `SQLException`

#### createNullRs

    protected ResultSet createNullRs(Field[] col,
                                     int size)
                              throws SQLException

Throws:
  `SQLException`

#### createRs

    protected ResultSet createRs(Field[] col,
                                 List<Tuple> data)
                          throws SQLException

Throws:
  `SQLException`

#### runQuery

    protected ResultSet runQuery(String sql)
                          throws SQLException

Throws:
  `SQLException`

#### getEmptyTuple

    protected byte[][] getEmptyTuple(Field[] col,
                                     int size)
                              throws SQLException

Throws:
  `SQLException`

#### getEmptyTupleList

    protected List<Tuple> getEmptyTupleList(Field[] col,
                                            int size)
                                     throws SQLException

Throws:
  `SQLException`

#### getNullTuple

    protected byte[][] getNullTuple(int size)
                             throws SQLException

Throws:
  `SQLException`

#### getNullTupleList

    protected List<Tuple> getNullTupleList(int size)
                                    throws SQLException

Throws:
  `SQLException`

#### encodeStr

    protected byte[] encodeStr(String str)
                        throws SQLException

Throws:
  `SQLException`

#### getRSType

    protected String getRSType(String rsType)
                        throws SQLException

Throws:
  `SQLException`

#### getSQLType

    protected String getSQLType(String rsType)
                         throws SQLException

Throws:
  `SQLException`

#### getColumnSize

    protected String getColumnSize(String rsType,
                                   String character_maximum_length,
                                   String numeric_precision)

#### getDecimalDigit

    protected String getDecimalDigit(String rsType,
                                     String numeric_scale,
                                     int precision,
                                     boolean customizePrecision)

#### getNumPrefixRadix

    protected String getNumPrefixRadix(String rsType)

#### getNullable

    protected String getNullable(String nullable)

#### getAutoIncrement

    protected String getAutoIncrement(String colDef)

#### checkNameIsNotPattern

    protected boolean checkNameIsNotPattern(String name)

#### checkNameIsExactName

    protected boolean checkNameIsExactName(String name)