use of org.apache.cayenne.modeler.ClassLoadingService in project cayenne by apache.
the class DataSourceWizard method okAction.
/**
* Tests that the entered information is valid and can be used to open a
* conneciton. Does not store the open connection.
*/
public void okAction() {
DBConnectionInfo info = getConnectionInfo();
ClassLoadingService classLoader = getApplication().getClassLoadingService();
// doing connection testing...
try {
this.adapter = info.makeAdapter(classLoader);
this.dataSource = info.makeDataSource(classLoader);
try (Connection connection = dataSource.getConnection()) {
} catch (SQLException ignore) {
}
} catch (Throwable th) {
reportError("Connection Error", th);
return;
}
onClose(false);
}
Aggregations