怎么判断是什么意思?
queryForObject(sql, new AccountRowMapper());
后面这个参数是映射类。将数据库字段映射到类的Field
public class AccountRowMapper implements RowMapper{
@Override
public Object mapRow(ResultSet rs, int i) throws SQLException {
Account acc = new Account();
acc.setAccId(rs.getInt("acc_id"));
acc.setAccName(rs.getString("acc_name"));
acc.setAccPasswd(rs.getString("acc_passwd"));
acc.setAccContract(rs.getString("acc_contract"));
acc.setAccCorp(rs.getString("acc_corp"));
acc.setAccDescription(rs.getString("acc_description"));
acc.setAccLocation(rs.getString("acc_location"));
acc.setAccTel(rs.getString("acc_tel"));
acc.setAccType(rs.getInt("acc_type"));
return acc;
}
}