Infosys interview question

how do you establish connction with Database in java