# Error connecting to sql database

**URL:** <https://discuss.elastic.co/t/error-connecting-to-sql-database/277226>\
**Category:** Logstash\
**Created:** [June 28, 2021, 12:25pm UTC](https://discuss.elastic.co/t/error-connecting-to-sql-database/277226 "2021-06-28T12:25:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [June 28, 2021, 12:25pm UTC](https://discuss.elastic.co/t/error-connecting-to-sql-database/277226/1 "2021-06-28T12:25:42Z")

</div>

I need help to connect to the sql server database.  
I downloaded a connector and already put n specific folder, but it's giving an error with the following.  
Note; I can already connect to mysql database but sql server will be the first time, can you please help me?

```auto
[ERROR] 2021-06-28 07:55:31.242 [[main]<jdbc] jdbc - Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter"}
[ERROR] 2021-06-28 07:55:31.244 [[main]<jdbc] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main

```

```auto
jdbc{
#jdbc_driver_library => "/home/elasticstack/logstash/mysql-connector-java-8.0.16/mysql-connector-java-8.0.16.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://X.X.X.X:1433;databaseName=XXXXX;integratedSecurity=false"
#jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/sqljdbc42.jar"
jdbc_user => "xxxx"
jdbc_password => "xxxx"
type => "lanlinktactium"
# dbc
statement => "
SELECT TOP (100)
cal.IS_CAL,cal.DT_CAL_INITIATED,srv.NM_SRV,dvc.VL_DVC_LGC_IDENTIFIER as RAMAL

```

Another thing, when it comes to a mysql database I just need the IP and the port, for the sql server I received a different type like that: bancosql\bc01

---

<div class="post-metadata">

**Author:** ![gauravdhaka](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@gauravdhaka](https://discuss.elastic.co/u/gauravdhaka)\
**Post date:** [June 28, 2021, 1:18pm UTC](https://discuss.elastic.co/t/error-connecting-to-sql-database/277226/2 "2021-06-28T13:18:35Z")

</div>

Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.

---

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [June 28, 2021, 1:40pm UTC](https://discuss.elastic.co/t/error-connecting-to-sql-database/277226/3 "2021-06-28T13:40:50Z")

</div>

Friend, I changed my connector, and apparently it worked, let's see if someone more experienced can help us, but follow where I can, maybe it will help.

> **[Download - JDBC Driver for SQL Server](https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-2017)**
>
> Download the Microsoft JDBC Driver for SQL Server to develop Java applications that connect to SQL Server and Azure SQL Database.

 ![msslq](https://us1.discourse-cdn.com/elastic/original/3X/3/1/316ad27e4a06e911c560094f55ca184e937bf8b7.png)

---

<div class="post-metadata">

**Author:** ![gauravdhaka](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@gauravdhaka](https://discuss.elastic.co/u/gauravdhaka)\
**Post date:** [July 5, 2021, 8:10am UTC](https://discuss.elastic.co/t/error-connecting-to-sql-database/277226/4 "2021-07-05T08:10:59Z")

</div>

yes, i think it can be helpful [.](https://get-vidmate.com) [.](https://instasave.onl)

---

<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:** [August 2, 2021, 8:11am UTC](https://discuss.elastic.co/t/error-connecting-to-sql-database/277226/5 "2021-08-02T08:11:56Z")

</div>

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