use of com.sforce.soap.partner.fault.MalformedQueryFault in project teiid by teiid.
the class SalesforceConnectionImpl method query.
public QueryResult query(String queryString, int batchSize, boolean queryAll) throws ResourceException {
if (batchSize > 2000) {
batchSize = 2000;
// $NON-NLS-1$
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "reduced.batch.size");
}
QueryResult qr = null;
partnerConnection.setQueryOptions(batchSize);
try {
if (queryAll) {
qr = partnerConnection.queryAll(queryString);
} else {
partnerConnection.setMruHeader(false);
qr = partnerConnection.query(queryString);
}
} catch (InvalidFieldFault e) {
throw new ResourceException(e);
} catch (MalformedQueryFault e) {
throw new ResourceException(e);
} catch (InvalidSObjectFault e) {
throw new ResourceException(e);
} catch (InvalidIdFault e) {
throw new ResourceException(e);
} catch (UnexpectedErrorFault e) {
throw new ResourceException(e);
} catch (InvalidQueryLocatorFault e) {
throw new ResourceException(e);
} catch (ConnectionException e) {
throw new ResourceException(e);
} finally {
partnerConnection.clearMruHeader();
partnerConnection.clearQueryOptions();
}
return qr;
}
Aggregations