=v=两个问题..
第一个问题:[2007-01-22 10:28:38,135 LV: INFO CL:org.springframework.beans.factory.support.DefaultListableBeanFactorymain] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beException in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TestDao' defined in file [D:\workspace\EtlProject\src\applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'jdbcTemplate' of bean class [dao.fetch.Test]: Bean property 'jdbcTemplate' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.NotWritablePropertyException: Invalid property 'jdbcTemplate' of bean class [dao.fetch.Test]: Bean property 'jdbcTemplate' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?ans [datasource,sessionfactory,hibernateTemplate,jdbcTemplate,SystemUserGroupCountDao,TestDao]; root of BeanFactory hierarchy}
这个问题的出现的原因是没有在实现类里对JdbcTemplate进行set设置导致.总之是这样类似的问题造成的.
加上:public void setJdbcTemplate(JdbcTemplate jdbctemplate) {
this.jdbctemplate = jdbctemplate;
}
添加上就ok了..
第二个问题:
使用jdbc的时候粗心大意会造成
Invalid cursor position 问题
这个问题很明显是忘掉了..对rowset进行next操作.
因为游标默认是在我们数据之上的.需要进行next才能取得第一条数据. 欢迎分享,经验就是不断的积累:)
页:
[1]