摘要: 在mapper代理的开发中,程序员需要遵守一些规范,mybatis才能实现mapper接口的代理对象。 它的规范如下: mapper.xml的namespace要写所映射接口的全称类名。 mapper.xml中的每个statement的id要和接口方法的方法名相同 mapper.xml中定义的每个s 阅读全文
posted @ 2016-12-15 08:50 ewwwe01 阅读(9004) 评论(0) 推荐(0)
摘要: 1、最新的jetty容器 org.eclipse.jetty 需要JDK1.8的支持。 2、在容器中发布WEB项目时web 中的pom.xml的依赖关系会丧失,依赖和插件需要单独完全编写(尽管IDE会提示版本号已在父项目存在),暂时找不到解决办法。 3、阿里的MAVEN仓库真的很好用,速度很快 阅读全文
posted @ 2016-12-13 11:44 ewwwe01 阅读(94) 评论(0) 推荐(0)
摘要: 问题1:Could not bind factory to JNDI hibernate.cfg.xml中<sessionFactory> 标签中的name="foo" 去掉 问题2:如何获得sessionFactory SessionFactory sessionFactory = new Con 阅读全文
posted @ 2016-12-09 11:00 ewwwe01 阅读(199) 评论(0) 推荐(0)
摘要: DatabaseOperation.TRUNCATE_TABLE.execute(con, ds);等对数据库的操作放在每个@Test方法中做而不是在@Before里做,可增加灵活性 阅读全文
posted @ 2016-12-06 18:01 ewwwe01 阅读(232) 评论(0) 推荐(0)
摘要: 增删改:excuteUpdate();返回int 查:excuteQuery();返回ResultSet 阅读全文
posted @ 2016-12-06 17:59 ewwwe01 阅读(96) 评论(0) 推荐(0)
摘要: JDBC中:设置从1开始 例: Connection con = DriverManager.getConnection("jdbc:mysql://localhost/...","root","123"); String sql = "insert into t_user values (?,?, 阅读全文
posted @ 2016-12-05 16:49 ewwwe01 阅读(325) 评论(0) 推荐(0)
摘要: #可以防止SQL注入 $用在一些特殊的SQL语句例如 order by ${...} , desc/asc PS:大部分用#,一些特殊情况用$ 阅读全文
posted @ 2016-12-03 16:42 ewwwe01 阅读(167) 评论(0) 推荐(0)