cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

configuring jdbc string dynamically

svisveswaraiya
17-Peridot

configuring jdbc string dynamically

Hi,

I have a database template thing and is it possible to configure the jdbc connection string dynamically from the mashup? When a mashup is loaded, is it possible to pass the database name, username and password as input to establish the connection between that database and thing?

 

Thanks,

Shalini V.

1 ACCEPTED SOLUTION

Accepted Solutions

The JDBC settings are stored in configuration table in Thingworx and you can get/set them using the get/setconfigurationtable snippet on the DB thing. There is also an example given here:
https://community.ptc.com/t5/IoT-Tech-Tips/Steps-to-create-a-External-Relational-Database-Thing-and-update/m-p/534858/highlight/false#M574

 

 

Thanks,

Mukul Narang

View solution in original post

3 REPLIES 3

Hello @svisveswaraiya,

 

Yes, this is definitely possible. Please refer to Setting Configuration tab values on Things via a custom Service in ThingWorx for more information.

In summary, you need to navigate to your Database Thing > Services > GetConfigurationTables. This will return all the Configuration Tables available for that specific Thing, depending on the template. Then, run GetConfigurationTable for the specific table you are looking for more information about. In this case, we are looking at ConnectionInfo, per the image below:

 

ConfigTable.PNG

 

This allows you to create a Data Shape from the returned values by clicking the + Data Shape button on the top right corner of the screen. Then, all you need to do is setup your service to run SetConfigurationTable and passing the table name (ConnectionInfo) and an infotable with a row containing the information sent from the UI.

I hope you find this information helpful in setting configuration tables dynamically in runtime.

Regards,

Emmanuel

The JDBC settings are stored in configuration table in Thingworx and you can get/set them using the get/setconfigurationtable snippet on the DB thing. There is also an example given here:
https://community.ptc.com/t5/IoT-Tech-Tips/Steps-to-create-a-External-Relational-Database-Thing-and-update/m-p/534858/highlight/false#M574

 

 

Thanks,

Mukul Narang

Hi @svisveswaraiya.

 

If you feel your question has been answered, please mark the appropriate post as the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in our community!

 

Regards.

 

--Sharon

Top Tags