Change identifier in database query 06/82706/3
authorJoss Armstrong <joss.armstrong@ericsson.com>
Tue, 19 Mar 2019 18:26:44 +0000 (18:26 +0000)
committerTakamune Cho <takamune.cho@att.com>
Thu, 21 Mar 2019 00:12:13 +0000 (00:12 +0000)
Future release of MariaDB adds a keyword currently used as an
identifier

Issue-ID: APPC-1548
Change-Id: I4ced052e6acb816797024f5581f14f5f969d357f
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
appc-dispatcher/appc-dispatcher-common/transaction-recorder/src/main/java/org/onap/appc/transactionrecorder/impl/TransactionRecorderImpl.java

index 12a3457..15ed9ad 100644 (file)
@@ -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);
             }