# Create a Datasource with GatewayContext.createDataSource(Properties connectionProps)

**URL:** <https://forum.inductiveautomation.com/t/create-a-datasource-with-gatewaycontext-createdatasource-properties-connectionprops/14232>\
**Category:** Module Development\
**Created:** [May 8, 2017, 6:19pm UTC](https://forum.inductiveautomation.com/t/create-a-datasource-with-gatewaycontext-createdatasource-properties-connectionprops/14232 "2017-05-08T18:19:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [May 8, 2017, 6:19pm UTC](https://forum.inductiveautomation.com/t/create-a-datasource-with-gatewaycontext-createdatasource-properties-connectionprops/14232/1 "2017-05-08T18:19:03Z")

</div>

How do I create a new datasource with GatewayContext.createDataSource(Properties connectionProps) ?

Can I have an example? Does this also create a DatasourceRecord so that users can edit the connection in the Gateway UI?

Thanks

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [May 8, 2017, 10:55pm UTC](https://forum.inductiveautomation.com/t/create-a-datasource-with-gatewaycontext-createdatasource-properties-connectionprops/14232/2 "2017-05-08T22:55:08Z")

</div>

No, that method isn’t what you’re thinking. It’s not creating a "datasource " like Ignition’s concept of a datasource. It’s creating a javax.sql.DataSource - a source of JDBC connections. It only exists because our JDBC drivers are in a separate classloader and so the gateway needs to do some gymnastics in order to create jdbc driver instances correctly.

There is no reason you should be calling it, it probably shouldn’t be part of the public API.
