This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
You need two things to do that: 1. a html/jsp page to allow user to input data 2. a servlet to process incoming data
So, let's write dataInputPage.jsp
It is a very simple form having two edit-boxes named 'form_country_name' and 'form_country_population'. This form posts user input to 'dataProcessingServlet' which will be our backend...
Servlet performes basic validation of incoming data and when something is wrong - shows list of problems... When input data looks more-or-less good it establishes connection to database and tries to insert data.
Please, treat all of this as a kind of draft, many things should be done better...