一路拾遺
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)
相冊
畢業照
搜索
積分與排名
積分 - 64851
排名 - 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應用程序示例(15658)
2.?使用AXIS調用WSDL描述的Web服務(9694)
3.?使用AXIS調用WSDL描述的Web服務(續)(6050)
4.?基于RemoteObject方式的Java-Flex交互(USING LCDS)(2683)
5.?Java WebService注冊中心JUDDI配置方法(2206)
評論排行榜
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
胖胖泡泡
閱讀(326)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Copyright ©2025 胖胖泡泡 Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
商城县
|
都昌县
|
上饶市
|
江门市
|
新营市
|
新昌县
|
湖南省
|
阿克苏市
|
宜兴市
|
阿尔山市
|
宁津县
|
内黄县
|
廉江市
|
清流县
|
阳原县
|
赤水市
|
元氏县
|
井研县
|
海城市
|
达尔
|
濮阳市
|
托克托县
|
曲麻莱县
|
吴川市
|
外汇
|
聊城市
|
精河县
|
屏南县
|
景洪市
|
根河市
|
东至县
|
无棣县
|
云南省
|
和田县
|
磴口县
|
赤峰市
|
固阳县
|
台中市
|
红桥区
|
千阳县
|
山丹县
|