How do I connect my local java application to cassandra running in a container on a server

I want to connect to cassandra running on server in a container. Can anyone please give a simple code for that.

Source: StackOverflow