diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2021-12-17 10:07:10 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-02-02 20:02:54 +0000 |
commit | bf5f5f91ed7a6489fda3f6d4ee163ad94aaedcb6 (patch) | |
tree | bd3e7958534488ce2e8d02edb717fae8fb063402 /server/sonar-webserver-core/src | |
parent | da25d9b1d4a2459bb201dd9b6e8166bd55149c57 (diff) | |
download | sonarqube-bf5f5f91ed7a6489fda3f6d4ee163ad94aaedcb6.tar.gz sonarqube-bf5f5f91ed7a6489fda3f6d4ee163ad94aaedcb6.zip |
SONAR-15845 Upgrade H2 database dependency to 2.X
Diffstat (limited to 'server/sonar-webserver-core/src')
2 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabase.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabase.java index 72cb2b2aa33..a31e30d8493 100644 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabase.java +++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabase.java @@ -41,6 +41,7 @@ import static org.sonar.process.ProcessProperties.Property.JDBC_USERNAME; import static org.sonar.process.ProcessProperties.Property.PATH_DATA; public class EmbeddedDatabase implements Startable { + private static final String IGNORED_KEYWORDS_OPTION = ";NON_KEYWORDS=VALUE"; private static final Logger LOG = Loggers.get(EmbeddedDatabase.class); private final Configuration config; @@ -108,7 +109,7 @@ public class EmbeddedDatabase implements Startable { } private static void createDatabase(File dbHome, String user, String password) throws SQLException { - String url = format("jdbc:h2:%s/sonar;USER=%s;PASSWORD=%s", dbHome.getAbsolutePath(), user, password); + String url = format("jdbc:h2:%s/sonar;USER=%s;PASSWORD=%s%s", dbHome.getAbsolutePath(), user, password, IGNORED_KEYWORDS_OPTION); DriverManager.registerDriver(new Driver()); DriverManager.getConnection(url).close(); diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseTest.java index 0f4c2ea891a..0a8faedca7f 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseTest.java @@ -151,7 +151,7 @@ public class EmbeddedDatabaseTest { private void checkDbIsUp(int port, String user, String password) { try { - String driverUrl = String.format("jdbc:h2:tcp://%s:%d/sonar;USER=%s;PASSWORD=%s", LOOPBACK_ADDRESS, port, user, password); + String driverUrl = String.format("jdbc:h2:tcp://%s:%d/sonar;USER=%s;PASSWORD=%s;NON_KEYWORDS=VALUE", LOOPBACK_ADDRESS, port, user, password); DriverManager.registerDriver(new Driver()); DriverManager.getConnection(driverUrl).close(); } catch (Exception ex) { |