public static Set<String> getColumnNames(DriverTypeEnum.ConnectionProperties theConnectionProperties, String theTableName) throws SQLException {
		DataSource dataSource = Objects.requireNonNull(theConnectionProperties.getDataSource());
		try (Connection connection = dataSource.getConnection()) {
			return theConnectionProperties.getTxTemplate().execute(t -> {
				DatabaseMetaData metadata;
				try {
					metadata = connection.getMetaData();
					ResultSet indexes = metadata.getColumns(connection.getCatalog(), connection.getSchema(), massageIdentifier(metadata, theTableName), null);

					Set<String> columnNames = new HashSet<>();
					while (indexes.next()) {
						String tableName = toUpperCase(indexes.getString("TABLE_NAME"), Locale.US);
						if (!theTableName.equalsIgnoreCase(tableName)) {
							continue;
						}

						String columnName = indexes.getString("COLUMN_NAME");
						columnName = toUpperCase(columnName, Locale.US);
						columnNames.add(columnName);
					}

					return columnNames;
				} catch (SQLException e) {
					throw new InternalErrorException(e);
				}
			});
		}
	}
public static Set < String > getColumnNames ( DriverTypeEnum . ConnectionProperties theConnectionProperties , String theTableName ) throws SQLException { DataSource dataSource = Objects . requireNonNull ( theConnectionProperties . getDataSource ( ) ) ; try ( Connection connection = dataSource . getConnection ( ) ) { return theConnectionProperties . getTxTemplate ( ) . execute ( t -> { DatabaseMetaData metadata ; try { metadata = connection . getMetaData ( ) ; ResultSet indexes = metadata . getColumns ( connection . getCatalog ( ) , connection . getSchema ( ) , massageIdentifier ( metadata , theTableName ) , null ) ; Set < String > columnNames = new HashSet < > ( ) ; while ( indexes . next ( ) ) { String tableName = toUpperCase ( indexes . getString ( "TABLE_NAME" ) , Locale . US ) ; if ( ! theTableName . equalsIgnoreCase ( tableName ) ) { continue ; } String columnName = indexes . getString ( "COLUMN_NAME" ) ; columnName = toUpperCase ( columnName , Locale . US ) ; columnNames . add ( columnName ) ; } return columnNames ; } catch ( SQLException e ) { throw new InternalErrorException ( e ) ; } } ) ; } }
Retrieve all index names