I want to send data collected by a sensor to a web server created by me with Java.

For example, I want to send a simple integer, `1` for example when the temperature of a sensor exceeds a threshold as the first test, but I can not know how. I managed to do otherwise, I mean make Arduino as a server, and from the browser by typing the IP address that I assigned to the board, to see those results, but what really interests me is to send the data instead of seeing them. How do I do that? What would a small example be? 

I've tried the EthernetClient class, but I can not do what I want: (