The old non-parameterized queries would treat null entries in the SvcLogicContext
as "null" string values. The parameterized query treats these as NULL sql values.
This change keeps those values as "null" strings.
Change-Id: Iee7f7a1861bdd82dc65d59db2be7862b49cf1207
Signed-off-by: Patrick Brady <patrick.brady@att.com>
Issue-ID: APPC-1639
if (term != null) {
term = term.replaceAll("'", "''");
}
- arguments.add(term);
+ //valueOf will store null values as a String "null"
+ arguments.add(String.valueOf(term));
return "?";
} else {
return (term);
if (dblib != null && ctx != null) {
String key = "select max(ASDC_ARTIFACTS_ID) as id from ASDC_ARTIFACTS WHERE ARTIFACT_NAME = ?";
ArrayList<String> arguments = new ArrayList<>();
+ arguments.add(artifactName);
log.info("Getting Artifact ID String :" + key);
status = dblib.query(key, ctx, arguments);
if (status.toString().equals(FAILURE_PARAM)) {