Installing SonarQUBE on windows and SQL Server

Installing SonarQube on windows machine with Sql Server express as back end is quite simple, but here is some information you should know to avoid some common problem with database layer (or at least avoid problem I had :) )

Setting up Sonar Qube in Windows is easy, but sometimes you can encounter some problem to have it talk to Sql Server database.

First of all I avoid using integrated authentication in SQL Server, because I find easier to setup everything with a standard sql user. After all my instance of SQL Express is used only for the instance of Sonar. So I create a user called sonar with a password, and remove the check for password expiration.

Figure 1: Avoid password expiration

Then you should open Sql Server Configuration Manager, and you must enable the TCP Procol.

Figure 2: Enable TCP/IP protocol in Sql Server Configuration Manager

Now I found that Java drivers are a little bit grumpy on connecting with my database, so I decided to explicitly disable dynamic port and specify the 1433 port directly. Just double click the TCP/IP protocol shown in Figure 2 to open properties for TCP/IP protocol.

Figure 3: Disable dynamic ports and specify 1433 as TCP Port

Now create a new database called Sonar, and set user sonar as owner of the database. Place specific attention to case of Database Name. I choose Sonar with capital S.

Figure 4: Create a new database called Sonar with sonar user as owner

Now be sure to select the correct Collation, remember that you should use a collation that is Case Sensitive and Accent Sensitive, like SQL_Latin1_General_CP1_CS_AS.

Figure 5: Specify the right Collation for the database. It should be CS and AS

Now, just to be sure that everything is ok, try to connect from Management Studio using the port 1433 and with user sonar. To specify port you should use a comma between server name and the port.

Figure 6: Try to connect to the server with user sonar and port 1433

Verify that you can see Sonar database. If you are able to connect and see Sonar Db you have everything ready. Remember to download JDBC driver for MsSql at this address, once downloaded be sure to right click the zip file and in properties section unblock the file. Then unzip the content and copy the file jtds-1.3.1.jar into subfolder extensions\jdbc-driver\mssql of your Sonar Installation (the mssql folder usually does not exists and you should manually create it).

Now you should edit conf/ file and add connection string to the database.


Place specific attention to database name in connection string because it is CASE SENSITIVE, as you can see I specified sqlserver://localhost/Sonar with capital S exactly as database name. Since you are using Accent Sensitive and Case Sensitive collation is super important that the name of the database is equal in casing to the name used in connection string. If you specify wrong casing, you are not able to start Sonar and you will find this error in the sonar log.

The error: The database name component of the object qualifier must be the name of the current database. Happens if you use wrong casing in Db Name in connection string

You should be able now to start Sonar without any problem.

Gian Maria

Published by

Ricci Gian Maria

.Net programmer, User group and community enthusiast, programmer - aspiring architect - and guitar player :). Visual Studio ALM MVP

6 thoughts on “Installing SonarQUBE on windows and SQL Server”

  1. Hi Ricci,
    FYI… Tried this today and not working… I get
    WrapperSimpleApp: Encountered an error running main: org.sonar.process.MessageException: Unsupported JDBC driver provider: jtds
    org.sonar.process.MessageException: Unsupported JDBC driver provider: jtds

  2. I get the same error, regardless of having the DB drivers in the location specified or in System32.

    Additionally, the collation reccomended does not appear in the list for SQLExpress 2014.

    Another issue I face is that I cannot log in to SSMS using the steps above, I keep getting an error code that indicates my credentials are incorrect, even though they are correct.

  3. If you cannot login it is possible that you did not enabled sql authentication in SQL Server.
    Until you cannot login in SSMS surely there is something wrong with configurations or credentials

Comments are closed.