# Getting Datasource parameters

**URL:** <https://forum.inductiveautomation.com/t/getting-datasource-parameters/7379>\
**Category:** Module Development\
**Created:** [October 7, 2013, 2:59pm UTC](https://forum.inductiveautomation.com/t/getting-datasource-parameters/7379 "2013-10-07T14:59:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoreThanCarbon](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@MoreThanCarbon](https://forum.inductiveautomation.com/u/MoreThanCarbon)\
**Post date:** [October 7, 2013, 2:59pm UTC](https://forum.inductiveautomation.com/t/getting-datasource-parameters/7379/1 "2013-10-07T14:59:01Z")

</div>

I have seen that with the IA Labs Scripting module I can add a datasource and browse tags. Is there any way to browse or get a list of datasources properties? I read in the forum that I can invoke system.db.getConnections() using

```auto
GatewayInterface gi = GatewayConnectionManager.getInstance().getGatewayInterface();
List<SerializableDatasourceMeta> datasources = 
         (List<SerializableDatasourceMeta>) gi.invoke("DatasourceMeta.getConnections");

for (SerializableDatasourceMeta datasource : datasources){
	System.out.println("DB Vendor: " + datasource.getVendor());
	System.out.println("DB Description: " + datasource.getDescription());
}
```

but it looks like this only gives me access to information like vendor name and description. I was hoping to get access to the parameters jdbcDriver, connectURL, username, & password similar to when adding a datasource in IA LAbs.

```auto
system.db.addDatasource(jdbcDriver="MySQL ConnectorJ", name="MySQL", connectURL="jdbc:mysql://localhost:3306/test", username="root", password="password", props="zeroDateTimeBehavior=convertToNull;")
```

This way I can use this info to do things like add a table to the database from the module. Unless there is already some way to do this.

---

<div class="post-metadata">

**Author:** ![nclemeur](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nclemeur](https://forum.inductiveautomation.com/u/nclemeur)\
**Post date:** [October 9, 2013, 12:06am UTC](https://forum.inductiveautomation.com/t/getting-datasource-parameters/7379/2 "2013-10-09T00:06:32Z")

</div>

I am not sure which version you are using but at least in version 7.6.x, you can access a database connection in the Gateway (which is all you need to create a table) using

```auto
gatewayContext.getDatasourceManager()...
```

But creating a table is simply a matter of executing a query with a create table statement, so I am not sure you even need to access the DatasourceManager as long as you have a connection to the database available (assuming the user has enough permission to create a table).

You can also try to use the good tools available in the Ignition platform such as the com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema class (again on the Gateway only).

HTH,  
Nicolas
