![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
文章平均质量分 82
爱笑的女孩运气不会太差
和大佬们一起进步
展开
-
在mybatis报错Open quote is expected for attribute "property" associated with an element type "result".
xml中报错Open quote is expected for attribute "property" associated with an element type "result".错误写法:property=note/>正确写法:"note"/>一定要写引号!一定要写引号!一定要写引号!原创 2017-09-25 00:20:05 · 1700 阅读 · 0 评论 -
mybatis中mapper配置方式进行查询(三)
本篇博客主要介绍mapper方式开发,写了个查询作为示例,其他的操作用相应的标签与sql语句,调用相关的方法即可(在mybatis一中讲解了)。环境搭建已经说了,就不再重复了mapper开发开发规范: 2.mapper.java接口中的方法名和mapper.xml中statement的id一致 3.mapper.java接口中的方法输入参数类型和mapp原创 2017-09-21 20:05:02 · 2487 阅读 · 0 评论 -
mybatis入门dao方式写URUD(二)
在上一篇博客中已经搭建好环境了,就不再说了,这次主要使用dao的方式写mybatis的CRUD,提高代码的可重用性。目录结构:~创建entity:package pojo;public class Stu { private long id;原创 2017-09-18 23:59:08 · 774 阅读 · 0 评论 -
mybatis中的#和$的区别?
1. #将传入的数据都当成一个字符串,会对自动传入的数据加一个双引号。如:order by #user_id#,如果传入的值是111,那么解析成sql时的值为order by "111", 如果传入的值是id,则解析成的sql为order by "id". 2. $将传入的数据直接显示生成在sql中。如:order by $user_id$,如果传入的值是111,那么解析成sql时的值为转载 2017-09-20 22:30:50 · 378 阅读 · 0 评论 -
mybatis入门
开发任务为:1.根据id查询用户信息2.根据用户名模糊查信息3.添加用户4.添加用户时,.将插入数据的主键返回到stu对象中(两种方式:1.SELECT LAST_INSERT_ID() 2.SELECT UUID())6.删除用户7.更新用户搭建mybatis环境:新建一个web工程,加入jar文件(mybatis-3.2.7.jar是mybatis核心原创 2017-09-18 22:52:54 · 383 阅读 · 0 评论 -
mybatis介绍(一)
mybatis是什么? 官方解释:MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集。MyBatis 可以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的 POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记原创 2017-09-18 18:27:19 · 395 阅读 · 0 评论 -
mybatis报错:Could not instantiate bean class [Dao.stuDao]: Specified class is an interface
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stuDao' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception原创 2017-09-25 19:03:09 · 2699 阅读 · 0 评论 -
mybatis报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sq
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlsessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; ne原创 2017-09-25 19:56:52 · 1522 阅读 · 0 评论 -
mybatis和spring整合报错:No bean named 'sqlSessionFactory' is defined
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stuDao' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sqlSessionFac原创 2017-09-25 19:17:22 · 3099 阅读 · 0 评论 -
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'orderdetail.id' in 'fiel
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'orderdetail.id' in 'field list'##原创 2017-09-25 12:53:57 · 1502 阅读 · 0 评论 -
URI is not registered ( Setting | Project Settings | Schemas and DTDs )
URI is not registered ( Setting | Project Settings | Schemas and DTDs )在idea中,当初手动第一次写spring配置文件的时候,出现了上面这个错误。错误提示如下:很明显的两行错误提示。将鼠标放在上面,软件会提示“URI is not registered ( Setting | Project Settings |...原创 2018-09-10 17:16:42 · 131 阅读 · 0 评论