/** * Specifying a custom username and password doesn't make sense * with a single Connection. Returns the single Connection if given * the same username and password; throws a SQLException else. */ @Override public Connection getConnection(String username, String password) throws SQLException { if (ObjectUtils.nullSafeEquals(username, getUsername()) && ObjectUtils.nullSafeEquals(password, getPassword())) { return getConnection(); } else { throw new SQLException("SingleConnectionDataSource does not support custom username and password"); } }
/** * Specifying a custom username and password doesn't make sense * with a single Connection. Returns the single Connection if given * the same username and password; throws a SQLException else. */ @Override public Connection getConnection(String username, String password) throws SQLException { if (ObjectUtils.nullSafeEquals(username, getUsername()) && ObjectUtils.nullSafeEquals(password, getPassword())) { return getConnection(); } else { throw new SQLException("SingleConnectionDataSource does not support custom username and password"); } }
/** * Specifying a custom username and password doesn't make sense * with a single Connection. Returns the single Connection if given * the same username and password; throws a SQLException else. */ @Override public Connection getConnection(String username, String password) throws SQLException { if (ObjectUtils.nullSafeEquals(username, getUsername()) && ObjectUtils.nullSafeEquals(password, getPassword())) { return getConnection(); } else { throw new SQLException("SingleConnectionDataSource does not support custom username and password"); } }
sendWebSocketMessage(WorkbenchWebSocketController.WorkbenchWebSocketCommand.GET_CONNECTION, queryIndex, queryEditorId, workbenchId, webSocketId); connection = singleConnectionDataSource.getConnection();