Share all details related to your problem, including any error messages you may have received.
Hello,
I have been trying to implement JDBC provision rule to create new user. All the attributes in my table are NOT NULL. And the code I have been trying to use is mentioned below. I am not able to fix the errors but still not successful. Can any please help me to find out where I have been making mistake in my code?
Thank you!
Is the roles a column in your DB table and comma separated and are you trying to update that as well during creation, if that’s case your prepared statement query is incorrect as you are setting total 6 values but in your query it doesn’t seem to have anything related to roles ( column 4 in your code)
Please recheck
PreparedStatement statement = connection.prepareStatement("insert into `techcent`.`identites` (UserId,DisplayName,FirstName,LastName,EmailID) values (?,?,?,?,?)");
And also post what is the exact error you are getting
I see you don’t have roles column included in your prepared statement on line 102 but you are trying to set that in lines 112 to 120. You will have to fix your prepared statement in line 102.
Hello Satish,
Please find attached the updated code file.
I have 2 tables in my db, one for user details and other named as “roles” for storing the roles that we need to assign to users. I want to provision role to user in SailPoint which then gets updated in DB. I have about a year of experience with SailPoint IAM and am still in the learning phase so that’s why getting stuck. If you can please help.
Please check your plan first if all the attribute requests are coming properly and if not check your provisioning policies or source of your plan code to check what is the issue.
If possible share your plan from logs, looks like you are already printing this.
@ArpitaSB
Based on the Error java.sql.SQLIntegrityConstraintViolationException: Column ‘DisplayName’ cannot be null
It is clear that you are passing the null value in “DisplayName”
As mentioned by @iamksatish do check the plan.
To troubleshoot this issue and to narrow down can you try passing passing a default value for the DisplayName and see
String defaultDisplayName = "DefaultDisplayName"; // you can set any string here and check
statement.setString(2, getAttributeRequestValue(account, "DisplayName") != null ? getAttributeRequestValue(account, "DisplayName") : defaultDisplayName);
I have written one different complete code by myself for this application provisioning. The previous one I took it from someone so I was getting confused. Please find the new code attached below:
Thank you soo much for all your help in this issue. I was able to sort out all the errors and now my provisioning rule is working. Your collective efforts have truly helped me alot and it means alot.