"The data needs to be an int"... that isn't quite right. A socket knows nothing about
Java, all it knows about is bytes being transmitted. So to send a HashMap over a socket connection you need to serialize it into a series of bytes, and send those bytes. The most straightforward way to do that is to use the serialization which is built into Java and use ObjectOutputStream to send the object and ObjectInputStream to receive it. There are other ways to serialize Java objects but now that you are looking in the right direction you can search for those if you like.
(As for infelicitous posting decisions, your post didn't look like anything to do with
JDBC so I moved it to our Sockets forum. I will edit your title to something which I think is better, but if you don't think it's better then post again with your idea.)