# Unable to connect to database. Tried 1 times

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-database-tried-1-times/331547>\
**Category:** Logstash\
**Created:** [May 1, 2023, 7:09am UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-tried-1-times/331547 "2023-05-01T07:09:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m3bgwad](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@m3bgwad](https://discuss.elastic.co/u/m3bgwad)\
**Post date:** [May 1, 2023, 7:09am UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-tried-1-times/331547/1 "2023-05-01T07:09:07Z")

</div>

Hello to All,  
I am trying to connect with the Database, and I configured the JDBC plugin in case there is a time-out connection.

```auto
jdbc_validate_connection => "true"
jdbc_validation_timeout => "60"

```

In the first time-out, the connection from my side to the Database goes down, I understand this case happened because, I have scheduled every 1 minute and the `jdbc_validation_timeout` every 60 seconds,  
My question here is, Why is the connection not restored when the Database is stable?  
Uploading: image.png...

Thanks,

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [May 2, 2023, 9:22am UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-tried-1-times/331547/2 "2023-05-02T09:22:00Z")

</div>

Hi Mabd,

Can you share your Logstash configuration as `code`? If you could also share the exact error you are seeing the logs that would also help.

---

<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:** [May 30, 2023, 9:22am UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-tried-1-times/331547/3 "2023-05-30T09:22:48Z")

</div>

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