If you have a strange requirement in the rowMapper to check if a column exists or not, you could try to catch a SQLException of invalid column name or you could try:
public static boolean doesColumnExist(String columnName, ResultSet rs) throws SQLException{ ResultSetMetaData meta = rs.getMetaData(); int numCol = meta.getColumnCount(); for (int i = 1; i <= numCol; i++) { if(meta.getColumnName(i).equalsIgnoreCase(columnName)) { return true; } } return false; }