# Class DatabricksResultSetMetaData

java.lang.Object
com.databricks.jdbc.api.impl.DatabricksResultSetMetaData

All Implemented Interfaces:
  `ResultSetMetaData`, `Wrapper`

public class DatabricksResultSetMetaData extends Object implements ResultSetMetaData

## Field Summary

### Fields inherited from interface java.sql.ResultSetMetaData

`columnNoNulls, columnNullable, columnNullableUnknown`

## Constructor Summary

Constructors
Constructor
Description
`DatabricksResultSetMetaData(StatementId statementId, TGetResultSetMetadataResp resultManifest, long rows, long chunkCount, List<String> arrowMetadata, IDatabricksConnectionContext ctx)`
Constructs a `DatabricksResultSetMetaData` object for a Thrift-based result set.
`DatabricksResultSetMetaData(StatementId statementId, ResultManifest resultManifest, boolean usesExternalLinks, IDatabricksConnectionContext ctx)`
Constructs a `DatabricksResultSetMetaData` object for a SEA result set.
`DatabricksResultSetMetaData(StatementId statementId, List<ColumnMetadata> columnMetadataList, long totalRows)`
Constructs a `DatabricksResultSetMetaData` object for metadata result set (SEA Flow)
`DatabricksResultSetMetaData(StatementId statementId, List<String> columnNames, List<String> columnTypeText, int[] columnTypes, int[] columnTypePrecisions, int[] isNullables, long totalRows)`
Constructs a `DatabricksResultSetMetaData` object for predefined metadata result set.
`DatabricksResultSetMetaData(StatementId statementId, List<String> columnNames, List<String> columnDataTypes, IDatabricksConnectionContext ctx)`
Constructs a `DatabricksResultSetMetaData` object for metadata result set obtained from DESCRIBE QUERY Works for both SEA and Thrift flows as result set obtained from DESCRIBE QUERY is already parsed.
`DatabricksResultSetMetaData(StatementId statementId, List<String> columnNames, List<String> columnTypeText, List<Integer> columnTypes, List<Integer> columnTypePrecisions, List<Nullable> columnNullables, long totalRows)`
Constructs a `DatabricksResultSetMetaData` object for metadata result set (Thrift Flow)

## Method Summary

Modifier and Type
Method
Description
`String`
`getCatalogName(int column)`
`Long`
`getChunkCount()`
`String`
`getColumnClassName(int column)`
`int`
`getColumnCount()`
`int`
`getColumnDisplaySize(int column)`
`String`
`getColumnLabel(int column)`
`String`
`getColumnName(int column)`
`int`
`getColumnNameIndex(String columnName)`
Returns index of column-name in metadata starting from 1
`int`
`getColumnType(int column)`
`String`
`getColumnTypeName(int column)`
`boolean`
`getIsCloudFetchUsed()`
`int`
`getPrecision(int column)`
`int[]`
`getPrecisionAndScale(ColumnInfo columnInfo)`
`int[]`
`getPrecisionAndScale(ColumnInfo columnInfo, int columnType)`
`int[]`
`getPrecisionAndScale(String columnTypeText, int columnType)`
`int`
`getScale(int column)`
`String`
`getSchemaName(int column)`
`String`
`getTableName(int column)`
`long`
`getTotalRows()`
`boolean`
`isAutoIncrement(int column)`
`boolean`
`isCaseSensitive(int column)`
`boolean`
`isCurrency(int column)`
`boolean`
`isDefinitelyWritable(int column)`
`int`
`isNullable(int column)`
`boolean`
`isReadOnly(int column)`
`boolean`
`isSearchable(int column)`
`boolean`
`isSigned(int column)`
`boolean`
`isWrapperFor(Class<?> iface)`
`boolean`
`isWritable(int column)`
`<T> T`
`unwrap(Class<T> iface)`

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

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

## Constructor Details

### DatabricksResultSetMetaData

public DatabricksResultSetMetaData(StatementId statementId, ResultManifest resultManifest, boolean usesExternalLinks, IDatabricksConnectionContext ctx)
Constructs a `DatabricksResultSetMetaData` object for a SEA result set.

Parameters:
  `statementId` - the unique identifier of the SQL statement execution
  `resultManifest` - the manifest containing metadata about the result set, including column information and types
  `usesExternalLinks` - whether or not the resultData contains external links (cloud fetch is used)

### DatabricksResultSetMetaData

public DatabricksResultSetMetaData(StatementId statementId, TGetResultSetMetadataResp resultManifest, long rows, long chunkCount, List<String> arrowMetadata, IDatabricksConnectionContext ctx)
Constructs a `DatabricksResultSetMetaData` object for a Thrift-based result set.

Parameters:
  `statementId` - the unique identifier of the SQL statement execution
  `resultManifest` - the response containing metadata about the result set, including column information and types, obtained through the Thrift protocol
  `rows` - the total number of rows in the result set
  `chunkCount` - the total number of data chunks in the result set

### DatabricksResultSetMetaData

public DatabricksResultSetMetaData(StatementId statementId, List<ColumnMetadata> columnMetadataList, long totalRows)
Constructs a `DatabricksResultSetMetaData` object for metadata result set (SEA Flow)

Parameters:
  `statementId` - the unique identifier of the SQL statement execution
  `columnMetadataList` - the list containing metadata for each column in the result set, such as column names, types, and precision
  `totalRows` - the total number of rows in the result set

