title: Oracle MERGE and java prepared statement
body: <p>I have the below code whose sql script works perfectly on sql developer but when used in java code i.e </p>
  
  <pre><code>String MergeSQLMapping = "MERGE INTO test.test_table USING dual ON (CLN_POL_CODE = 22222) "
                  + "WHEN MATCHED THEN "
                  + "UPDATE SET  COMPANY_NAME = 'kevin', POL_ID = '22222', MAPPED_BY = '22222' "
                  + "WHEN NOT MATCHED THEN INSERT (COMPANY_NAME, POL_ID, CLN_POL_CODE, MAPPED_BY) "
                  + "VALUES ('kevin', '22222', '22222', 'workerservice'); ";
          System.out.println(MergeSQLMapping);
          dbMergeConnection = DBConnection.getStagingConnection();
          try {
              PreparedStatement ps = dbMergeConnection.prepareStatement(MergeSQLMapping);
              ps.execute();
              dbMergeConnection.commit();
              ps.close();
          } catch (SQLException e) {       
              System.out.println(e.getMessage()); 
          } finally {
          }
  </code></pre>
  
  <p>i get the following error</p>
  
  <pre><code>ORA-00933: SQL command not properly ended
  </code></pre>
  
  <p>Any help accorded will be appreciated.</p>