public void registrar(ProxyClient cliente, String password){
        String id="";
        
        //BufferedImage image = (BufferedImage)((Image) cliente.icon.getImage());
        Image source = cliente.icon.getImage();
        int w = source.getWidth(null);
        int h = source.getHeight(null);
        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2d = (Graphics2D)image.getGraphics();
        g2d.drawImage(source, 0, 0, null);
        g2d.dispose();
        
        //TODO: MACBOOK
        
        String url = "/Users/eduardoirias/Sites/RMI-Files/users/" + cliente.user+".png";
        
        try {
            ImageIO.write(image, "png",new File(url));
        } catch (IOException ex) {
            Logger.getLogger(MensajeImpl.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Comenzando");
        try {
            Class.forName("com.mysql.jdbc.Driver");
            // Setup the connection with the DB
            connect = DriverManager
                    .getConnection("jdbc:mysql://localhost:8889/so2?"
                    + "user=root&password=root");
             System.out.println("Insertando");
             System.out.println("Nombre: "+ cliente.lastName);
             System.out.println("user: "+ cliente.user);
             String url2 = "http://macbook-air-de-eduardo.local:8888/RMI-Files/users/" + cliente.user+".png";

            // Result set get the result of the SQL query
            preparedStatement = connect.prepareStatement("INSERT INTO so2.usuario (nombre,apellido,correo,user,password,photo) VALUE ('"+cliente.name+"','"
                    + cliente.lastName+"','"+cliente.email+"','"+cliente.user+"','"+password+"','"+url2+"')");
            
            preparedStatement.executeUpdate();
            
        }catch (Exception e) {
            try {
                throw e;
            } catch (Exception ex) {
                Logger.getLogger(MensajeImpl.class.getName()).log(Level.SEVERE, null, ex);
            }
        } finally {
            close();
        }
        try {
            // This will load the MySQL driver, each DB has its own driver
            Class.forName("com.mysql.jdbc.Driver");
            // Setup the connection with the DB
            connect = DriverManager
                    .getConnection("jdbc:mysql://localhost:8889/so2?"
                    + "user=root&password=root");

            System.out.println("CONECTADO!");
            
            // Statements allow to issue SQL queries to the database
            statement = connect.createStatement();
            // Result set get the result of the SQL query
            resultSet = statement.executeQuery("SELECT * FROM so2.usuario WHERE user = '" + cliente.user+"'");
            
            while (resultSet.next()) {
            // It is possible to get the columns via name
            // also possible to get the columns via the column number
            // which starts at 1
            // e.g. resultSet.getSTring(2);
            id = resultSet.getString("id");
            
            
            //doTest();
            
            
        }

        } catch (Exception e) {
            try {
                throw e;
            } catch (Exception ex) {
                Logger.getLogger(MensajeImpl.class.getName()).log(Level.SEVERE, null, ex);
            }
        } finally {
            close();
        }
        try {
            Class.forName("com.mysql.jdbc.Driver");
            // Setup the connection with the DB
            connect = DriverManager
                    .getConnection("jdbc:mysql://localhost:8889/so2?"
                    + "user=root&password=root");
             System.out.println("Insertando");
             System.out.println("Nombre: "+ cliente.name);
             System.out.println("user: "+ cliente.user);
            // Result set get the result of the SQL query
            preparedStatement = connect.prepareStatement("INSERT INTO so2.usuarioperteneceaconversacion (idusuario,idconversacion) VALUE ('"+id+"','1')");
            
            preparedStatement.executeUpdate();
            
        }catch (Exception e) {
            try {
                throw e;
            } catch (Exception ex) {
                Logger.getLogger(MensajeImpl.class.getName()).log(Level.SEVERE, null, ex);
            }
        } finally {
            close();
        }
        
    }