### DatabricksResultSetMetaData

public DatabricksResultSetMetaData(StatementId statementId, List<String> columnNames, List<String> columnTypeText, List<Integer> columnTypes, List<Integer> columnTypePrecisions, List<Nullable> columnNullables, long totalRows)
Constructs a `DatabricksResultSetMetaData` object for metadata result set (Thrift Flow)

Parameters:
  `statementId` - the unique identifier of the SQL statement execution
  `columnNames` - names of each column
  `columnTypeText` - type text of each column
  `columnTypes` - types of each column
  `columnTypePrecisions` - precisions of each column
  `columnNullables` - nullable value of each column
  `totalRows` - total number of rows in result set

### DatabricksResultSetMetaData

public DatabricksResultSetMetaData(StatementId statementId, List<String> columnNames, List<String> columnTypeText, int[] columnTypes, int[] columnTypePrecisions, int[] isNullables, long totalRows)
Constructs a `DatabricksResultSetMetaData` object for predefined metadata result set.

Parameters:
  `statementId` - the unique identifier of the SQL statement execution
  `columnNames` - the names of each column
  `columnTypeText` - the textual representation of the column types
  `columnTypes` - the integer values representing the SQL types of each column
  `columnTypePrecisions` - the precisions of each column
  `isNullables` - the nullability status of each column
  `totalRows` - the total number of rows in the result set

### DatabricksResultSetMetaData

public DatabricksResultSetMetaData(StatementId statementId, List<String> columnNames, List<String> columnDataTypes, IDatabricksConnectionContext ctx)
Constructs a `DatabricksResultSetMetaData` object for metadata result set obtained from DESCRIBE QUERY Works for both SEA and Thrift flows as result set obtained from DESCRIBE QUERY is already parsed.

Parameters:
  `statementId` - the unique identifier of the SQL statement execution
  `columnNames` - names of each column
  `columnDataTypes` - types of each column
  `ctx` - connection context

## Method Details

### getColumnCount

public int getColumnCount() throws SQLException

Specified by:
  `getColumnCount` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isAutoIncrement

public boolean isAutoIncrement(int column) throws SQLException

Specified by:
  `isAutoIncrement` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isCaseSensitive

public boolean isCaseSensitive(int column) throws SQLException

Specified by:
  `isCaseSensitive` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isSearchable

public boolean isSearchable(int column) throws SQLException

Specified by:
  `isSearchable` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isCurrency

public boolean isCurrency(int column) throws SQLException

Specified by:
  `isCurrency` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isNullable

public int isNullable(int column) throws SQLException

Specified by:
  `isNullable` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isSigned

public boolean isSigned(int column) throws SQLException

Specified by:
  `isSigned` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getColumnDisplaySize

public int getColumnDisplaySize(int column) throws SQLException

Specified by:
  `getColumnDisplaySize` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getColumnLabel

public String getColumnLabel(int column) throws SQLException

Specified by:
  `getColumnLabel` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getColumnName

public String getColumnName(int column) throws SQLException

Specified by:
  `getColumnName` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getSchemaName

public String getSchemaName(int column) throws SQLException

Specified by:
  `getSchemaName` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getPrecision

public int getPrecision(int column) throws SQLException

Specified by:
  `getPrecision` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getScale

public int getScale(int column) throws SQLException

Specified by:
  `getScale` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getTableName

public String getTableName(int column) throws SQLException

Specified by:
  `getTableName` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getCatalogName

public String getCatalogName(int column) throws SQLException

Specified by:
  `getCatalogName` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getColumnType

public int getColumnType(int column) throws SQLException

Specified by:
  `getColumnType` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getColumnTypeName

public String getColumnTypeName(int column) throws SQLException

Specified by:
  `getColumnTypeName` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isReadOnly

public boolean isReadOnly(int column) throws SQLException

Specified by:
  `isReadOnly` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isWritable

public boolean isWritable(int column) throws SQLException

Specified by:
  `isWritable` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### isDefinitelyWritable

public boolean isDefinitelyWritable(int column) throws SQLException

Specified by:
  `isDefinitelyWritable` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### getColumnClassName

public String getColumnClassName(int column) throws SQLException

Specified by:
  `getColumnClassName` in interface `ResultSetMetaData`
Throws:
  `SQLException`

### unwrap

public <T> T unwrap(Class<T> iface) throws SQLException

Specified by:
  `unwrap` in interface `Wrapper`
Throws:
  `SQLException`

### isWrapperFor

public boolean isWrapperFor(Class<?> iface) throws SQLException

Specified by:
  `isWrapperFor` in interface `Wrapper`
Throws:
  `SQLException`

### getColumnNameIndex

public int getColumnNameIndex(String columnName)
Returns index of column-name in metadata starting from 1

Parameters:
  `columnName` - column-name
Returns:
  index of column if exists, else -1

### getTotalRows

public long getTotalRows()

### getIsCloudFetchUsed

public boolean getIsCloudFetchUsed()

### getChunkCount

public Long getChunkCount()

### getPrecisionAndScale

public int[] getPrecisionAndScale(String columnTypeText, int columnType)

### getPrecisionAndScale

public int[] getPrecisionAndScale(ColumnInfo columnInfo, int columnType)

### getPrecisionAndScale

public int[] getPrecisionAndScale(ColumnInfo columnInfo)