Saturday 16 June 2018

OIM API - Update the Group Name for Specified Lookup.

public void updateLookupGroupName(String groupName, String lookupName) {
    String logp = CN + "updateLookupGroupName";
    logger.info(logp + "START");
    Connection connection = null;
    try {
        connection = Platform.getOperationalDS().getConnection();

        String sql = "update lku set lku_group = ? where lku_type_string_key = ?";
        PreparedStatement preparedStatement = null;

        preparedStatement = connection.prepareStatement(sql);
        preparedStatement.setString(1, groupName);
        preparedStatement.setString(2, lookupName);
        preparedStatement.executeUpdate();
    } catch (Exception e) {
        logger.error(logp + " Exception while updating group name: " + e);
    } finally {
        try {
            connection.close();
        } catch (Exception e) {
            logger.error(logp + " Exception while closing connection : " + e);
        }
    }
    logger.info(logp+ "END");
}


Happy Learning!!!

No comments:

Post a Comment