code: public static boolean hasColumn(final Connection connection, final String tableName, final String columnName) throws SQLException {
          boolean hasColumn = false;
          
          ResultSet rs = null;
          try {
              rs = connection.getMetaData().getColumns(null, null, tableName, columnName);
              if (rs.next()) {
                  hasColumn = true;
              }
          } finally {
              try {
                  if (rs != null) {
                      rs.close();
                  }
              } catch (SQLException e) {
                  if (logger.isDebugEnabled()) {
                      logger.debug(e.getMessage(), e);
                  }
              }
          }
          
          return hasColumn;
      }
docs: Tells whether the table {@code tableName} has the column with the given
  {@code columnName}, or not.
  
  @param connection
  the connection to the database
  @param tableName
  the name of the table that may have the column
  @param columnName
  the name of the column that will be checked
  @return {@code true} if the table {@code tableName} has the column
  {@code columnName}, {@code false} otherwise.
  @throws SQLException
  if an error occurred while checking if the table has the
  column