class MySqlDatabaseMeta extends BaseDatabaseMeta implements IDatabase {

    @Override
    public String getLegacyColumnName(DatabaseMetaData dbMetaData, ResultSetMetaData rsMetaData, int index) throws HopDatabaseException {
        if (dbMetaData == null) {
            throw new HopDatabaseException(BaseMessages.getString(PKG, "MySQLDatabaseMeta.Exception.LegacyColumnNameNoDBMetaDataException"));
        }

        if (rsMetaData == null) {
            throw new HopDatabaseException(BaseMessages.getString(PKG, "MySQLDatabaseMeta.Exception.LegacyColumnNameNoRSMetaDataException"));
        }

        try {
            return dbMetaData.getDriverMajorVersion() > 3 ? rsMetaData.getColumnLabel(index) : rsMetaData.getColumnName(index);
        } catch (Exception e) {
            throw new HopDatabaseException(String.format("%s: %s", BaseMessages.getString(PKG, "MySQLDatabaseMeta.Exception.LegacyColumnNameException"), e.getMessage()), e);
        }
    }

}