use of org.eclipse.datatools.connectivity.IConnection in project jbosstools-hibernate by jbosstools.
the class ConsoleConfigurationUtils method isConnectionExist.
public static boolean isConnectionExist(ConsoleConfiguration consoleConfig) {
String connProfileName = consoleConfig.getPreferences().getConnectionProfileName();
IConnectionProfile profile = ProfileManager.getInstance().getProfileByName(connProfileName);
IConnection conn = PingJob.createTestConnection(profile);
if (conn.getConnectException() != null) {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Establishing connection to database error", conn.getConnectException().getLocalizedMessage());
return false;
}
return true;
}
Aggregations