# JDBC Provisioning Rule – Workaround to Capture DB-Generated NativeIdentity?

**URL:** <https://developer.sailpoint.com/discuss/t/jdbc-provisioning-rule-workaround-to-capture-db-generated-nativeidentity/145694>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud\
**Created:** [June 18, 2025, 4:19am UTC](https://developer.sailpoint.com/discuss/t/jdbc-provisioning-rule-workaround-to-capture-db-generated-nativeidentity/145694 "2025-06-18T04:19:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalyan\_dev32](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kalyan_dev32/32/21870_2.png) [@kalyan\_dev32](https://developer.sailpoint.com/discuss/u/kalyan_dev32)\
**Post date:** [June 18, 2025, 4:19am UTC](https://developer.sailpoint.com/discuss/t/jdbc-provisioning-rule-workaround-to-capture-db-generated-nativeidentity/145694/1 "2025-06-18T04:19:51Z")

</div>

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](https://developer.sailpoint.com/discuss/t/jdbc-provisioning-rule-to-read-the-nativeidentity-that-gets-generated-in-the-database/1975) didn’t quite solve it for me.

thanks

---

<div class="post-metadata">

**Author:** ![Leigh-mason](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@Leigh-mason](https://developer.sailpoint.com/discuss/u/Leigh-mason)\
**Post date:** [June 23, 2025, 3:38am UTC](https://developer.sailpoint.com/discuss/t/jdbc-provisioning-rule-workaround-to-capture-db-generated-nativeidentity/145694/2 "2025-06-23T03:38:56Z")

</div>

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.

```auto
            //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);

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 22, 2025, 3:39am UTC](https://developer.sailpoint.com/discuss/t/jdbc-provisioning-rule-workaround-to-capture-db-generated-nativeidentity/145694/3 "2025-08-22T03:39:07Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
