@Override public String testConnection(IDatabaseConnection connection) { try { connection.setPassword( ConnectionServiceHelper.getConnectionPassword( connection.getName(), connection.getPassword())); return super.testConnection(connection); } catch (ConnectionServiceException e) { return super.testConnection(connection); } }
public static String getConnectionPassword(String connectionName, String password) throws ConnectionServiceException { try { IDatabaseConnection datasource = datasourceMgmtSvc.getDatasourceByName(connectionName); if (datasource != null && !hasPasswordChanged(password)) { return datasource.getPassword(); } else { return password; } } catch (Exception e) { logger.error( Messages.getErrorString( "ConnectionServiceHelper.ERROR_0001_UNABLE_TO_GET_CONNECTION_PASSWORD", //$NON-NLS-1$ connectionName, e.getLocalizedMessage())); throw new ConnectionServiceException( Messages.getErrorString( "ConnectionServiceHelper.ERROR_0001_UNABLE_TO_GET_CONNECTION_PASSWORD", connectionName, e.getLocalizedMessage()), e); //$NON-NLS-1$ } }