From: Joss Armstrong Date: Tue, 19 Mar 2019 18:26:44 +0000 (+0000) Subject: Change identifier in database query X-Git-Tag: 1.5.0~66 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=8c06462b211d573926ee1101759d818f846ea7f5;p=appc.git Change identifier in database query Future release of MariaDB adds a keyword currently used as an identifier Issue-ID: APPC-1548 Change-Id: I4ced052e6acb816797024f5581f14f5f969d357f Signed-off-by: Joss Armstrong --- diff --git a/appc-dispatcher/appc-dispatcher-common/transaction-recorder/src/main/java/org/onap/appc/transactionrecorder/impl/TransactionRecorderImpl.java b/appc-dispatcher/appc-dispatcher-common/transaction-recorder/src/main/java/org/onap/appc/transactionrecorder/impl/TransactionRecorderImpl.java index 12a3457d0..15ed9ad4b 100644 --- a/appc-dispatcher/appc-dispatcher-common/transaction-recorder/src/main/java/org/onap/appc/transactionrecorder/impl/TransactionRecorderImpl.java +++ b/appc-dispatcher/appc-dispatcher-common/transaction-recorder/src/main/java/org/onap/appc/transactionrecorder/impl/TransactionRecorderImpl.java @@ -195,7 +195,7 @@ public class TransactionRecorderImpl implements TransactionRecorder { private boolean checkIfNullInstanceEntryExist(String key, String requestId) throws APPCException { logger.debug("Entered checkIfNullInstanceEntryExist"); - String nullInstanceCheckQuery = new String("SELECT COUNT(*) as ROWS FROM " + + String nullInstanceCheckQuery = new String("SELECT COUNT(*) as ROWCOUNT FROM " + TransactionConstants.TRANSACTIONS + WHERE + TRANSACTION_ID.getColumnName() + " = ? AND " + REQUEST_ID.getColumnName() + " = ? "); @@ -208,7 +208,7 @@ public class TransactionRecorderImpl implements TransactionRecorder { CachedRowSet rowSet = dbLibService.getData(nullInstanceCheckQuery, nullInstanceCheckParams, SCHEMA); int noRows = 0; if (rowSet != null && rowSet.first()) { - noRows = rowSet.getInt("ROWS"); + noRows = rowSet.getInt("ROWCOUNT"); logger.info("No of Rows in Transactions Table with TRANSACTION_ID: " + null + "~" + key + " and REQUEST_ID " + requestId + " is: " + noRows); }