准备:
QueryRunner queryRunner = new QueryRunner();
//开启下划线->驼峰转换所用
BeanProcessor bean = new GenerousBeanProcessor();
RowProcessor processor = new BasicRowProcessor(bean);
实现:
conn = DataBaseHelper.getConn();
rsh = new BeanListHandler<>(example.class,processor);
只要在
ResultSetHandler类对象的生成中,加上第二个参数,就可以进行下划线->驼峰的转化了