Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

[ JDBC Persistence] extend parsing jdbc url #3992

Closed
lewie opened this issue Feb 7, 2016 · 4 comments
Closed

[ JDBC Persistence] extend parsing jdbc url #3992

lewie opened this issue Feb 7, 2016 · 4 comments

Comments

@lewie
Copy link
Contributor

lewie commented Feb 7, 2016

@watou,
a little fix for parsing given URL Strings with space char.
from: https://community.openhab.org/t/jdbc-persistence-with-sqlite-not-working-in-openhab-1-8-0/6929/4

diff --git a/bundles/persistence/org.openhab.persistence.jdbc/java/org/openhab/persistence/jdbc/utils/StringUtilsExt.java b/bundles/persistence/org.openhab.persistence.jdbc/java/org/openhab/persistence/jdbc/utils/StringUtilsExt.java
index d524c83..6a06a3a 100644
--- a/bundles/persistence/org.openhab.persistence.jdbc/java/org/openhab/persistence/jdbc/utils/StringUtilsExt.java
+++ b/bundles/persistence/org.openhab.persistence.jdbc/java/org/openhab/persistence/jdbc/utils/StringUtilsExt.java
@@ -126,10 +126,10 @@

         URI dbURI = null;
         try {
-            dbURI = new URI(stringAfterSubstr(url, ":", 1));
+            dbURI = new URI(stringAfterSubstr(url, ":", 1).replaceFirst(" ", ""));
             if (dbURI.getScheme() != null) {
                 props.put("scheme", dbURI.getScheme());
-                dbURI = new URI(stringAfterSubstr(url, ":", 2));
+                dbURI = new URI(stringAfterSubstr(url, ":", 2).replaceFirst(" ", ""));
             }
         } catch (URISyntaxException e) {
             logger.error("parseJdbcURL: URI '{}' is not well formated URISyntaxException: {}", url, e);

@watou
Copy link
Contributor

watou commented Feb 7, 2016

Thank you, @lewie!

@watou
Copy link
Contributor

watou commented Feb 8, 2016

Hi @lewie, please double check that #3998 is what you intended and works! 😄 Thanks a lot.

@lewie
Copy link
Contributor Author

lewie commented Feb 9, 2016

Hi @watou,
Is what I intended it works as expected!

Thank You!

teichsta pushed a commit that referenced this issue Feb 9, 2016
ivanfmartinez pushed a commit to ivanfmartinez/openhab that referenced this issue Feb 12, 2016
ivanfmartinez pushed a commit to ivanfmartinez/openhab that referenced this issue Feb 12, 2016
ivanfmartinez pushed a commit to ivanfmartinez/openhab that referenced this issue Feb 12, 2016
ivanfmartinez pushed a commit to ivanfmartinez/openhab that referenced this issue Feb 12, 2016
ivanfmartinez pushed a commit to ivanfmartinez/openhab that referenced this issue Feb 20, 2016
ivanfmartinez pushed a commit to ivanfmartinez/openhab that referenced this issue Feb 21, 2016
@lewie
Copy link
Contributor Author

lewie commented Mar 22, 2016

Done!

@lewie lewie closed this as completed Mar 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants