HCLTech interview question

How to connect Java application to a Database