WriteBack in SQLLoader Connector is not working

Hello All,

The issue was with file located at SFTP server as it use to take couple of seconds to load the file with updates.

The code as mentioned below is working as expected. While testing you need to make sure that you are refreshing the file on SFTP server before opening it or copying the file using WinSCP into your local machine before validating the changes.

import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.SQLException;
  import java.sql.Types;
  import java.util.List;
  import sailpoint.api.SailPointContext;
  import sailpoint.connector.JDBCConnector;
  import sailpoint.object.Application;
  import sailpoint.object.ProvisioningPlan;
  import sailpoint.object.ProvisioningPlan.AccountRequest;
  import sailpoint.object.ProvisioningPlan.AttributeRequest;
  import sailpoint.object.ProvisioningPlan.PermissionRequest;
  import sailpoint.object.ProvisioningResult;
  import sailpoint.object.Schema;
  import sailpoint.object.Identity;
  import sailpoint.object.*;

  public String getAttributeRequestValue(AccountRequest acctReq, String attribute) {

    if ( acctReq != null ) {
      AttributeRequest attrReq = acctReq.getAttributeRequest(attribute);
      if ( attrReq != null ) {
        return attrReq.getValue();
      }
    }
    return null;
  }
   
  ProvisioningResult result = new ProvisioningResult();
  PreparedStatement statement = null;
  String businessEmail = null;

  if ( plan != null ) {

    List accounts = plan.getAccountRequests();
    if ( ( accounts != null ) && ( accounts.size() > 0 ) ) {
      for ( AccountRequest account : accounts ) {
        try {
           if ( AccountRequest.Operation.Modify.equals( account.getOperation() ) ) {

			businessEmail = getAttributeRequestValue(account,"BusinessEmail");
			
			if ( businessEmail != null && !"no-reply@test.com".equalsIgnoreCase(businessEmail) ) {
			String nativeIdentity = null;
			nativeIdentity = (String) account.getNativeIdentity();
			statement = connection.prepareStatement( "update Sailpoint set BusinessEmail = ? where EmployeeReferenceCode = ?" );
            statement.setString ( 1, (String) businessEmail );
            statement.setString ( 2, (String) nativeIdentity );
        
            statement.executeUpdate();

            result.setStatus( ProvisioningResult.STATUS_COMMITTED );
			}
          }
        }
        catch( SQLException e ) {
          result.setStatus( ProvisioningResult.STATUS_FAILED );
          result.addError( e );
        }
        finally {
          if(statement != null) {
            statement.close();
          }
        }
      }
    }
  }
  return result;