aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core/src
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2021-12-17 10:07:10 +0100
committersonartech <sonartech@sonarsource.com>2022-02-02 20:02:54 +0000
commitbf5f5f91ed7a6489fda3f6d4ee163ad94aaedcb6 (patch)
treebd3e7958534488ce2e8d02edb717fae8fb063402 /server/sonar-webserver-core/src
parentda25d9b1d4a2459bb201dd9b6e8166bd55149c57 (diff)
downloadsonarqube-bf5f5f91ed7a6489fda3f6d4ee163ad94aaedcb6.tar.gz
sonarqube-bf5f5f91ed7a6489fda3f6d4ee163ad94aaedcb6.zip
SONAR-15845 Upgrade H2 database dependency to 2.X
Diffstat (limited to 'server/sonar-webserver-core/src')
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabase.java3
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseTest.java2
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) {