public static boolean hasTable(final CConnection connection,final String tableName) throws CouldntLoadDataException {
  Preconditions.checkNotNull(tableName,"IE02038: Table name argument can not be null");
  Preconditions.checkNotNull(connection,"IE02039: Connection argument can not be null");
  final String query="SELECT relname FROM pg_class WHERE relname = '" + tableName + "'";
  try (ResultSet result=connection.executeQuery(query,true)){
    return result.first();
  }
 catch (  final SQLException e) {
    throw new CouldntLoadDataException(e);
  }
}

public static boolean hasTable ( final CConnection connection , final String tableName ) throws CouldntLoadDataException { Preconditions . checkNotNull ( tableName , "IE02038: Table name argument can not be null" ) ; Preconditions . checkNotNull ( connection , "IE02039: Connection argument can not be null" ) ; final String query = "SELECT relname FROM pg_class WHERE relname = '" + tableName + "'" ; try ( ResultSet result = connection . executeQuery ( query , true ) ) { return result . first ( ) ; } catch ( final SQLException e ) { throw new CouldntLoadDataException ( e ) ; } }
determines whether a table with a given name is present in a postgresql database .
