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

configuring jdbc string dynamically

SOLVED

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
Highlighted

Re: configuring jdbc string dynamically

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-...

 

 

Thanks,

Mukul Narang

View solution in original post

Tags (1)
3 REPLIES 3
Highlighted

Re: configuring jdbc string dynamically

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

Highlighted

Re: configuring jdbc string dynamically

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-...

 

 

Thanks,

Mukul Narang

View solution in original post

Tags (1)
Highlighted

Re: configuring jdbc string dynamically

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

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!