Forum Discussion

mrdwprice's avatar
mrdwprice
Contributor
4 years ago
Solved

MSSQL(MicrosoftDriver)/com.microsoft.sqlserver.jdbc.SQLServerDriver

I tried to add a new Connection String Template for 

MSSQL(MicrosoftDriver)/com.microsoft.sqlserver.jdbc.SQLServerDriver

 

I tried using a different Driver name:

MSSQL(MicrosoftDriver - uniquenamehere)/com.microsoft.sqlserver.jdbc.SQLServerDriver

 

Connection Connection String Template

jdbc:sqlserver://<HOST>:<PORT:1433>;databaseName=<DB>;IntegratedSecurity=true

 

But Ready API warns I may break the current driver so I backed out from making the change.

 

What is the correct way to do this?

 

I can edit the connection string manually which works, but I would like to have 2 templates available to me if possible:

jdbc:sqlserver://<HOST>:<PORT:1433>;databaseName=<DB>;IntegratedSecurity=true

jdbc:sqlserver://<HOST:127.0.0.1>:<PORT:1433>;databaseName=<DB>;user=<USER>;password=<PASSWORD>

 

 

 

I have the following files in place

\ReadyAPI-2.7.0\bin\ext\mssql-jdbc-8.4.1.jre8.jar

\ReadyAPI-2.7.0\bin\mssql-jdbc_auth-8.4.1.x64.dll

7 Replies

  • richie's avatar
    richie
    Community Hero

    Hey mrdwprice 

     

    Can you clarify a bit  - where does ReadyAPI! give you the warning?

     

    Reason I ask is that I've just added in another row to my JDBC preferences which corresponds to your second jdbc url.  I already have a SQLServer connection setup and I didn't get any problems?

     

    The db driver .jars are registered as REadyAPI! boots - but you don't link them to a specfic row in that JDBC Config preferences -  just to be clear - the name you specify in the 'Driver' editable field when creating a new connection - you could call the driver name 'Steve' and it would work - admittedly that was for a different database using a different JDBC driver file with different setup.

     

    So -  I've just looked  in the .jar file and there is a 'java.sql.Driver' file that contains the value 'com.microsoft.sqlserver.jdbc.SQLServerDriver' so I thought maybe this was the problem

     

    HOWEVER - I changed the name of the 'Driver' field for my SQLServer connection - first I changed it to 

    MSSQL(MicrosoftDriver2)/com.microsoft.sqlserver.jdbc.SQLServerDriver, then I ran a query using the driver and it worked fine.

     

    I then changed the value again to MSSQL(MicrosoftDriver)/com.microsoft.sqlserver.jdbc.SQLServerDriver2, then I ran a query using the driver and it worked fine.

     

    From the evidence above - I'd just add in an extra entry into the JDBC config, the second one with a Driver value of MSSQL(MicrosoftDriver2)/com.microsoft.sqlserver.jdbc.SQLServerDriver and the connection url of 

    jdbc:sqlserver://<HOST>:<PORT:1433>;databaseName=<DB>;IntegratedSecurity=true

     

    However - youre saying this wont work.

     

    So, can you clarify where you get the warning?  I've tried reproducing but I can't

     

    Cheers

     

    rich

    • mrdwprice's avatar
      mrdwprice
      Contributor

      Thanks very much for the reply. These are the steps I'm doing:

       

      File>Preferences>JDBC Drivers

       

      Click the green + icon

       

      Add Driver name:
      MSSQL(MicrosoftDriver - uniquenamehere)/com.microsoft.sqlserver.jdbc.SQLServerDriver

       

      Add Connection String template:
      jdbc:sqlserver://<HOST>:<PORT:1433>;databaseName=<DB>;IntegratedSecurity=true

       

      Click OK

       

      The following warning is given:

      "The existing database connections may be damaged by these changes.
      Are you sure you want to change the selected driver's template?"

      • richie's avatar
        richie
        Community Hero

        hey mrdwprice 

         

        what version of readyapi! are you running?

         

        i'm on v3.4.0

         

        ta

         

        rich

  • sonya_m's avatar
    sonya_m
    SmartBear Alumni (Retired)

    Thank you for your replies, Community!

     

    mrdwprice did you try following the advice?