Field<?> field = rs.result.field(column - 1);
if (field instanceof TableField) {
Table<?> table = ((TableField<?, ?>) field).getTable();
if (table != null) {
Schema schema = table.getSchema();
if (schema != null) {
Configuration configuration = ((AttachableInternal) rs.result).configuration();
Schema mapped = null;
if (configuration != null) {
mapped = DSL.using(configuration).map(schema);
}
if (mapped != null) {
return mapped.getName();
}
else {
return schema.getName();
}
}