You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2019/04/05 19:03:58 UTC

[GitHub] [phoenix] swaroopak commented on a change in pull request #474: PHOENIX-5224 Change 'Statement' to 'PreparedStatement' for better performance

swaroopak commented on a change in pull request #474: PHOENIX-5224 Change 'Statement' to 'PreparedStatement' for better performance
URL: https://github.com/apache/phoenix/pull/474#discussion_r272709431
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexRebuildIncrementDisableCountIT.java
 ##########
 @@ -168,10 +169,14 @@ private static void mutateRandomly(Connection conn, String tableName, int maxOrg
         try {
 
             Statement stmt = conn.createStatement();
+            String sqlStr = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?)"; 
+            PreparedStatement stmt = conn.prepareStatement(sqlStr);
             for (int i = 0; i < 10000; i++) {
-                stmt.executeUpdate(
-                    "UPSERT INTO " + tableName + " VALUES('" + getRandomOrgId(maxOrgId) + "'," + i
-                            + "," + (i + 1) + "," + (i + 2) + ")");
+                stmt.setString(1, getRandomOrgId(maxOrgId);
 
 Review comment:
   missing closing parenthesis.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services