diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebDataSourceUtils.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebDataSourceUtils.java index 1dfbcbe09be..fb306817eda 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebDataSourceUtils.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebDataSourceUtils.java @@ -330,7 +330,11 @@ public static void setConnectionConfiguration( } if (CommonUtils.isEmpty(config.getUrl())) { - dsConfig.setUrl(driver.getConnectionURL(dsConfig)); + try { + dsConfig.setUrl(driver.getConnectionURL(dsConfig)); + } catch (DBException e) { + throw new IllegalStateException("Error preparing connection URL", e); + } } // Save network handlers if (config.getNetworkHandlersConfig() != null) { diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebDatabaseDriverInfo.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebDatabaseDriverInfo.java index b5aa8a4745a..0a1c43e3e29 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebDatabaseDriverInfo.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/model/WebDatabaseDriverInfo.java @@ -21,6 +21,7 @@ import io.cloudbeaver.model.session.WebSession; import io.cloudbeaver.server.CBConstants; import org.jkiss.code.NotNull; +import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.DBConstants; import org.jkiss.dbeaver.model.connection.*; @@ -180,13 +181,17 @@ public Map getDefaultConnectionProperties() { @NotNull @Property public WebPropertyInfo[] getDriverProperties() throws DBWebException { - DBPConnectionConfiguration cfg = new DBPConnectionConfiguration(); - cfg.setUrl(CommonUtils.notEmpty(driver.getSampleURL())); - cfg.setHostName(CBConstants.HOST_LOCALHOST); - cfg.setHostPort(driver.getDefaultPort()); - cfg.setDatabaseName(driver.getDefaultDatabase()); - cfg.setUrl(driver.getConnectionURL(cfg)); - return WebServiceUtils.getDriverProperties(webSession, driver, null, cfg); + try { + DBPConnectionConfiguration cfg = new DBPConnectionConfiguration(); + cfg.setUrl(CommonUtils.notEmpty(driver.getSampleURL())); + cfg.setHostName(CBConstants.HOST_LOCALHOST); + cfg.setHostPort(driver.getDefaultPort()); + cfg.setDatabaseName(driver.getDefaultDatabase()); + cfg.setUrl(driver.getConnectionURL(cfg)); + return WebServiceUtils.getDriverProperties(webSession, driver, null, cfg); + } catch (DBException e) { + throw new DBWebException("Error obtaining driver properties", e); + } } @Property