Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi All,
I am trying to create a database connection and I saw that everybody says that I have to create a database thing after I download the connector in the market...what is this?
I mean...After I download the connector, Should I create a thing with a database as template or with the connector as template?
An where do I see my tables to validate that the connection was a sucess?
I am really newbie in thingworx, so every will be welcome.
Thanks,
Anselmo.
Solved! Go to Solution.
Anselmo Saito you'll need to configure the URL in following format
JDBC Driver Class Name : com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC Connection String : jdbc:sqlserver://192.168.1.21:1433;databaseName=thingworx
Database User Name : <Username>
Database Password : <password>
All of this has been configured in the Thing which is inheriting MSSqlServer Template (which you have got with the extension)
Note: BTW, because I see you are using SA user, make sure that it's not locked and the schema to which you are trying to connect should allow you to authenticate with SQL Authentication. Additionally, the TCP/IP should be enabled for the DB
Hi,
Just import the downloaded extension of connector into the ThingWorx server. After that you will see templates
Iike MySqlServer thing template, you need to create thing of this thing template and then in the configuration page you can give jdbc url, username password etc. Save the thing.
Then in the properties page of the thing, you can see isConnected property will be checked (true).
Then you can create services in the service page of the thing.
Thanks,
Aditya
Hi Aditya,
I have my Database in other machine,
I have configured the connection string by providing the IPaddress of that machine :
jdbc:mysql://52.36.21.78:3306/sampletable,
But I could not able to connect with that database, do I need to allow any kind of permission or need any kind of configuration.
Anselmo Saito What sort of DB extension are you working with? Which database are you attempting to connect to ThingWorx? Depending on these two previous questions you will need to create a Thing which should inherit the template of type of DB extension you have imported.
Hi guys,
I am using a MSSqlServer template that I downloaded from ThingWorx IoT Marketplace to try to connect with my local database (Sql Server 2014) and (also) with a database in another machine.
I got stuck in the JDBC String...what I am using is the example below:
jdbc:sqlserver://Machine.Name;user=sa;password=abc;
Are there a specific way of creating this string for thingworx?
Thanks for the replies,
Anselmo.
Anselmo Saito you'll need to configure the URL in following format
JDBC Driver Class Name : com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC Connection String : jdbc:sqlserver://192.168.1.21:1433;databaseName=thingworx
Database User Name : <Username>
Database Password : <password>
All of this has been configured in the Thing which is inheriting MSSqlServer Template (which you have got with the extension)
Note: BTW, because I see you are using SA user, make sure that it's not locked and the schema to which you are trying to connect should allow you to authenticate with SQL Authentication. Additionally, the TCP/IP should be enabled for the DB
Alright, I am almost there!
My property isConnected received a value "true" but I don't know where do I see my tables and data...
Or will I see it only when I bind them to a widget?,
Anselmo.
Thanks
Nevermind...I found it!!
Thank you very much!
I just don't know to whom will I give the correct answer...there are a lot of good ones.
You can go to the Services page of the Thing and create a service like Test. While creating the service be sure to select SQL (Query) from the drop-down next to New Service label. Type something like SELECT * FROM SampleTable in the Script field. save it and then test