Develop a Java application that interacts with a Cassandra database to store and retrieve user information such as username, email, and date of birth. The application should provide methods for adding new users, updating existing user information, and searching for users by username or email address.
PLAINFORMAT
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;

public class UserRepository {

    private Cluster cluster;
    private Session session;

    public UserRepository(String contactPoint, String keyspace) {
        connect(contactPoint, keyspace);
    }

    private void connect(String contactPoint, String keyspace) {
        cluster = Cluster.builder().addContactPoint(contactPoint).build();
        session = cluster.connect(keyspace);
    }

    public void close() {
        session.close();
        cluster.close();
    }

    public void addUser(String username, String email, String dateOfBirth) {
        String query = "INSERT INTO users (username, email, date_of_birth) VALUES ('" + username + "', '" + email + "', '" + dateOfBirth + "')";
        session.execute(query);
    }

    public void updateUser(String username, String newEmail, String newDateOfBirth) {
        String query = "UPDATE users SET email = '" + newEmail + "', date_of_birth = '" + newDateOfBirth + "' WHERE username = '" + username + "'";
        session.execute(query);
    }

    public Row findUserByUsername(String username) {
        String query = "SELECT * FROM users WHERE username = '" + username + "'";
        ResultSet resultSet = session.execute(query);
        return resultSet.one();
    }

    public Row findUserByEmail(String email) {
        String query = "SELECT * FROM users WHERE email = '" + email + "'";
        ResultSet resultSet = session.execute(query);
        return resultSet.one();
    }
}

public class Main {

    public static void main(String[] args) {
        UserRepository userRepository = new UserRepository("127.0.0.1", "user_keyspace");

        // Add a new user
        userRepository.addUser("john_doe", "john.doe@example.com", "1990-01-01");

        // Update an existing user
        userRepository.updateUser("john_doe", "john.doe_updated@example.com", "1990-02-02");

        // Find a user by username
        Row userByUsername = userRepository.findUserByUsername("john_doe");
        System.out.println("Found user by username: " + userByUsername);

        // Find a user by email
        Row userByEmail = userRepository.findUserByEmail("john.doe_updated@example.com");
        System.out.println("Found user by email: " + userByEmail);

        userRepository.close();
    }
}