夢(mèng)幻之旅
DEBUG - 天道酬勤
::
首頁(yè)
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
::
671 隨筆 :: 6 文章 :: 256 評(píng)論 :: 0 Trackbacks
<
2011年1月
>
日
一
二
三
四
五
六
26
27
28
29
30
31
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
公告
本博客中未注原創(chuàng)的文章均為轉(zhuǎn)載,對(duì)轉(zhuǎn)載內(nèi)容可能做了些修改和增加圖片注釋,如果侵犯了您的版權(quán),或沒(méi)有注明原作者,請(qǐng)諒解
常用鏈接
我的隨筆
我的評(píng)論
我的參與
最新評(píng)論
留言簿
(21)
給我留言
查看公開(kāi)留言
查看私人留言
隨筆分類
(644)
Android(10)
(rss)
ANT(4)
(rss)
C#(10)
(rss)
C/C++(16)
(rss)
CSS(3)
(rss)
DataBase(119)
(rss)
DB-DailyMmaintenance(16)
(rss)
Design Patterns(27)
(rss)
english
(rss)
Exceptions(7)
(rss)
EXT(39)
(rss)
FLASH(9)
(rss)
Hardware(20)
(rss)
Hibernate(13)
(rss)
Html(23)
(rss)
Java(143)
(rss)
java Net(10)
(rss)
JavaScript(39)
(rss)
Linux(26)
(rss)
php(5)
(rss)
Regular Exp(3)
(rss)
Spring(17)
(rss)
Struts(12)
(rss)
TOOL(43)
(rss)
VB/VBA/VBS(5)
(rss)
webservice(9)
(rss)
XML(2)
(rss)
我的夢(mèng)幻旅途(14)
(rss)
隨筆檔案
(669)
2017年9月 (4)
2016年10月 (1)
2015年6月 (1)
2015年4月 (2)
2015年1月 (1)
2014年8月 (2)
2014年7月 (9)
2014年6月 (1)
2014年5月 (2)
2014年4月 (3)
2014年3月 (3)
2013年10月 (4)
2013年9月 (8)
2013年8月 (4)
2013年6月 (3)
2013年5月 (4)
2013年4月 (7)
2013年3月 (1)
2013年1月 (3)
2012年12月 (4)
2012年11月 (1)
2012年10月 (1)
2012年9月 (4)
2012年8月 (1)
2012年7月 (2)
2012年6月 (1)
2012年5月 (4)
2012年4月 (2)
2012年3月 (1)
2012年2月 (4)
2012年1月 (6)
2011年12月 (10)
2011年11月 (7)
2011年10月 (6)
2011年9月 (37)
2011年8月 (34)
2011年7月 (44)
2011年6月 (10)
2011年5月 (5)
2011年4月 (3)
2011年3月 (1)
2011年2月 (1)
2011年1月 (18)
2010年12月 (9)
2010年11月 (13)
2010年10月 (17)
2010年9月 (2)
2010年8月 (10)
2010年7月 (10)
2010年6月 (5)
2010年5月 (8)
2010年4月 (9)
2010年3月 (11)
2010年2月 (3)
2010年1月 (8)
2009年12月 (6)
2009年11月 (10)
2009年10月 (5)
2009年9月 (1)
2009年8月 (18)
2009年7月 (6)
2009年6月 (2)
2009年5月 (1)
2009年4月 (4)
2009年3月 (6)
2009年2月 (5)
2009年1月 (3)
2008年12月 (13)
2008年11月 (13)
2008年10月 (30)
2008年9月 (9)
2008年8月 (24)
2008年7月 (17)
2008年6月 (15)
2008年5月 (16)
2008年4月 (15)
2008年3月 (19)
2008年2月 (3)
2008年1月 (20)
2007年12月 (24)
2007年11月 (9)
文章檔案
(6)
2008年4月 (1)
2008年3月 (1)
2008年1月 (2)
2007年11月 (2)
最新隨筆
1.?PP代碼生成器(四) 使用解決方案生成代碼
2.? PP代碼生成器(三) 設(shè)計(jì)freemarker模板, 創(chuàng)建解決方案
3.? PP代碼生成器(二) 解決方案, 生成任務(wù), 輔助設(shè)計(jì)面板
4.? PP代碼生成器(一) 簡(jiǎn)介, 下載, 運(yùn)行
5.?PP持久層代碼生成器
6.?比較好的博客
7.?系統(tǒng)集成項(xiàng)目管理工程師
8.?軟件公司項(xiàng)目經(jīng)理崗位職責(zé)
9.?聯(lián)想筆記本 顯示屏 鍵盤失靈 釋放靜電
10.?eclipse maven
積分與排名
積分 - 959700
排名 - 37
最新評(píng)論
1.?re: Myeclipse 快捷鍵大全(絕對(duì)全)
crl+向右箭頭(輸入法有問(wèn)題打不出來(lái))移到下一個(gè)參數(shù)的位置,然后crl+shift+向右箭頭 選中該位置的參數(shù)即可
--紅領(lǐng)巾
2.?re: Log4j基本使用方法
555
--555
3.?re: Myeclipse 快捷鍵大全(絕對(duì)全)[未登錄](méi)
很不錯(cuò),謝謝
--銀狐
4.?re: Flex 表單
是誰(shuí)這么無(wú)聊~嗚~~~
--HUIKK
5.?re: Spring AfterReturning 異常
具體是什么意思啊
--dingli
閱讀排行榜
1.?Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream(70030)
2.?log4j.properties 使用說(shuō)明(42082)
3.?Myeclipse 快捷鍵大全(絕對(duì)全)(32731)
4.?TNSNAMES.ORA 配置(24396)
5.?oracle 樹(shù)狀查詢(21363)
評(píng)論排行榜
1.?Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream(53)
2.?JMail 異常: java.lang.NoClassDefFoundError: javax/activation/DataSource(21)
3.?javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first(14)
4.?java 讀取 excel 2003 或 excel 2007(14)
5.?java.lang.UnsupportedClassVersionError: Bad version number in .class file(8)
query條件處理
/** */
/**
* <ul>
* <li>Description:[處理文本]</li>
* <li>Created by [Huyvanpull] [2011-1-9]</li>
* <li>Midified by [modifier] [modified time]</li>
* </ul>
*
*
@param
fieldName
*
@param
params
*
@return
*/
private
static
String opTxt(String fieldName, String params)
{
StringBuffer conditionName
=
new
StringBuffer();
if
(ValidatorUtil.hasVal(params))
{
String[] paramArr
=
params.split(
"
[,]
"
);
for
(String param : paramArr)
{
param
=
param.trim();
//
第一種情況處理NULL值
if
(
"
null
"
.equalsIgnoreCase(param))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
is null
"
);
}
//
第二種情況正常情況
else
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
like '%
"
);
conditionName.append(param.trim());
conditionName.append(
"
%'
"
);
}
}
conditionName.replace(
0
,
4
,
"
and (
"
);
conditionName.append(
"
)
"
);
}
return
conditionName.toString();
}
/** */
/**
* <ul>
* <li>Description:[處理數(shù)字]</li>
* <li>Created by [Huyvanpull] [2011-1-9]</li>
* <li>Midified by [modifier] [modified time]</li>
* </ul>
*
*
@param
fieldName
*
@param
params
*
@return
*/
private
static
String opNum(String fieldName, String params)
{
StringBuffer conditionName
=
new
StringBuffer();
if
(ValidatorUtil.hasVal(params))
{
String[] paramArr
=
params.split(
"
[,]
"
);
for
(String param : paramArr)
{
param
=
param.trim();
//
第一種情況處理NULL值
if
(
"
null
"
.equalsIgnoreCase(param))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
is null
"
);
}
//
第二種情況, 等于
else
if
(param.matches(
"
^\\d+$
"
))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
=
"
);
conditionName.append(param);
}
//
第三種情況, 大于
else
if
(param.matches(
"
^>\\d+$
"
))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName.substring(
1
));
conditionName.append(
"
>
"
);
conditionName.append(param);
}
//
第四種情況, 小于
else
if
(param.matches(
"
^<\\d+$
"
))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName.substring(
1
));
conditionName.append(
"
<
"
);
conditionName.append(param);
}
//
第五種情況, 大于小于的情況
else
if
(param.matches(
"
^\\d+\\-\\d+$
"
))
{
conditionName.append(
"
or (
"
);
conditionName.append(fieldName);
conditionName.append(
"
>
"
);
conditionName.append(param.split(
"
[-]
"
)[
0
]);
conditionName.append(
"
and
"
);
conditionName.append(fieldName);
conditionName.append(
"
<
"
);
conditionName.append(param.split(
"
[-]
"
)[
1
]);
conditionName.append(
"
)
"
);
}
}
//
是否有值
if
(conditionName.length()
>
4
)
{
conditionName.replace(
0
,
4
,
"
and (
"
);
conditionName.append(
"
)
"
);
}
}
return
conditionName.toString();
}
/** */
/**
* <ul>
* <li>Description:[處理時(shí)間型]</li>
* <li>Created by [Huyvanpull] [2011-1-9]</li>
* <li>Midified by [modifier] [modified time]</li>
* </ul>
*
@param
fieldName
*
@param
params
*
@return
*/
private
String opDate(String fieldName, String params)
{
StringBuffer conditionName
=
new
StringBuffer();
if
(ValidatorUtil.hasVal(params))
{
String[] paramArr
=
params.split(
"
[,]
"
);
for
(String param : paramArr)
{
param
=
param.trim();
//
^\\d{4}/\\d{2}/\\d{2}\\-\\d{4}/\\d{2}/\\d{2}$
//
第一種情況處理NULL值
if
(
"
null
"
.equalsIgnoreCase(param))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
is null
"
);
}
//
第二種情況, 等于
else
if
(param.matches(
"
^\\d{4}/\\d{2}/\\d{2}$
"
))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
=
"
);
conditionName.append(
"
to_date('
"
);
conditionName.append(param);
conditionName.append(
"
','yyyy/mm/dd')
"
);
}
//
第三種情況, 大于
else
if
(param.matches(
"
^>\\d+$
"
))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
>
"
);
conditionName.append(
"
to_date('
"
);
conditionName.append(param.substring(
1
));
conditionName.append(
"
','yyyy/mm/dd')
"
);
}
//
第四種情況, 小于
else
if
(param.matches(
"
^<\\d+$
"
))
{
conditionName.append(
"
or
"
);
conditionName.append(fieldName);
conditionName.append(
"
<
"
);
conditionName.append(
"
to_date('
"
);
conditionName.append(param.substring(
1
));
conditionName.append(
"
','yyyy/mm/dd')
"
);
}
//
第五種情況, 大于小于的情況
else
if
(param.matches(
"
^\\d+\\-\\d+$
"
))
{
conditionName.append(
"
or (
"
);
conditionName.append(fieldName);
conditionName.append(
"
>
"
);
conditionName.append(
"
to_date('
"
);
conditionName.append(param.substring(
1
));
conditionName.append(
"
','yyyy/mm/dd') and
"
);
conditionName.append(fieldName);
conditionName.append(
"
<
"
);
conditionName.append(
"
to_date('
"
);
conditionName.append(param.substring(
1
));
conditionName.append(
"
','yyyy/mm/dd'))
"
);
}
}
//
是否有值
if
(conditionName.length()
>
4
)
{
conditionName.replace(
0
,
4
,
"
and (
"
);
conditionName.append(
"
)
"
);
}
}
return
conditionName.toString();
}
posted on 2011-01-09 21:39
HUIKK
閱讀(289)
評(píng)論(0)
編輯
收藏
所屬分類:
Java
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問(wèn)
管理
相關(guān)文章:
PP代碼生成器(四) 使用解決方案生成代碼
PP代碼生成器(三) 設(shè)計(jì)freemarker模板, 創(chuàng)建解決方案
PP代碼生成器(二) 解決方案, 生成任務(wù), 輔助設(shè)計(jì)面板
PP代碼生成器(一) 簡(jiǎn)介, 下載, 運(yùn)行
PP持久層代碼生成器
eclipse maven
平衡二叉樹(shù),java實(shí)現(xiàn)
數(shù)據(jù)結(jié)構(gòu)復(fù)習(xí)
萬(wàn)能分頁(yè)標(biāo)簽
優(yōu)化Servlet配置為web.xml瘦身
Powered by:
BlogJava
Copyright © HUIKK
主站蜘蛛池模板:
湖南省
|
阿坝县
|
苏尼特左旗
|
汤阴县
|
凤台县
|
广汉市
|
玉龙
|
栾川县
|
石屏县
|
莱芜市
|
江城
|
老河口市
|
延寿县
|
东乡
|
山阳县
|
延津县
|
女性
|
重庆市
|
沙河市
|
商南县
|
土默特右旗
|
合水县
|
铁力市
|
贵州省
|
繁峙县
|
潮安县
|
龙州县
|
万宁市
|
惠来县
|
会理县
|
和政县
|
堆龙德庆县
|
涞水县
|
新宾
|
庆城县
|
河源市
|
新宁县
|
滁州市
|
石河子市
|
腾冲县
|
江山市
|