Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi there,
I would like to display data from the database. Here is what I did,
1. I created a template and connected to mysql.
2. I created a thing and was able to create a service in my thing and the data is showing.
3. I go to the mashup and do a binding and I select the thing using GetProperties and the data is not returning.
Is there any reason why it is not displaying anything from the database?
Thank you,
Kevin
Hi Kevin,
This is how i suggest you to do... I'm connecting using SQL Server, so you'll have to check what are the parameters for mysql
1- Create a Database thing.
2- On the Configuration tab:
2.A- DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver
2.B- Connection string: jdbc:sqlserver://localhost;databaseName=ThingWorx_Dev
2.C- Connection validation string: SELECT GetDate()
2.D Enter db user/pwd
3- On the service tab (inside the database thing created)
3.A- Create a service (Service Type = QUERY)
After you have the service setup, TEST it and guarantee that the query is working.
4- Create a Datashape which is the output of your query.
Only after that, you'll use it on the Mashup.
It took me sometime to learn, but the mashup is the last thing you will do.
Good luck
Claudio
Those items I have created, but once I get to the Mashup, is there I'm having problems....
Not sure which service to use... Once I get it, I'll be able to bind the service and show the data.
Thank you,
Kevin
You can review the MySQL database interaction in eLearning, but like what Claudio wrote.
That is what I did..
I pulled in the service and linked it to the info table on the mashup and yet data is not returning. I did check the query and it is working.
If you click on your Service, is there any Event that is running the service, like Mashup Loaded for example?
I found a solution. What I forgot to do is this, I did create the datashape, however in the service, I forgot to add the datashape in the service. I added it and now it i working...