Skip to content

Commit

Permalink
JBIDE-17704: Also handle scenario where driver cannot handle JDBC URL
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Sep 11, 2014
1 parent e99efc6 commit a08170c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public void validate(UIValidationContext context)
Driver driver = (Driver) driverClass.getValue().newInstance();
try (Connection connection = driver.connect(jdbcUrl.getValue(), properties))
{
if (connection == null)
throw new RuntimeException("Cannot connect to JDBC URL [" + jdbcUrl.getValue()
+ "] with driver [" + driverClass.getValue().getName() + "].");

context.addValidationInformation(verifyConnection, "Connection successful.");
}
finally
Expand Down

0 comments on commit a08170c

Please sign in to comment.