My own bitcoin miner
The mining protocol between miner and pool is called Stratum.

See https://en.bitcoin.it/wiki/Stratum_mining_protocol

How to open a TCP connection and send/receive data using Java; there should be plenty of resources you can find on that.