动态

详情 返回 返回

MyBatis常見錯誤 - 动态 详情

1.Access denied for user 'root'@'localhost' (using password: YES) 密碼錯誤image.png

2.Unknown database 'db012' 找不到數據庫image.png

3.Table 'db01.user2' doesn't exist 表不存在image.png

4.No qualifying bean of type 'com.itheima.mapper.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} UsperMapper 依賴注入失敗image.png

5.because "this.empMapper" is null 找不到數據image.png

6.Expected one result (or null) to be returned by selectOne(), but found: 2 查詢到的是多條數據,方法返回值卻是個對象image.png

7.Invalid bound statement (not found): com.itheima.mapper.StudentMapper.findByName 方法沒有在對應的 XML 文件中找到相應的 SQL 語句配置image.png

8.No qualifying bean of type 'com.itheima.mapper.StudentMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Spring 容器中沒有找到類型為 com.itheima.mapper.StudentMapper 的 Bean,無法進行自動注入(@Autowired)image.png

9.Wrong namespace. Expected 'com.itheima.mapper.StudentMapper' but found 'com.itheima.mapper.StudentMapperr'. xml中沒有正確寫Mapper的全類名image.png

10.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'form student where name='王五'' at line 1 SQL 語句中存在拼寫錯誤image.png

Add a new 评论

Some HTML is okay.