Hi folks,
Has anyone found a workaround for capturing the NativeIdentity generated by the database during JDBC provisioning?
Curious if anyone has successfully used a post-insert SELECT query or any other method to reliably fetch and assign the generated ID back into ISC?
Appreciate any suggestions or workarounds you’ve tried.
This related post didn’t quite solve it for me.
thanks
Here’s a working example.
In my instance I was provisioning out the ISC name field (which i know is unique) so after the create action i do a query to go and find the db generated id field.
account.setNativeIdentity lets you send it back to ISC.
//Get the new native identity value
insertedUser = connection.prepareStatement("Select id from <table> where [name] = ?");
insertedUser.setString(1, identityName);
ResultSet rs = insertedUser.executeQuery();
String retrievedId = null;
while (rs.next()) {
retrievedId = rs.getString("id");
}
account.setNativeIdentity(retrievedId);
1 Like