From 5fc8321a4d5491af058e27173bdcf9755f8367bf Mon Sep 17 00:00:00 2001
From: Daniel <daniel@harvey>
Date: Mon, 12 Aug 2019 11:26:44 +0200
Subject: [PATCH] MAINT: Undoing MYSQL > SQL change.

---
 README_SETUP.md                                  |  8 ++++----
 conf/core/server.conf                            | 12 ++++++------
 .../java/caosdb/server/ServerProperties.java     | 12 ++++++------
 .../MySQL/DatabaseConnectionPool.java            | 16 ++++++++--------
 .../java/caosdb/server/utils/ServerMessages.java |  2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/README_SETUP.md b/README_SETUP.md
index 4eef031f..a48faf2b 100644
--- a/README_SETUP.md
+++ b/README_SETUP.md
@@ -69,10 +69,10 @@ server:
    - You can check the content of the certificate with `openssl x509 -in cert.pem -text`
 3. Copy `conf/core/server.conf` to `conf/ext/server.conf` and change it
    appropriately:
-    * Setup for SQL back end: Assuming that the SQL back end is installed
-      (see the `README_SETUP.md` of the `caosdb-sqlbackend` repository),
-      specify the fields `SQL_USER_NAME`, `SQL_USER_PASSWORD`,
-      `SQL_DATABASE_NAME`, and `SQL_HOST`.
+    * Setup for MySQL back-end: Assuming that the mysql back-end is installed
+      (see the `README_SETUP.md` of the `caosdb-mysqlbackend` repository),
+      specify the fields `MYSQL_USER_NAME`, `MYSQL_USER_PASSWORD`,
+      `MYSQL_DATABASE_NAME`, and `MYSQL_HOST`.
     * Choose the ports under which CaosDB will be accessible.
     * Setup the SSL certificate: Assuming that there is an appropriate `Java Key
       Store` file (see above), change the fields `CERTIFICATES_KEY_PASSWORD`,
diff --git a/conf/core/server.conf b/conf/core/server.conf
index a805c73a..686cf100 100644
--- a/conf/core/server.conf
+++ b/conf/core/server.conf
@@ -11,13 +11,13 @@ USER_SOURCES_INI_FILE=./conf/ext/usersources.ini
 NEW_USER_DEFAULT_ACTIVITY=INACTIVE
 AUTH_OPTIONAL=FALSE
 
-SQL_HOST=localhost
-SQL_PORT=3306
-SQL_DATABASE_NAME=caosdb
-SQL_USER_NAME=caosdb
-SQL_USER_PASSWORD=caosdb
+MYSQL_HOST=localhost
+MYSQL_PORT=3306
+MYSQL_DATABASE_NAME=caosdb
+MYSQL_USER_NAME=caosdb
+MYSQL_USER_PASSWORD=caosdb
 
-SQL_SCHEMA_VERSION=v2.1.1
+MYSQL_SCHEMA_VERSION=v2.1.1
 
 CONTEXT_ROOT=
 
diff --git a/src/main/java/caosdb/server/ServerProperties.java b/src/main/java/caosdb/server/ServerProperties.java
index 37541e3b..10ede003 100644
--- a/src/main/java/caosdb/server/ServerProperties.java
+++ b/src/main/java/caosdb/server/ServerProperties.java
@@ -46,12 +46,12 @@ public class ServerProperties extends Properties {
   public static final String KEY_CHOWN_SCRIPT = "CHOWN_SCRIPT";
   public static final String KEY_AUTH_OPTIONAL = "AUTH_OPTIONAL";
 
-  public static final String KEY_SQL_HOST = "SQL_HOST";
-  public static final String KEY_SQL_PORT = "SQL_PORT";
-  public static final String KEY_SQL_DATABASE_NAME = "SQL_DATABASE_NAME";
-  public static final String KEY_SQL_USER_NAME = "SQL_USER_NAME";
-  public static final String KEY_SQL_USER_PASSWORD = "SQL_USER_PASSWORD";
-  public static final String KEY_SQL_SCHEMA_VERSION = "SQL_SCHEMA_VERSION";
+  public static final String KEY_MYSQL_HOST = "MYSQL_HOST";
+  public static final String KEY_MYSQL_PORT = "MYSQL_PORT";
+  public static final String KEY_MYSQL_DATABASE_NAME = "MYSQL_DATABASE_NAME";
+  public static final String KEY_MYSQL_USER_NAME = "MYSQL_USER_NAME";
+  public static final String KEY_MYSQL_USER_PASSWORD = "MYSQL_USER_PASSWORD";
+  public static final String KEY_MYSQL_SCHEMA_VERSION = "MYSQL_SCHEMA_VERSION";
 
   public static final String KEY_BASE_PATH = "BASE_PATH";
   public static final String KEY_FILE_POLICY = "FILE_POLICY";
diff --git a/src/main/java/caosdb/server/database/backend/implementation/MySQL/DatabaseConnectionPool.java b/src/main/java/caosdb/server/database/backend/implementation/MySQL/DatabaseConnectionPool.java
index c8d92684..9700daf3 100644
--- a/src/main/java/caosdb/server/database/backend/implementation/MySQL/DatabaseConnectionPool.java
+++ b/src/main/java/caosdb/server/database/backend/implementation/MySQL/DatabaseConnectionPool.java
@@ -80,19 +80,19 @@ class DatabaseConnectionPool {
 
     final String url =
         "jdbc:mysql://"
-            + CaosDBServer.getServerProperty(ServerProperties.KEY_SQL_HOST)
+            + CaosDBServer.getServerProperty(ServerProperties.KEY_MYSQL_HOST)
             + ":"
-            + CaosDBServer.getServerProperty(ServerProperties.KEY_SQL_PORT)
+            + CaosDBServer.getServerProperty(ServerProperties.KEY_MYSQL_PORT)
             + "/"
-            + CaosDBServer.getServerProperty(ServerProperties.KEY_SQL_DATABASE_NAME)
+            + CaosDBServer.getServerProperty(ServerProperties.KEY_MYSQL_DATABASE_NAME)
             + "?noAccessToProcedureBodies=true&cacheCallableStmts=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&connectionCollation=utf8_unicode_ci&characterSetResults=utf8&serverTimezone=CET";
     // + "?profileSQL=true&characterSetResults=utf8";
-    final String user = CaosDBServer.getServerProperty(ServerProperties.KEY_SQL_USER_NAME);
-    final String pwd = CaosDBServer.getServerProperty(ServerProperties.KEY_SQL_USER_PASSWORD);
+    final String user = CaosDBServer.getServerProperty(ServerProperties.KEY_MYSQL_USER_NAME);
+    final String pwd = CaosDBServer.getServerProperty(ServerProperties.KEY_MYSQL_USER_PASSWORD);
     final ConnectionPool pool = new ConnectionPool("MySQL Pool", 2, 5, 0, 0, url, user, pwd);
     pool.removeShutdownHook();
     CaosDBServer.addPostShutdownHook(
-        new Thread("SHUTDOWN_SQL_CONNECTION_POOL") {
+        new Thread("SHUTDOWN_MYSQL_CONNECTION_POOL") {
           @Override
           public void run() {
             try {
@@ -185,7 +185,7 @@ class DatabaseConnectionPool {
         final ResultSet executeQuery = prepareStatement.executeQuery();
         if (executeQuery.next()) {
           final String v_e =
-              CaosDBServer.getServerProperty(ServerProperties.KEY_SQL_SCHEMA_VERSION)
+              CaosDBServer.getServerProperty(ServerProperties.KEY_MYSQL_SCHEMA_VERSION)
                   .toLowerCase();
           final String v_a = executeQuery.getString(1).toLowerCase();
           if (!Objects.equal(v_a, v_e)) {
@@ -203,7 +203,7 @@ class DatabaseConnectionPool {
 
       // set auto_increment on table entities to the maximum entity_id of
       // table transaction_log;
-      // Why? SQL seems to reset the
+      // Why? MYSQL seems to reset the
       // auto_increment value each time the MySQL server is being
       // restarted to the maximum of ids in the entities table. But if
       // some of the ids had been used yet, we don't want to use them
diff --git a/src/main/java/caosdb/server/utils/ServerMessages.java b/src/main/java/caosdb/server/utils/ServerMessages.java
index 8f25fe60..12496218 100644
--- a/src/main/java/caosdb/server/utils/ServerMessages.java
+++ b/src/main/java/caosdb/server/utils/ServerMessages.java
@@ -144,7 +144,7 @@ public class ServerMessages {
   public static final Message REQUEST_BODY_EMPTY =
       new Message(MessageType.Error, 0, "Request body was empty.");
 
-  public static final Message SQL_PROCEDURE_EXCEPTION =
+  public static final Message MYSQL_PROCEDURE_EXCEPTION =
       new Message(
           MessageType.Error,
           0,
-- 
GitLab