Use Google Geocoding API
It is of the format
A Geocoding API request must be of the following form:
http://maps.googleapis.com/maps/api/geocode/output?parameters
where output may be either of the following values:
json (recommended) indicates output in JavaScript Object Notation (JSON)
xml indicates output as XML
Eg...
http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true_or_false
For your problem, You can create a Javascript array of places and call this Google Geocoder in a loop and then parse JSON and populate another array with names of places and then push them to DB.
In case you want to parse it in Java use Jackson JSON or Google GSON , both works fine and are popular.