public String getActualLogin(String login) {
        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet rs = null;

        try {
            connection = getConnection();
            statement = connection.prepareStatement(userQuery);
            
            int paramCount = userQuery.length() - userQuery.replaceAll("\\?", "").length();
            for (int i = 1; i <= paramCount; i++) {
                statement.setString(i, login);
            }

            rs = statement.executeQuery();

            if (rs.next()) {
                String dbUsername = rs.getString(1);
                return dbUsername;
            }
        } catch (Exception ex) {
            _logger.log(Level.SEVERE, "jdbcrealm.invaliduser", login);
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "Cannot validate user", ex);
            }
        } finally {
            close(connection, statement, rs);
        }
        return null;
    }