Jdbc steps to connect to database are explained in this tutorial.
Read this post on computersciencejunction.in