This blog post gives a introduction to JDBC and describes the steps involved in the connection.