From 5b96198109e7c12e67c08d17c949d42ce7058a21 Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Thu, 15 Apr 2021 17:51:35 +0200 Subject: [PATCH] Added missing config parameters for sqltypes of IMAGE an PLAYER item types (#10524) Signed-off-by: Christoph Weitkamp Signed-off-by: John Marshall --- .../jdbc/internal/JdbcConfiguration.java | 36 +++++++++++-------- .../main/resources/OH-INF/config/config.xml | 8 +++++ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/bundles/org.openhab.persistence.jdbc/src/main/java/org/openhab/persistence/jdbc/internal/JdbcConfiguration.java b/bundles/org.openhab.persistence.jdbc/src/main/java/org/openhab/persistence/jdbc/internal/JdbcConfiguration.java index 52236ba3782da..2e6f878949027 100644 --- a/bundles/org.openhab.persistence.jdbc/src/main/java/org/openhab/persistence/jdbc/internal/JdbcConfiguration.java +++ b/bundles/org.openhab.persistence.jdbc/src/main/java/org/openhab/persistence/jdbc/internal/JdbcConfiguration.java @@ -294,20 +294,28 @@ private void testJDBCDriver(String driver) { String warn = "" + "\n\n\t!!!\n\tTo avoid this error, place an appropriate JDBC driver file for serviceName '{}' in addons directory.\n" + "\tCopy missing JDBC-Driver-jar to your openHab/addons Folder.\n\t!!!\n" + "\tDOWNLOAD: \n"; - if (serviceName.equals("derby")) { - warn += "\tDerby: version >= 10.11.1.1 from https://mvnrepository.com/artifact/org.apache.derby/derby\n"; - } else if (serviceName.equals("h2")) { - warn += "\tH2: version >= 1.4.189 from https://mvnrepository.com/artifact/com.h2database/h2\n"; - } else if (serviceName.equals("hsqldb")) { - warn += "\tHSQLDB: version >= 2.3.3 from https://mvnrepository.com/artifact/org.hsqldb/hsqldb\n"; - } else if (serviceName.equals("mariadb")) { - warn += "\tMariaDB: version >= 1.2.0 from https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client\n"; - } else if (serviceName.equals("mysql")) { - warn += "\tMySQL: version >= 5.1.36 from https://mvnrepository.com/artifact/mysql/mysql-connector-java\n"; - } else if (serviceName.equals("postgresql")) { - warn += "\tPostgreSQL:version >= 9.4.1208 from https://mvnrepository.com/artifact/org.postgresql/postgresql\n"; - } else if (serviceName.equals("sqlite")) { - warn += "\tSQLite: version >= 3.16.1 from https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc\n"; + switch (serviceName) { + case "derby": + warn += "\tDerby: version >= 10.11.1.1 from https://mvnrepository.com/artifact/org.apache.derby/derby\n"; + break; + case "h2": + warn += "\tH2: version >= 1.4.189 from https://mvnrepository.com/artifact/com.h2database/h2\n"; + break; + case "hsqldb": + warn += "\tHSQLDB: version >= 2.3.3 from https://mvnrepository.com/artifact/org.hsqldb/hsqldb\n"; + break; + case "mariadb": + warn += "\tMariaDB: version >= 1.2.0 from https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client\n"; + break; + case "mysql": + warn += "\tMySQL: version >= 5.1.36 from https://mvnrepository.com/artifact/mysql/mysql-connector-java\n"; + break; + case "postgresql": + warn += "\tPostgreSQL:version >= 9.4.1208 from https://mvnrepository.com/artifact/org.postgresql/postgresql\n"; + break; + case "sqlite": + warn += "\tSQLite: version >= 3.16.1 from https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc\n"; + break; } logger.warn(warn, serviceName); } diff --git a/bundles/org.openhab.persistence.jdbc/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.persistence.jdbc/src/main/resources/OH-INF/config/config.xml index a277cff08c17c..fb0e06c762134 100644 --- a/bundles/org.openhab.persistence.jdbc/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.persistence.jdbc/src/main/resources/OH-INF/config/config.xml @@ -103,6 +103,10 @@ (optional, default: "TINYINT").]]> + + + (optional, default: "VARCHAR(65500)").]]> + (optional, default: "VARCHAR(30)").]]> @@ -111,6 +115,10 @@ (optional, default: "DOUBLE").]]> + + + (optional, default: "VARCHAR(20)").]]> + (optional, default: "TINYINT").]]>