Learning what a wizard does before actually using the wizard to perform work for you is the best approach. Java has a ton of different tools/wizards out there that simplify your life by hiding database access from you.
This Maven project just uses the basics to establish a database connection and then access the database in a simple, yet clean way.
The start of this example is the TestSampleDAO test case. It instantiates the database connection and then the data access object that interacts with the connection.
It uses: