# Getting internal "\_id" field via jdbc

**URL:** <https://discuss.elastic.co/t/getting-internal-id-field-via-jdbc/355314>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [March 13, 2024, 2:06pm UTC](https://discuss.elastic.co/t/getting-internal-id-field-via-jdbc/355314 "2024-03-13T14:06:11Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Kenjiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kenjiro/32/121861_2.png) [@Kenjiro](https://discuss.elastic.co/u/Kenjiro)\
**Post date:** [March 13, 2024, 5:28pm UTC](https://discuss.elastic.co/t/getting-internal-id-field-via-jdbc/355314/3 "2024-03-13T17:28:52Z")

</div>

Hello,

> [@dadoonet](#):
>
> BTW I did not check initially but where dii you see that you can't access the `_id` field using the SQL layer?

This is stated here, on several posts from elastic team members. One example being --\> [Is there a way to access internal \_id and \_type fields in ES SQL query (XPack)?](https://discuss.elastic.co/t/is-there-a-way-to-access-internal-id-and-type-fields-in-es-sql-query-xpack/174894)

> [@dadoonet](#):
>
> As you can see, many options. So please clarify your exact need and architecture so we can give even better answers 😉

I need to extract data from elasticsearch into a relational database. Since the data contains no logical unique keys (even not a composite one), I have to rely elastic \_id field to ensure data consistency. But I cannot reach the field via elasticsearch JDBC driver.

Any suggestions?

---

_[View the full topic](https://discuss.elastic.co/t/getting-internal-id-field-via-jdbc/355314)._
