ConnectorLib Java 25.1
ConnectorLib Java SDK Programming Guide

# Filters

To select records in a table, you must use Filters. For information about selecting records, and for examples of Filters being used, see Retrieve a Record. This section describes how to create Filters.

## Equality Filters

Filters in ConnectorLib Java are specified in the form of a `DatastoreRecord`. A datastore record is only returned by the `recordSelect` method when it matches all columns set in the filter.

For example, if you have a datastore table called `table`, the following expression creates a Filter that matches all records with "MyValue" in column A:

    DatastoreRecord filter = new DatastoreRecord();
    filter.setString("A", "MyValue");

A | B
--- | ---
MyValue | XYZ
MyValue | MyValue
XYZ | XYZ
XYZ | MyValue

Filters can be applied to multiple columns in a table. For example, the following expression creates a Filter that matches all records with "MyValue" in column A and "XYZ" in column B

    DatastoreRecord filter = new DatastoreRecord();
    filter.setString("A", "MyValue");
    filter.setString("B", "XYZ");

A | B
--- | ---
MyValue | XYZ
MyValue | MyValue
XYZ | XYZ
XYZ | MyValue

## Match All Records

To match all records in a table you can use an empty `DatastoreRecord` as a filter:

         DatastoreRecord emptyFilter = new DatastoreRecord();

Copyright 2024 Open Text
Version 25.1 | Last updated January 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery ConnectorLib Java 25.1

Topic Title: Filters