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

Last Published: April 25, 2020


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


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:

Filter.setWhereExpression("CNTRY_NAME LIKE '%A%'");

Article ID:000005837

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic