Connect Sonarqube to MSSQL - sql-server

I have a Sonarqube installation which connects to a SQL Server database. This has been configured and working for close to 12 months.
Today I upgraded Sonar, from an old version (3.x) to the current stable 5.1
I am getting an error like:
jvm 1 | WrapperSimpleApp: Encountered an error running main:
org.sonar.process.MessageException:
Unsupported JDBC driver provider: sqlserver
jvm 1 | org.sonar.process.MessageException: Unsupported JDBC driver provider:
sqlserver
I specified the path to the mssql jar in the conf file, so can't see any reason why this is occurring. Has anyone come across this, or any suggestions?

Support for SQL Server is achieved using the jTDS driver that is bundled with SonarQube, and this can't be changed since SQ 4.5 (see SONAR-5499).
So if your remove the specific entry that you set in the conf/sonar.properties file to specify the path to your JDBC driver, this should solve the problem.

Related

ORA-28040: After Upgrade Database to 12c from 11g

Problem Statement:
We are doing a migration activity in which we have migrated DATABASE from ORACLE 11g to ORACLE 12c.
After upgrade one of our application which is using jdk 6 with ojdbc6.jar (JDBC Driver) is not able to connect the 12c database.
Below error we are getting :
java.sql.SQLException: ORA-28040:
No matching authentication protocol
after Upgrade Database to 12c
Configuration
JDK Version : 1.6
JDBC Driver : ojdbc6.jar
Database Version : Oracle 12c
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 11
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 11
Workaround tried:
1) We tried to run a simple jdbc application with jdk1.6 and ojdbc6.jar it was successful. Also it is as per Oracle Compatibility matrix.
2) We asked to update the parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8 but security team cannot do it as it does not comply on security standards.
Please suggest how we should proceed forward to fix this issue.
The problem was then weblogic.jar and from the classpath of weblogic.jar, ojdbc14.jar was being referred. We checked in WL_HOME\server\lib library and found that ojdbc14.jar was there. We just let keep it there but copied ojdbc6.jar in some external directory and loaded same in CLASSPATH before all jars. Below is from oracle docs-
This driver is installed in the WL_HOME\server\lib folder (where WL_HOME is the folder where WebLogic Server is installed) with weblogic.jar. The manifest in weblogic.jar lists this file so that it is loaded when weblogic.jar is loaded (when the server starts). Therefore, you do not need to add this JDBC driver to your CLASSPATH. If you plan to use a third-party JDBC driver that is not installed with WebLogic Server, you must install the drivers, which includes updating your CLASSPATH with the path to the driver files, and may include updating your PATH with the path to database client files. See "Supported Database Configurations" on the Oracle Fusion Middleware Supported System Configurations page at http://www.oracle.com/technology/software/products/ias/files/fusion_certification.htmlOpens a new window.
If you plan to use a different version of any of the drivers installed with WebLogic Server, you can replace the driver file in WL_HOME\server\lib with an updated version of the file or add the new file to the front of your CLASSPATH.
So if you are facing the same issue I would like to suggest-
1) Check for the Oracle driver (ojdbc) - as the most post on StackOverflow suggest same.
You can check ojdbc driver compatibity here
2) If you cannot change driver immediately the change below in sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
(SQLNET.ALLOWED_LOGON_VERSION is depreciated in 12c. Also, please be noted that In 12c, the default value for the SQLNET.ALLOWED_LOGON_VERSION_SERVER parameter has been updated to “11”. This means that database clients using pre-11g JDBC thin drivers cannot authenticate to 12.1 database servers unless the parameter is set to the old default of “8”)
For your reference, please check-
https://docs.oracle.com/database/121/UPGRD/deprecated.htm#UPGRD60010
https://docs.oracle.com/database/121/UPGRD/afterup.htm#UPGRD60157
Thanks.

Classic ASP cannot connect to SQL database after TLS 1.0 removed from server

I have an IIS web application which connects to a SQL Server like this:
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("DRIVER={SQL Server};SERVER=servername;DATABASE=dbname;UID=username;PASSWORD=pwd)
Recently I started getting the following error:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SSL Security error
When I asked my server admin what this meant, he said that they had recently removed TLS 1.0 from the IIS server my web application is mounted on. He made sure the new SQL ODBC 13 drivers were installed on the web server, but it did not help.
Although the web app has never had a DSN before, we created one for it using the ODBC 13 driver. When I tried connecting like this:
objConn.Open "DSNname"
I got the following error:
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
I looked up ConnectionStrings.com to see if there were a way of specifying a different driver. I tried this:
objConn.Open("DRIVER={SQL Server Native Client 13.0};SERVER=servername;DATABASE=dbname;UID=username;PASSWORD=pwd)
And this is the error message that was produced:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Don't know what else to do. Any ideas?
We had to update 3 servers that are running several Classic ASP websites. The main reason was we need to implement Twillio API SMS messaging wich required TLS 1.0 and TLS 1.1 to be disabled/removed.
It took several days and we had the websites go up and down through the process.
I wrote a blog post to document the process for other team members. I hope it helps.
https://dhali.com/programming/tls-1-2-with-classic-asp/
Here are the outlined steps:
https://www.ssllabs.com/ssltest to get the current TLS Configuration
Using IISCrypto Tool we updated the Registry Files on the server
Ran https://www.ssllabs.com/ssltest to prove TLS 1.0 and 1.1 removed
Update ODBC to the latest ver supports TLS 1.2 [Microsoft® ODBC Driver 13.1 for SQL Server]
Update the connection string to use the current ODBC SQL 13 driver
The specified DSN contains an architecture mismatch between the Driver and Application
You can create either a 32bit DSN or a 64bit DSN. You need to create one matching the bitness of your program. Probably 32-bit.

TIBCO JDBC ERROR BW-JDBC-100034

I am trying to connect to my local MS SQL SERVER 2008 R2 using JDBC. I get the following error
BW-JDBC-100034 "Configuration Test Failed. Exception [java.sql.SQLException] occurred.
java.sql.SQLException: No suitable driver found
I have already verified the following
SQLJDBC.jar is in the path TIBCO_HOME\tpcl\5.8\jdbc & TIBCO_HOME\tpcl\5.8\LIB
The classpath tibco.env.STD_CP_EXT is set to the path TIBCO_HOME\JDBC in the designer.tra file.
Still I get the BW-JDBC-100034 error. Kindly advise
Could you please provide the jdbc driver you are using in this JDBC Connection activity? If you are using Microsoft driver you have to use the sqljdbc4.jar as you have already used. If you are using a tibco driver however, you need the TISql.jar which you can obtain by installing the product TIBCO-dbdrivers-2.0 from download.tibco.com.
Happy that you were able to fix the issue.

Migrating to SQL Server in TeamCity: A driver for the source database not found

I'm trying to move my TeamCity instance to SQL Server. I followed the instructions in the docs for Setting up an External Database.
Now I'm going through Migrating to an External Database and running the maintainDb command:
.\maintainDB.cmd migrate -A c:\users\jkodroff\.buildserver -T C:\Users\jkodroff\.BuildServer\config\database.properties
And I get this output:
Java executable is found: 'C:\Program Files\Java\jdk1.6.0_35\bin\java.exe'.
Using logs directory C:\TeamCity\logs
TeamCity maintenance tool. Copyright 2013 JetBrains s.r.o. All Rights Reserved.
Command line arguments: migrate -A c:\users\jkodroff\.buildserver -T C:\Users\jkodroff\.BuildServer\config\database.properties
Using TeamCity data directory: C:\Users\jkodroff\.BuildServer
Using database settings from the TeamCity data directory for source database: C:\Users\jkodroff\.BuildServer\config\database.properties
Using source database
database type: MSSQL
connection string: jdbc:jtds:sqlserver://localhost:1433/teamcity
Cannot proceed with 'migrate' command: A driver for the source database not found. Please ensure you have driver jars in C:\Users\jkodroff\.BuildServer\lib\jdbc.
Critical error has occurred during command execution.
I've verified that both sqljdbc.jar and sqljdbc4.jar are in the directory indicated, so what gives?
The fact that you have sqljdbc.jar and sqljdbc4.jar indicates that you are using the Microsoft SQL Server JDBC Driver, but the connection string is for the jTDS driver. Make sure you use the correct connection string for the Microsoft SQL Server JDBC or that you use the jTDS JDBC driver instead.
Second: you should use either sqljdbc.jar (which is for Java 5) or sqljdbc4.jar (which is for Java 6 and later), not both; loading both might lead to unexpected behavior due to classloading order etc!

Error Running Sonar connected to SQL Server 2005. SONAR.dbo.rules for column description

When I start Sonar (StartSonar.bat), I get the following error in the log file.
Wrong column type in SONAR.dbo.rules for column description.
Found: ntext, expected: nvarchar(max)
Looking at the column in SQL Server Management Studio it is nvarchar(max)
I'm running:
DB: SQL Server 2005
OS: Windows 7 64 bit
Sonar: 2.11
Tried these drivers:
sqljdbc-1.2.2828.100.jar
sqljdbc4.jar (Microsoft SQL Server JDBC Driver 2.0)
sqljdbc4.jar (Microsoft SQL Server JDBC Driver 3.0)
sqljdbc4.jar (Microsoft SQL Server JDBC Driver 4.0)
My MSSQL Properties:
sonar.jdbc.url: jdbc:sqlserver://localhost;databaseName=SONAR;
sonar.jdbc.driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
sonar.jdbc.validationQuery: select 1
sonar.jdbc.dialect: mssql
I'm using a user name and password (SQL Authentication) to connect the DB
Note to self: When trying to connect to MSSQL remember to Enable TCP/IP. This is found in the SQL Sever Configuration Manager;SQL Server 2005 Network Configuration;Protocols for MSSQLSERVER;TCP/IP
I thought it might be a driver issue, but I'm not sure
Anyone else seen this?
I wasn't able to solve this via the sqljdbc drivers so I took some advise from another post and fell back to the jTDS driver http://jtds.sourceforge.net/index.html
The post I used was Sonar MsSql Database Issue
My Setup:
Sonar 2.11 unzipped to C:\Sonar\sonar-2.11
The steps I made (paraphrased)
Download jTDS drivers from jTDS Drivers Unzip it somewhere, I suggest C:\jDST
Add the DLL to the system path. (C:\jDST\jtds-1.2.5-dist\x64\SSO)
Copy the jar file (C:\jDST\jtds-1.2.5-dist\jtds-1.2.5.jar) to the extensions folder
(C:\Sonar\sonar-2.11\extensions\jdbc-driver\mssql)
Update the sonar.properties
sonar.jdbc.url: jdbc:jtds:sqlserver://localhost:1433/SONAR
sonar.jdbc.driverClassName: net.sourceforge.jtds.jdbc.Driver
sonar.jdbc.validationQuery: select 1
sonar.jdbc.dialect: mssql
Note: in case you connect to the named instance, this must be specified explicitly in the connection URL: jdbc:jtds:sqlserver://localhost/SONAR;instance=SQLEXPRESS
Run the bat file StartSonar.bat (C:\Sonar\sonar-2.11\bin\windows-x86-64\StartSonar.bat)
Check your logs and go to the site http:// localhost:9000

Resources