# Ansible : Need information regarding the connection with Database (Oracle/MySql)

**URL:** <https://forum.ansible.com/t/ansible-need-information-regarding-the-connection-with-database-oracle-mysql/24182>\
**Category:** Ansible Project\
**Created:** [April 10, 2017, 6:34pm UTC](https://forum.ansible.com/t/ansible-need-information-regarding-the-connection-with-database-oracle-mysql/24182 "2017-04-10T18:34:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nishant\_bawane](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Post date:** [April 10, 2017, 6:34pm UTC](https://forum.ansible.com/t/ansible-need-information-regarding-the-connection-with-database-oracle-mysql/24182/1 "2017-04-10T18:34:11Z")

</div>

Below is the task… I need to connect to host server… fetch the host name nad current java version and store it in the database on local server. I am able to fetch the host name and java version… but need assistance reading the sotring the value of variable in DATABASE. Can anyone please suggest how to proceed with that -

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 10, 2017, 9:44pm UTC](https://forum.ansible.com/t/ansible-need-information-regarding-the-connection-with-database-oracle-mysql/24182/2 "2017-04-10T21:44:40Z")

</div>

I think you just need to find or write a module to store the results using some sql. I found a reference to some oracle modules here [https://liquidat.wordpress.com/2017/02/17/ansible-community-modules-for-oracle-db-asm/](https://liquidat.wordpress.com/2017/02/17/ansible-community-modules-for-oracle-db-asm/) including a couple of modules for this interacting with database.

If you go with oracle, consider using Merge On syntax which would give you a sort of idempotent behavior. Mysql likely has something similar too, although I don't know what the syntax might be.

Hope thus helps,

Jon
