HashMap hashMap = null;
Connection con = DatabaseConnector.getConnection();
try
{
Statement statement = con.createStatement();
String sqlString = "select FIRST_NAME,LAST_NAME from USERS where USERNAME ='"+username+"';";
ResultSet resultSet = statement.executeQuery(sqlString);
if (resultSet.next())
{
hashMap = new HashMap();
hashMap.put("firstName",resultSet.getString(1));
hashMap.put("lastName",resultSet.getString(2));
}
}
catch (Exception e)
{
System.out.println("exception caught getting usernames");
}
finally
{
if (con != null)
{
try
{
con.close();
}
catch (SQLException e)
{
}
}
}
return hashMap;