I am trying to read some data from mysql database using a jdbc resultset, this data should then be pushed onto a hashmap. All the database connections are set up correctlly and I can pass the query successfully and receive a valid resultset rs. The problem comes in when I try to store the data onto a hashmap.
HashMap hm = new HashMap();
while (rs.next()){
Object firstname = rs.getString("firstname");
Object surname = rs.getSring("surname");
hm.put(firstname,surname);
The hashmap does not dereference the given var and instead stores them as is "firstname","surname" .Can you help?