运行maven项目报错:The method queryForInt(String) is undefined for the type JdbcTemplate
2017-07-21 11:21
2091 查看
报错:The method queryForInt(String) is undefined for the type JdbcTemplate
The method JdbcTemplate.queryForInt was deprecated in Spring 3.2.2 and it was removed in Spring 4.2.0.
问题:spring.jar包问题,spring3.2.2支持 queryForInt(String) 方法,但spring4.2.0不支持这个方法,他只支持 queryForObject(String sql, class<T> requiredType) 这个方法。
解决方法:将spring版本降到spring3.2.2,若为maven项目,可在pom.xml将spring依赖中spring的Version改为3.2.2;或者将自己报错处使用的方法换成queryForObject(String sql, class<T> requiredType)。
The method JdbcTemplate.queryForInt was deprecated in Spring 3.2.2 and it was removed in Spring 4.2.0.
问题:spring.jar包问题,spring3.2.2支持 queryForInt(String) 方法,但spring4.2.0不支持这个方法,他只支持 queryForObject(String sql, class<T> requiredType) 这个方法。
解决方法:将spring版本降到spring3.2.2,若为maven项目,可在pom.xml将spring依赖中spring的Version改为3.2.2;或者将自己报错处使用的方法换成queryForObject(String sql, class<T> requiredType)。
相关文章推荐
- 错误提示:The method parseInt(String) is undefined for the type Loginsample
- The method fromObject(String) is undefined for the type JSONObject
- The method isEmpty() is undefined for the type String/String类型的isEmpty报错
- ReactJs 报错 Element type is invalid: expected a string (from built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Me`.
- fragment 里需要activity。Android-The method findViewById(int) is undefined for the type first (Fragment)
- The method setCharacterEncoding(String) is undefined for the type HttpServletResponse 是什么原因?
- The method setProgress(int, int, boolean) is undefined for the type NotificationCompat.Builder
- The method isEmpty() is undefined for the type String
- 编译错:The method createSqlQuery(String, List<Object>) is ambiguous for the type
- The method isEmpty() is undefined for the type String/String类型的isEmpty报错
- The method setCharacterEncoding(String) is undefined for the type HttpServle
- the method d(string string) is undefined for the type log
- "The method width(int) is undefined for the type SmoothProgressDrawable.Builder"
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String)
- The method setCharacterEncoding(String) is undefined for the type HttpServletResponse
- The method isEmpty(String) is undefined for the type StringUtils解决办法
- The method queryForMap(String, Object...) from the type JdbcTemplate refers to the missing type DataAccessException
- 开发中碰到的问题:The method getSystemService(String) is undefined for the type CourseFragment
- The method isEmpty() is undefined for the type String/String
- The method setDefaultCloseOperation(int) is undefined for the type