8 Replies Latest reply on Dec 29, 2017 12:39 PM by asaito-3 RSS
    asaito-3 Explorer

    Database Connection

    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.

      • Re: Database Connection
        adikumar Explorer

        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

          • Re: Database Connection
            mbasha Apprentice

            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.

          • Re: Database Connection
            supandey Ninja

            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.

            • Re: Database Connection
              asaito-3 Explorer

              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.

                • Re: Database Connection
                  supandey Ninja

                  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