不知Hibernate在哪里耗时间
发布日期:2021-05-10 07:58:59 浏览次数:19 分类:精选文章

本文共 560 字,大约阅读时间需要 1 分钟。

(1)
long time = System.currentTimeMillis();
ResultSet rs = stmt.executeQuery("select * from Tbl_Mms_User where MobilePhone='13956478952'");
System.out.println("xxxxxx:" + (System.currentTimeMillis() - time));
(2)
long time = System.currentTimeMillis();
List list = dao.find("select user from TblMmsUser user where user.MobilePhone=?", mobilePhone, Hibernate.STRING);
System.out.println("BaseReceiver.xxxxxx:" + (System.currentTimeMillis() - time));
这两段代码前一个直接用JDBC用时0,后一个Hibernate用时36
发问的原因中实际系统中用的是后一个,性能有很大问题,一个简单的查询尽用了0.5秒,表在MobilePhone有索引
数据库是SQLServer2000
上一篇:In App Purchase Verification using PHP
下一篇:查看MySQL Innodb引擎当前参数

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2025年04月24日 04时42分19秒