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

Problems with testing database connection

Mr_Henry_M
14-Alexandrite

Problems with testing database connection

Hello! Perhaps there was already such a question, but still. A service of SQL-query type produces the following error when I try to test it:

 

Error.png

 

There is a connection to the database itself, there is a data in it too. As I understand, the problem is that my service is perceived as empty. But I don't understand what could be wrong.

1 ACCEPTED SOLUTION

Accepted Solutions
posipova
20-Turquoise
(To:Mr_Henry_M)

The problem with this extension is that it's pretty old and contains very old drivers (as noted in the marketplace, it's no longer supported).: https://marketplace.ptc.com/apps/195356/jdbc-connector-extension#!overview

 

What I suggest trying is what I described in my response in this thread https://community.ptc.com/t5/ThingWorx-Developers/Using-a-third-party-Jar-file-for-Database-connection/m-p/514861?collapse_discussion=true&page=2&q=jdbc%20extension&search_type=thread

 

View solution in original post

5 REPLIES 5
posipova
20-Turquoise
(To:Mr_Henry_M)

How did you check your database connection? What is your configuration on the jdbc thing?

Mr_Henry_M
14-Alexandrite
(To:posipova)

I took the configuration from MySQL Extension and changed the name of the database and address:

 

4.png

 

In properties I set the isConnected property to true:

 

5.png

 

 

The service itself looks like this:

 

6.png

 

"ex" is the name of the table in the database "example"

posipova
20-Turquoise
(To:Mr_Henry_M)

Please refer to this page to change the connection string and the validation string accordingly:

 

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FExtensibility%2FJDBCExtension%2FJDBCConfigurationExamples.html%23

 

When you database is properly connected -- you should not be changing isConnected to true, it will set automatically -- in your service, click on tables/columns and you should be able to see your data. If it's not properly connected you won't see anything.

Mr_Henry_M
14-Alexandrite
(To:posipova)

The problem is that these lines differ in details depending on the specific database. Therefore, I don't quite understand how, for example, set the configuration for My SQL or MS Access / Ms Excel databases.

 

In addition, the configuration shown in the screenshot above is taken from the downloaded extension directly for MySQL, where, in theory, it's already set correctly for a specific database. Only the address and name should differ.

 

I know that there are examples of the connection strings on the link in the table, but, to be honest, it didn’t help much and didn’t work for the same Access or Excel. Maybe the problem is in the drivers.

posipova
20-Turquoise
(To:Mr_Henry_M)

The problem with this extension is that it's pretty old and contains very old drivers (as noted in the marketplace, it's no longer supported).: https://marketplace.ptc.com/apps/195356/jdbc-connector-extension#!overview

 

What I suggest trying is what I described in my response in this thread https://community.ptc.com/t5/ThingWorx-Developers/Using-a-third-party-Jar-file-for-Database-connection/m-p/514861?collapse_discussion=true&page=2&q=jdbc%20extension&search_type=thread

 

Top Tags