# Logstash JDBC driver

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-driver/293041>\
**Category:** Logstash\
**Created:** [December 28, 2021, 11:38am UTC](https://discuss.elastic.co/t/logstash-jdbc-driver/293041 "2021-12-28T11:38:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farid\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/farid_n/32/74144_2.png) [@Farid\_N](https://discuss.elastic.co/u/Farid_N)\
**Post date:** [December 28, 2021, 11:38am UTC](https://discuss.elastic.co/t/logstash-jdbc-driver/293041/1 "2021-12-28T11:38:59Z")

</div>

Hi dears  
I have upgraded my cluster form 7.6.2 to 7.16.2  
There is only one problem I faced with.

My Logstash has some pipelines that need to connect to a sql db and according to a statement, get a SP result from sql db and index it to Elasticsearch.

The problem is Logstash 6.7.2 can do this with sqldbc42.jar `jars/sqljdbc_4.2/enu/jre8/ **sqljdbc42.jar** `  
But when I upgrade Logstash to 7.16.2 this driver can not connect Logstash to my sql

I just want to know what version of that driver I should use? Or where can I find this compatible driver?

This is my Logstash 7.16.2 log (When I downgrade to 7.6.2 everything is ok)

```auto
[2021-12-28T00:00:00,188][ERROR][logstash.inputs.jdbc][Agent][cdeebc9c4e6eafcf511187a160e912f3b09356b01df3ddadae6a1ce5dcc5313f] Unable to connect to database. Tried 1 times {:message=>"Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter", :exception=>Sequel::DatabaseConnectionError, :cause=>java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter, 

```

Thank you so much

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [December 28, 2021, 6:16pm UTC](https://discuss.elastic.co/t/logstash-jdbc-driver/293041/2 "2021-12-28T18:16:09Z")

</div>

> [@Farid\_N](#):
>
> `javax/xml/bind/DatatypeConverter`

It looks like you are trying to use a JDBC driver that was built for Java 8 (`jre8` in the path), and Logstash is starting with Java 11 (we bundle a Java 11 with Logstash since ~7.10, preferring the one we bundle to the one on your `$PATH`). The `javax.xml.bind` libraries became explicit add-in with Java 9 (Sept 2017) and are no longer a part of the Java distribution since Java 11 was released (Sept 2018).

Does the vendor provide an updated library to work with Java 11?

A temporary work-around would be to set `LS_JAVA_HOME` to point to a locally-installed Java 8 (if you do this, note that Java 8 support is being dropped soon with the upcoming release of Logstash 8)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 25, 2022, 6:17pm UTC](https://discuss.elastic.co/t/logstash-jdbc-driver/293041/3 "2022-01-25T18:17:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
