JDBC Driver
SoftClient4ES provides a JDBC Type 4 driver that lets you connect any JDBC-compatible tool to Elasticsearch — DBeaver, IntelliJ DataGrip, Apache Superset, Tableau, and custom Java/Scala applications.
Connection Details
| Property | Value |
|---|---|
| JDBC URL | jdbc:elastic://localhost:9200 |
| Driver class | app.softnetwork.elastic.jdbc.ElasticDriver |
| Group ID | app.softnetwork.elastic |
Driver JARs
Download the self-contained fat JAR for your Elasticsearch version. The JARs are Scala-version-independent and include all required dependencies.
| Elasticsearch | Artifact |
|---|---|
| ES 6.x | softclient4es6-jdbc-driver-0.1.4.jar |
| ES 7.x | softclient4es7-jdbc-driver-0.1.4.jar |
| ES 8.x | softclient4es8-jdbc-driver-0.1.4.jar |
| ES 9.x | softclient4es9-jdbc-driver-0.1.4.jar |
Build Tool Integration
Maven
<dependency> <groupId>app.softnetwork.elastic</groupId> <artifactId>softclient4es8-jdbc-driver</artifactId> <version>0.1.4</version></dependency>Gradle
implementation 'app.softnetwork.elastic:softclient4es8-jdbc-driver:0.1.4'sbt
libraryDependencies += "app.softnetwork.elastic" % "softclient4es8-jdbc-driver" % "0.1.4"JDBC URL Format
jdbc:elastic://host:port[?param=value&...]Authentication Parameters
| Parameter | Description |
|---|---|
user | Username for basic authentication |
password | Password for basic authentication |
api-key | Elasticsearch API key |
bearer | OAuth/JWT bearer token |
scheme | Connection scheme (http or https, default: http) |
Examples
# Basic connectionjdbc:elastic://localhost:9200
# With authenticationjdbc:elastic://es.example.com:9200?user=elastic&password=changeme
# HTTPS with API keyjdbc:elastic://es.example.com:9243?scheme=https&api-key=your-api-keyJava Example
import java.sql.*;
String url = "jdbc:elastic://localhost:9200";try (Connection conn = DriverManager.getConnection(url)) { try (Statement stmt = conn.createStatement()) { // DDL stmt.execute("CREATE TABLE IF NOT EXISTS demo (id INT, name VARCHAR, PRIMARY KEY (id))");
// DML stmt.execute("INSERT INTO demo (id, name) VALUES (1, 'Alice'), (2, 'Bob')");
// DQL try (ResultSet rs = stmt.executeQuery("SELECT * FROM demo ORDER BY id")) { while (rs.next()) { System.out.printf("id=%d, name=%s%n", rs.getInt("id"), rs.getString("name")); } }
// Cleanup stmt.execute("DROP TABLE IF EXISTS demo"); }}Supported SQL
The JDBC driver supports the full SQL Gateway syntax:
- DDL — CREATE/ALTER/DROP TABLE, pipelines, watchers, enrich policies
- DML — INSERT, UPDATE, DELETE, COPY INTO
- DQL — SELECT with WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, UNION ALL, JOIN UNNEST, window functions
- SHOW/DESCRIBE — Tables, pipelines, watchers, enrich policies
BI Tool Setup
DBeaver
- Open Database > New Database Connection
- Choose Driver Manager > New
- Set Driver Name:
SoftClient4ES - Add the fat JAR file
- Set Driver Class:
app.softnetwork.elastic.jdbc.ElasticDriver - Set URL Template:
jdbc:elastic://{host}:{port} - Create a new connection using this driver
See the DBeaver guide for detailed setup instructions.
IntelliJ DataGrip
- Open Database > + > Driver
- Add the fat JAR
- Set Driver Class:
app.softnetwork.elastic.jdbc.ElasticDriver - Create a new data source with URL
jdbc:elastic://localhost:9200
License
The JDBC driver is licensed under the Elastic License 2.0 — free to use, not open source.