报错
Exception in thread “main” java.sql.SQLException: Cannot create newjdbc.JavaBean: newjdbc.JavaBean Query: select * from student where id=? Parameters: [10]
原因
javaBean类中未书写 无参构造
new BeanHandler(JavaBean.class)做的操作:
1、找到了JavaBean类中的无参构造,创建了Animal对象!
2、找到了JavaBean类中私有属性的setter赋值方法,将表中获取到的字段值,按照匹配的名称依次赋值!