Package io.github.connellite.jdbc
Class ResultSetMetaDataUtils
java.lang.Object
io.github.connellite.jdbc.ResultSetMetaDataUtils
Thin helpers over
ResultSetMetaData that read common column metadata into ordered, de-duplicated string collections.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<String>getCatalogNames(ResultSet resultSet) DistinctResultSetMetaData.getCatalogName(int)values in column order.static Collection<String>getCatalogNames(ResultSetMetaData metaData) DistinctResultSetMetaData.getCatalogName(int)values in column order.static Collection<String>getColumnClassNames(ResultSet resultSet) ResultSetMetaData.getColumnClassName(int)for each column, in order.static Collection<String>getColumnClassNames(ResultSetMetaData metaData) ResultSetMetaData.getColumnClassName(int)for each column, in order.static Collection<String>getColumnLabels(ResultSet resultSet) ResultSetMetaData.getColumnLabel(int)for each column, in order.static Collection<String>getColumnLabels(ResultSetMetaData metaData) ResultSetMetaData.getColumnLabel(int)for each column, in order.static Collection<String>getColumnNames(ResultSet resultSet) ResultSetMetaData.getColumnName(int)for each column, in order.static Collection<String>getColumnNames(ResultSetMetaData metaData) ResultSetMetaData.getColumnName(int)for each column, in order.static Collection<String>getColumnTypeNames(ResultSet resultSet) ResultSetMetaData.getColumnTypeName(int)for each column, in order.static Collection<String>getColumnTypeNames(ResultSetMetaData metaData) ResultSetMetaData.getColumnTypeName(int)for each column, in order.static Collection<String>getQualifiedColumnLabels(ResultSet resultSet) Qualified label per column:catalog.schema.table.labelwith empty/ absent segments omitted (same chaining rules asDatabaseMetaDataUtils).static Collection<String>getQualifiedColumnLabels(ResultSetMetaData metaData) Qualified label per column:catalog.schema.table.labelwith empty/ absent segments omitted.static Collection<String>getSchemaNames(ResultSet resultSet) DistinctResultSetMetaData.getSchemaName(int)values in column order.static Collection<String>getSchemaNames(ResultSetMetaData metaData) DistinctResultSetMetaData.getSchemaName(int)values in column order.static Collection<String>getTableNames(ResultSet resultSet) DistinctResultSetMetaData.getTableName(int)values in column order.static Collection<String>getTableNames(ResultSetMetaData metaData) DistinctResultSetMetaData.getTableName(int)values in column order.static booleanhasCatalogName(ResultSetMetaData metaData, String catalogName) Whether a catalog name exists inResultSetMetaData.getCatalogName(int)values.static booleanhasCatalogName(ResultSet resultSet, String catalogName) Whether a catalog name exists inResultSetMetaData.getCatalogName(int)values.static booleanhasColumnClassName(ResultSetMetaData metaData, String columnClassName) Whether a column class name exists inResultSetMetaData.getColumnClassName(int)values.static booleanhasColumnClassName(ResultSet resultSet, String columnClassName) Whether a column class name exists inResultSetMetaData.getColumnClassName(int)values.static booleanhasColumnLabel(ResultSetMetaData metaData, String columnLabel) Whether a column label exists inResultSetMetaData.getColumnLabel(int)values.static booleanhasColumnLabel(ResultSet resultSet, String columnLabel) Whether a column label exists inResultSetMetaData.getColumnLabel(int)values.static booleanhasColumnName(ResultSetMetaData metaData, String columnName) Whether a column name exists inResultSetMetaData.getColumnName(int)values.static booleanhasColumnName(ResultSet resultSet, String columnName) Whether a column name exists inResultSetMetaData.getColumnName(int)values.static booleanhasColumnTypeName(ResultSetMetaData metaData, String columnTypeName) Whether a column type name exists inResultSetMetaData.getColumnTypeName(int)values.static booleanhasColumnTypeName(ResultSet resultSet, String columnTypeName) Whether a column type name exists inResultSetMetaData.getColumnTypeName(int)values.static booleanhasQualifiedColumnLabel(ResultSetMetaData metaData, String qualifiedColumnLabel) Whether a qualified column label exists in computedcatalog.schema.table.labelvalues.static booleanhasQualifiedColumnLabel(ResultSet resultSet, String qualifiedColumnLabel) Whether a qualified column label exists in computedcatalog.schema.table.labelvalues.static booleanhasSchemaName(ResultSetMetaData metaData, String schemaName) Whether a schema name exists inResultSetMetaData.getSchemaName(int)values.static booleanhasSchemaName(ResultSet resultSet, String schemaName) Whether a schema name exists inResultSetMetaData.getSchemaName(int)values.static booleanhasTableName(ResultSetMetaData metaData, String tableName) Whether a table name exists inResultSetMetaData.getTableName(int)values.static booleanhasTableName(ResultSet resultSet, String tableName) Whether a table name exists inResultSetMetaData.getTableName(int)values.
-
Constructor Details
-
ResultSetMetaDataUtils
public ResultSetMetaDataUtils()
-
-
Method Details
-
getColumnNames
ResultSetMetaData.getColumnName(int)for each column, in order.- Throws:
SQLException
-
getColumnNames
ResultSetMetaData.getColumnName(int)for each column, in order.- Throws:
SQLException
-
hasColumnName
Whether a column name exists inResultSetMetaData.getColumnName(int)values.- Throws:
SQLException
-
hasColumnName
public static boolean hasColumnName(ResultSetMetaData metaData, String columnName) throws SQLException Whether a column name exists inResultSetMetaData.getColumnName(int)values.- Throws:
SQLException
-
getColumnLabels
ResultSetMetaData.getColumnLabel(int)for each column, in order.- Throws:
SQLException
-
getColumnLabels
ResultSetMetaData.getColumnLabel(int)for each column, in order.- Throws:
SQLException
-
hasColumnLabel
Whether a column label exists inResultSetMetaData.getColumnLabel(int)values.- Throws:
SQLException
-
hasColumnLabel
public static boolean hasColumnLabel(ResultSetMetaData metaData, String columnLabel) throws SQLException Whether a column label exists inResultSetMetaData.getColumnLabel(int)values.- Throws:
SQLException
-
getCatalogNames
DistinctResultSetMetaData.getCatalogName(int)values in column order.- Throws:
SQLException
-
getCatalogNames
DistinctResultSetMetaData.getCatalogName(int)values in column order.- Throws:
SQLException
-
hasCatalogName
Whether a catalog name exists inResultSetMetaData.getCatalogName(int)values.- Throws:
SQLException
-
hasCatalogName
public static boolean hasCatalogName(ResultSetMetaData metaData, String catalogName) throws SQLException Whether a catalog name exists inResultSetMetaData.getCatalogName(int)values.- Throws:
SQLException
-
getSchemaNames
DistinctResultSetMetaData.getSchemaName(int)values in column order.- Throws:
SQLException
-
getSchemaNames
DistinctResultSetMetaData.getSchemaName(int)values in column order.- Throws:
SQLException
-
hasSchemaName
Whether a schema name exists inResultSetMetaData.getSchemaName(int)values.- Throws:
SQLException
-
hasSchemaName
public static boolean hasSchemaName(ResultSetMetaData metaData, String schemaName) throws SQLException Whether a schema name exists inResultSetMetaData.getSchemaName(int)values.- Throws:
SQLException
-
getTableNames
DistinctResultSetMetaData.getTableName(int)values in column order.- Throws:
SQLException
-
getTableNames
DistinctResultSetMetaData.getTableName(int)values in column order.- Throws:
SQLException
-
hasTableName
Whether a table name exists inResultSetMetaData.getTableName(int)values.- Throws:
SQLException
-
hasTableName
public static boolean hasTableName(ResultSetMetaData metaData, String tableName) throws SQLException Whether a table name exists inResultSetMetaData.getTableName(int)values.- Throws:
SQLException
-
getColumnTypeNames
ResultSetMetaData.getColumnTypeName(int)for each column, in order.- Throws:
SQLException
-
getColumnTypeNames
ResultSetMetaData.getColumnTypeName(int)for each column, in order.- Throws:
SQLException
-
hasColumnTypeName
public static boolean hasColumnTypeName(ResultSet resultSet, String columnTypeName) throws SQLException Whether a column type name exists inResultSetMetaData.getColumnTypeName(int)values.- Throws:
SQLException
-
hasColumnTypeName
public static boolean hasColumnTypeName(ResultSetMetaData metaData, String columnTypeName) throws SQLException Whether a column type name exists inResultSetMetaData.getColumnTypeName(int)values.- Throws:
SQLException
-
getColumnClassNames
ResultSetMetaData.getColumnClassName(int)for each column, in order.- Throws:
SQLException
-
getColumnClassNames
public static Collection<String> getColumnClassNames(ResultSetMetaData metaData) throws SQLException ResultSetMetaData.getColumnClassName(int)for each column, in order.- Throws:
SQLException
-
hasColumnClassName
public static boolean hasColumnClassName(ResultSet resultSet, String columnClassName) throws SQLException Whether a column class name exists inResultSetMetaData.getColumnClassName(int)values.- Throws:
SQLException
-
hasColumnClassName
public static boolean hasColumnClassName(ResultSetMetaData metaData, String columnClassName) throws SQLException Whether a column class name exists inResultSetMetaData.getColumnClassName(int)values.- Throws:
SQLException
-
getQualifiedColumnLabels
Qualified label per column:catalog.schema.table.labelwith empty/ absent segments omitted (same chaining rules asDatabaseMetaDataUtils).- Throws:
SQLException
-
getQualifiedColumnLabels
public static Collection<String> getQualifiedColumnLabels(ResultSetMetaData metaData) throws SQLException Qualified label per column:catalog.schema.table.labelwith empty/ absent segments omitted.- Throws:
SQLException
-
hasQualifiedColumnLabel
public static boolean hasQualifiedColumnLabel(ResultSet resultSet, String qualifiedColumnLabel) throws SQLException Whether a qualified column label exists in computedcatalog.schema.table.labelvalues.- Throws:
SQLException
-
hasQualifiedColumnLabel
public static boolean hasQualifiedColumnLabel(ResultSetMetaData metaData, String qualifiedColumnLabel) throws SQLException Whether a qualified column label exists in computedcatalog.schema.table.labelvalues.- Throws:
SQLException
-