resultType和resultMap都是结果集映射成POJO的,2个不能同时使用。
resultType:返回的期望类型的类完全限定名或别名。
resultMap:外部resultMap的命名引用,可以通过自定义,映射更为复杂的情形。
association和collection都是resultMap元素的子元素。
association处理的是一对一的问题。
collection处理的是一对多的问题。
PreparedStatement是预编译,数据库对预编译的SQL会有缓存支持,多次执行,性能会比Statement好。
PreparedStatement的安全性会比Statement好,可以防止SQL注入问题。