Allow for flexible specification of JDBC driver 54/129654/1
authorjhh <jorge.hernandez-herrero@att.com>
Mon, 20 Jun 2022 19:34:03 +0000 (14:34 -0500)
committerjhh <jorge.hernandez-herrero@att.com>
Mon, 20 Jun 2022 19:34:03 +0000 (14:34 -0500)
Issue-ID: POLICY-4177
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: If33934f79dbe41200e57816781089c63f05b8d67

feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties
packages/install/src/files/base.conf
policy-management/src/main/server-gen/bin/db-migrator

index 30a0421..89fc6a3 100644 (file)
@@ -1,8 +1,8 @@
 ###
 # ============LICENSE_START=======================================================
- # feature-distributed-locking
+ # ONAP
 # ================================================================================
-# Copyright (C) 2018-2019, 2021 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018-2019, 2021-2022 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 #Database properties
 eclipselink.target-database=MySQL
 javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
-javax.persistence.jdbc.url=jdbc:mariadb://${envd:SQL_HOST}:${envd:SQL_PORT:3306}/pooling
+javax.persistence.jdbc.url=${envd:JDBC_URL}pooling${envd:JDBC_OPTS}
 javax.persistence.jdbc.user=${envd:SQL_USER}
 javax.persistence.jdbc.password=${envd:SQL_PASSWORD}
 
index aac2125..86eb934 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START=======================================================
 # ONAP
 # ================================================================================
-# Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2022 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright (C) 2020 Bell Canada.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,11 +69,21 @@ REPOSITORY_OFFLINE=
 
 # Relational (SQL) DB access
 
+# override the mysql tool command in tooling with custom parameters
+MYSQL_CMD=mysql
+
+# mandatory parameters for the DB server location
 SQL_HOST=
 SQL_USER=
 SQL_PASSWORD=
 SQL_PORT=3306
 
+# override the JDBC urls to support customizations
+JDBC_URL=
+
+# add optional JDBC options for the connector to use
+JDBC_OPTS=
+
 # AAF
 
 AAF=false
index b4602ea..64d0fcf 100644 (file)
@@ -3,7 +3,7 @@
 # ============LICENSE_START=======================================================
 # ONAP
 # ================================================================================
-# Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2022 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -530,7 +530,12 @@ if [ -z "${SQL_PORT}" ]; then
     export SQL_PORT=3306
 fi
 
-MYSQL="mysql -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST} -P ${SQL_PORT}"
+if [ -z "$MYSQL_CMD" ]; then
+    MYSQL_CMD="mysql"
+fi
+
+MYSQL="${MYSQL_CMD} -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST} -P ${SQL_PORT}"
+
 if ! ${MYSQL} --execute "show databases;" > /dev/null 2>&1; then
     echo "error: No DB connectivity to ${SQL_HOST} for ${SQL_USER}"
     exit 5