Skip to content
Snippets Groups Projects
Commit 5fc8321a authored by Daniel's avatar Daniel
Browse files

MAINT: Undoing MYSQL > SQL change.

parent dc6c127b
No related branches found
No related tags found
No related merge requests found
......@@ -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`,
......
......@@ -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=
......
......@@ -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";
......
......@@ -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
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment