English

Problem: Escape characters cause missing records in query with filter in Java Connector

Description

In a query with filter in Java Connector, the number of returned records is less than expected.

Cause

By default, when Java Connector sends a <GET_FEATURES> request, attribute "checkesc" is "false". Attribute "checkesc" is used to determine if the response should include escaped characters for ampersand, single quote, double quote, less than, and greater than. For example, if the value for SUB_REGION is "P&NW", then:

When checkesc="false", in the response the value of SUB_REGION is "P&NW".

When checkesc="true", the value of SUB_REGION is "P&amp;NW".

The first response will cause an error when Java Connector parses it, and the corresponding record will be discarded.

Solution or Workaround

To make the Java Connector send a <GET_FEATURES> request with checkesc="true", call setCheckesc() function in Filter and set it to true. For example:

Code:
Filter.setWhereExpression("CNTRY_NAME LIKE '%A%'");
Filter.setCheckesc(true);