Я создал метод в DAO:Пружина JDBC ошибка дает: "queryForObject (String, Object [], класс <String>) от типа JdbcTemplate относится к отсутствующему типу DataAccessException"
public String getUserName(int userid){
String sql="SELECT userName from UserDetail where userid=?";
return jdbcTemplate.queryForObject(sql, new Object[]{userid}, String.class);
}
эта линия: jdbcTemplate.queryForObject(sql, new Object[]{userid}, String.class)
дают следующие ошибки:
The method queryForObject(String, Object[], Class<String>) from the type JdbcTemplate refers to the missing type DataAccessException
Multiple markers at this line
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
- The method queryForObject(String, Object[], Class<String>) from the type JdbcTemplate refers to the missing type
DataAccessException
Я использую пружинный JDBC 4.0.0 с MySQL-разъемом 5.1.25, Обще-ГСБД-1,4 и Обще-бассейн-1,6. Не могли бы вы рассказать мне, что я делаю?