code: public static List<Map<String, Object>> queryForList(String sql, Object... args) {
  		List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
  		Connection con = null;
  		ResultSet rs = null;
  		PreparedStatement ps = null;
  		try {
  			con = getconnnection();
  			ps = con.prepareStatement(sql);
  			if (args != null) {
  				for (int i = 0; i < args.length; i++) {
  					ps.setObject((i + 1), args[i]);
  				}
  			}
  			rs = ps.executeQuery();
  			ResultSetMetaData rsmd = rs.getMetaData();
  			int columnCount = rsmd.getColumnCount();
  			while (rs.next()) {
  				Map<String, Object> map = new HashMap<String, Object>();
  				for (int i = 1; i <= columnCount; i++) {
  					map.put(rsmd.getColumnLabel(i), rs.getObject(i));
  				}
  				result.add(map);
  			}
  		} catch (SQLException e) {
  			e.printStackTrace();
  		} finally {
  			close(rs, ps, con);
  		}
  		return result;
  	}
docs: Query a single record
  
  @param sql
  @param args
  @return List<Map<String,Object>>