Skip to content

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

PropertyValue
JDBC URLjdbc:elastic://localhost:9200
Driver classapp.softnetwork.elastic.jdbc.ElasticDriver
Group IDapp.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.

ElasticsearchArtifact
ES 6.xsoftclient4es6-jdbc-driver-0.1.4.jar
ES 7.xsoftclient4es7-jdbc-driver-0.1.4.jar
ES 8.xsoftclient4es8-jdbc-driver-0.1.4.jar
ES 9.xsoftclient4es9-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

ParameterDescription
userUsername for basic authentication
passwordPassword for basic authentication
api-keyElasticsearch API key
bearerOAuth/JWT bearer token
schemeConnection scheme (http or https, default: http)

Examples

# Basic connection
jdbc:elastic://localhost:9200
# With authentication
jdbc:elastic://es.example.com:9200?user=elastic&password=changeme
# HTTPS with API key
jdbc:elastic://es.example.com:9243?scheme=https&api-key=your-api-key

Java 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

  1. Open Database > New Database Connection
  2. Choose Driver Manager > New
  3. Set Driver Name: SoftClient4ES
  4. Add the fat JAR file
  5. Set Driver Class: app.softnetwork.elastic.jdbc.ElasticDriver
  6. Set URL Template: jdbc:elastic://{host}:{port}
  7. Create a new connection using this driver

See the DBeaver guide for detailed setup instructions.

IntelliJ DataGrip

  1. Open Database > + > Driver
  2. Add the fat JAR
  3. Set Driver Class: app.softnetwork.elastic.jdbc.ElasticDriver
  4. 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.