一路拾遺
Collect By Finding All The Way ......
BlogJava
首頁
新隨筆
新文章
聯系
聚合
管理
posts - 81,comments - 41,trackbacks - 0
<
2009年7月
>
日
一
二
三
四
五
六
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
我的博客開張啦!歡迎大家多多來踩!
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(5)
給我留言
查看公開留言
查看私人留言
隨筆檔案
2010年9月 (1)
2010年6月 (2)
2010年5月 (5)
2009年12月 (4)
2009年11月 (3)
2009年10月 (2)
2009年8月 (2)
2009年7月 (4)
2009年6月 (5)
2009年5月 (1)
2009年4月 (2)
2008年12月 (2)
2008年11月 (1)
2008年10月 (1)
2008年9月 (4)
2008年8月 (12)
2008年7月 (30)
文章檔案
2008年12月 (1)
相冊
畢業照
搜索
積分與排名
積分 - 64759
排名 - 825
最新評論
1.?re: myeclipse開發hibernate應用程序示例[未登錄]
真的好好...
--云
2.?re: myeclipse開發hibernate應用程序示例
做得很認真,頂一個
--~!
3.?re: myeclipse開發hibernate應用程序示例[未登錄]
not bad
--1
4.?re: myeclipse開發hibernate應用程序示例
類名一定要大寫,hibernate版本要小于4才行!!!!!!
--第三方
5.?re: myeclipse開發hibernate應用程序示例
有錯誤啊
--第三方
閱讀排行榜
1.?myeclipse開發hibernate應用程序示例(15656)
2.?使用AXIS調用WSDL描述的Web服務(9692)
3.?使用AXIS調用WSDL描述的Web服務(續)(6048)
4.?基于RemoteObject方式的Java-Flex交互(USING LCDS)(2682)
5.?Java WebService注冊中心JUDDI配置方法(2204)
評論排行榜
1.?myeclipse開發hibernate應用程序示例(16)
2.?使用UDDI4J連接JUDDI(10)
3.?使用AXIS調用WSDL描述的Web服務(續)(5)
4.?使用AXIS調用WSDL描述的Web服務(3)
5.?找實習的傷心事(2)
Hibernate取count(*)的方法
public
int
getCount(String emailGroupId, String emailBatchId)
throws
HibernateException
{
Session session
=
HibernateUtil.currentSession();
Transaction tx
=
session.beginTransaction();
String hql
=
"
select count(*) from EmailSendInfo where email_group_id = :emailGroupId and batch_id = :batchId
"
;
Query query
=
session.createQuery(hql);
query.setString(
"
emailGroupId
"
, emailGroupId);
query.setString(
"
batchId
"
, emailBatchId);
/**/
/*
* for (Iterator it = query.iterate(); it.hasNext();) { return
* ((Integer) it.next()).intValue(); }
*/
try
{
return
((Integer) query.iterate().next()).intValue();
}
catch
(Exception e)
{
throw
new
HibernateException(
""
);
}
finally
{
tx.commit();
HibernateUtil.closeSession();
}
}
posted on 2009-07-13 10:46
胖胖泡泡
閱讀(324)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Copyright ©2025 胖胖泡泡 Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
扎赉特旗
|
福鼎市
|
清镇市
|
山阴县
|
霍林郭勒市
|
奉新县
|
额尔古纳市
|
三穗县
|
枣强县
|
宝丰县
|
崇州市
|
白朗县
|
甘德县
|
壶关县
|
翁牛特旗
|
上栗县
|
湖北省
|
萨迦县
|
孝义市
|
阳曲县
|
杭锦后旗
|
双鸭山市
|
乌拉特中旗
|
平山县
|
泾川县
|
宜都市
|
建昌县
|
左贡县
|
象州县
|
信丰县
|
正宁县
|
卢氏县
|
务川
|
平舆县
|
开远市
|
洮南市
|
平顶山市
|
石棉县
|
桃园市
|
东辽县
|
宜春市
|