Introduction
Hint
This article is generated by AI translation.
jdbc-elastic is an ElasticSearch JDBC driver adapter that allows developers to operate ElasticSearch using standard JDBC interfaces and ElasticSearch native REST API-style commands. Its purpose is to enable developers to seamlessly integrate and use ElasticSearch through the familiar JDBC programming model.
Core Features
- Native command support: Supports commonly used ElasticSearch REST API commands, including
GET,POST,PUT,DELETE,HEAD. - JDBC standard interfaces: Supports standard interfaces such as
Connection,Statement,PreparedStatement,ResultSet. - Parameter placeholders: Supports
?placeholders in URL paths and JSON Body, with parameters set viaPreparedStatement. - Result set mapping: Automatically maps ElasticSearch JSON responses to JDBC
ResultSet. - Auto-generated key return: Supports
Statement.RETURN_GENERATED_KEYS, automatically returning the generated_idon insert operations. - Multi-command support: Supports batch operations like
_mget,_msearch. - Index management: Supports index creation, deletion, Mapping settings, Settings configuration, alias management, and more.
- Pre-read optimization: Supports pre-read configuration for large result sets to optimize read performance.
- Multi-version compatibility: Compatible with ES6/ES7/ES8/ES9 without dependency adjustments.
Architecture Design
jdbc-elastic internally parses QueryDSL commands, converts them to underlying REST requests, and communicates using the official ElasticSearch REST Client.
Use Cases
- Accessing ElasticSearch in a unified way (JDBC) within Java projects.
- Operating ElasticSearch with native REST API-style commands while leveraging JDBC convenience.
- Integrating ElasticSearch into existing JDBC-based data processing pipelines.