Skip to main content

Introduction

jdbc-elastic is an independent JDBC driver. Access Elasticsearch with REST-style commands for document reads and writes, searches and index management. Use Connection, PreparedStatement and ResultSet directly; dbVisitor APIs are optional.

Features​

  • Bind request parameters with PreparedStatement and read search results through ResultSet.
  • Read and write documents, manage indexes, search, count and run _cat queries.
  • Expand document fields into result columns and configure pre-read thresholds and cache storage.

Metadata Queries​

Query through connection.getMetaData():

JDBC methodResult
getCatalogs()Empty result; no separate catalog namespace
getTables()Indices
getColumns()Fields declared in mappings
getSchemas()Empty result
getTableTypes()TABLE

Get Connected​

  1. Add dependencies: Maven or Gradle configuration.
  2. Connect to the database: JDBC URL, credentials and connection examples.
  3. Configure parameters: names, defaults and units.
  4. Usage limitations: JDBC support and database-specific restrictions.

Before You Connect​

  • Commands must use the syntax supported by this driver; arbitrary relational SQL is not translated.
  • JDBC batch and transactions are not supported. Check the shared JDBC limitations before integrating a connection pool, ORM or other JDBC tool.

When using dbVisitor APIs, Elastic6 and Elastic7 dialects are available.

Command reference · Query Operations · Data Writes

Vector searches