diff --git a/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java b/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java index dc900ba82..1faa1cef8 100644 --- a/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java +++ b/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java @@ -450,7 +450,11 @@ public class DatabaseImportController implements ImportingController { jdbcConfig.setConnectionName(request.getParameter("connectionName")); jdbcConfig.setDatabaseType(request.getParameter("databaseType")); jdbcConfig.setDatabaseHost(request.getParameter("databaseServer")); - jdbcConfig.setDatabasePort(Integer.parseInt(request.getParameter("databasePort"))); + try { + jdbcConfig.setDatabasePort(Integer.parseInt(request.getParameter("databasePort"))); + } catch(NumberFormatException nfE) { + logger.error("getQueryInfo :: invalid database port ::{}", nfE); + } jdbcConfig.setDatabaseUser(request.getParameter("databaseUser")); jdbcConfig.setDatabasePassword(request.getParameter("databasePassword")); jdbcConfig.setDatabaseName(request.getParameter("initialDatabase")); @@ -462,7 +466,7 @@ public class DatabaseImportController implements ImportingController { } if (jdbcConfig.getDatabaseHost() == null || jdbcConfig.getDatabaseName() == null || jdbcConfig.getDatabasePassword() == null || jdbcConfig.getDatabaseType() == null - || jdbcConfig.getDatabaseUser() == null || query == null) { + || jdbcConfig.getDatabaseUser() == null || query == null || jdbcConfig.getDatabasePort() == 0) { if(logger.isDebugEnabled()) { logger.debug("Missing Database Configuration::{}", jdbcConfig); }