diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-03-17 16:54:54 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-09-17 14:54:23 +0200 |
commit | 530478f620406f535bd3055f88fab4edaa7da1c5 (patch) | |
tree | 3da0d8b7f6edf23bd926dcf6388606e55a1c7a6d /sonar-application/src | |
parent | f539acd2e2813f514fcb7fee08056f7fd8021bf5 (diff) | |
download | sonarqube-530478f620406f535bd3055f88fab4edaa7da1c5.tar.gz sonarqube-530478f620406f535bd3055f88fab4edaa7da1c5.zip |
SONAR-6552 Replace jTDS by Microsoft JDBC driver 4.1
Diffstat (limited to 'sonar-application/src')
4 files changed, 6 insertions, 7 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index c4ac178e12b..e9626756fff 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -43,9 +43,8 @@ #----- Microsoft SQLServer 2008/2012 -# Only the bundled jTDS driver is supported. # Collation must be case-sensitive (CS) and accent-sensitive (AS). -#sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/sonar;SelectMethod=Cursor +#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar #----- Connection pool settings diff --git a/sonar-application/src/main/assembly/lib/jdbc/mssql/sqljdbc41.jar b/sonar-application/src/main/assembly/lib/jdbc/mssql/sqljdbc41.jar Binary files differnew file mode 100644 index 00000000000..5cb586c83cd --- /dev/null +++ b/sonar-application/src/main/assembly/lib/jdbc/mssql/sqljdbc41.jar diff --git a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java index 7794cb745b1..54fc71545b8 100644 --- a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java +++ b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java @@ -34,7 +34,7 @@ import org.sonar.process.Props; public class JdbcSettings { enum Provider { - H2("lib/jdbc/h2"), JTDS("lib/jdbc/jtds"), MYSQL("lib/jdbc/mysql"), ORACLE("extensions/jdbc-driver/oracle"), + H2("lib/jdbc/h2"), SQLSERVER("lib/jdbc/mssql"), MYSQL("lib/jdbc/mysql"), ORACLE("extensions/jdbc-driver/oracle"), POSTGRESQL("lib/jdbc/postgresql"); final String path; diff --git a/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java b/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java index 9e809a2aeab..eb418f9f405 100644 --- a/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java +++ b/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java @@ -46,10 +46,10 @@ public class JdbcSettingsTest { assertThat(settings.driverProvider("jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance")) .isEqualTo(JdbcSettings.Provider.MYSQL); try { - settings.driverProvider("jdbc:sqlserver://localhost"); + settings.driverProvider("jdbc:microsoft:sqlserver://localhost"); fail(); } catch (MessageException e) { - assertThat(e).hasMessage("Unsupported JDBC driver provider: sqlserver"); + assertThat(e).hasMessage("Unsupported JDBC driver provider: microsoft"); } try { settings.driverProvider("oracle:thin:@localhost/XE"); @@ -118,11 +118,11 @@ public class JdbcSettingsTest { @Test public void check_mssql() throws Exception { File home = temp.newFolder(); - File driverFile = new File(home, "lib/jdbc/jtds/jtds.jar"); + File driverFile = new File(home, "lib/jdbc/mssql/sqljdbc4.jar"); FileUtils.touch(driverFile); Props props = new Props(new Properties()); - props.set("sonar.jdbc.url", "jdbc:jtds:sqlserver://localhost/sonar;SelectMethod=Cursor"); + props.set("sonar.jdbc.url", "jdbc:sqlserver://localhost/sonar;SelectMethod=Cursor"); settings.checkAndComplete(home, props); assertThat(props.nonNullValueAsFile(ProcessProperties.JDBC_DRIVER_PATH)).isEqualTo(driverFile); } |