orcle修改屬性字段 并且保留原有值
update table1 set num = substr(num,0,instr(num,'-'))||(substr(num,instr(num,'-')+1) +9)
posted @ 2012-11-12 10:20 wyx 閱讀(337) | 評論 (0) | 編輯 收藏
當幸福來敲門我就會牢牢抓??!
隨筆 - 50, 文章 - 3, 評論 - 8, 引用 - 0
|
orcle修改屬性字段 并且保留原有值1.原字段類型是字符串 使用“||”連接
update table1 set num = substr(num,0,instr(num,'-'))||(substr(num,instr(num,'-')+1) +9) posted @ 2012-11-12 10:20 wyx 閱讀(337) | 評論 (0) | 編輯 收藏 form表單 修改 多選框默認選中1.放到HashMap中
String varsort=exp.getVarsort(); String vars[]=null; HashSet setvar = new HashSet(); if(varsort!=null&&!varsort.trim().equals("")){ vars=varsort.substring(0,varsort.length()-1).split(","); for(int i=0;i<vars.length;i++){ setvar.add(vars[i].trim()); } } 2. contains比較是否包含 <% if(varsorts!=null&&varsorts.size()>0){ for(int j=0;j<varsorts.size();j++){ TDictionarys td=varsorts.get(j); %> <input type="checkbox" value="<%=td.getDataid() %>" <%if(setvar.contains(String.valueOf(td.getDataid()).trim())){out.print("checked");} %> onclick="getBreeds()" name="varsort" id="varsort" /> <label for="checkbox" class="font12"> <%=td.getName() %> </label> <% } } %> posted @ 2012-09-21 18:03 wyx 閱讀(1330) | 評論 (1) | 編輯 收藏 頁面級緩存處理前提 列表走了數據庫查詢
1.引入架包 <%@ taglib uri="oscache" prefix="cache"%> 2.包含要緩存的部分 <cache:cache key="dbnewscache" time="3600"> <%List<Article> list=new CmsByMysql().getNews(); %> <c:forEach var="cu" items="<%=list%>"> <li> <a href="${cu.url}">${cu.titleContent} </a> </li> </c:forEach> </cache:cache> posted @ 2012-09-21 17:25 wyx 閱讀(229) | 評論 (0) | 編輯 收藏 Ifram 父子頁面 JS調用
<iframe marginwidth="0" framespacing="0" marginheight="0" frameborder="0"
name="uploadframe" id="uploadframe" src="c.html" scrolling="no" width="100" height="100" ></iframe> 如想在c.html 中寫一些代碼去改變parent.html 中的一些內容,以下代碼可作為參考: 1、parent.window.frames 可返回parent.html 中所有的iframe;返回結果應該是一個數組,用parent.window.frames[iframeId]可得到iframeId; 2、用parent.document.getElementById('xxxx')可得到父里的xxxx,并改變相應的值,例如:parent.document.getElementById('xxxx').className = 'test'; 3、如果我想在父中再創建一個元素,直接用parent.appendChild(yyyy)在firefox中是可以的,但在IE(最起碼IE6)是不行的; 所以,要把創建這個動作放在父中來完成,在子中調用; parent.document.getElementById("pinming").innerHTML = retText2; posted @ 2012-07-24 15:29 wyx 閱讀(717) | 評論 (0) | 編輯 收藏 jquery目錄樹 js實現 目錄數插件2011-07-13 10:07
jQuery 目錄樹插件介紹——ligerTree
一,簡介 ligerTree的功能列表: 1,支持本地數據和服務器數據(配置data或者url) 2,支持原生html生成Tree 3,支持動態獲取增加/修改/刪除節點 4,支持大部分常見的事件 5,支持獲取選中行等常見的接口方法
二,第一個例子 引入庫文件 遵循LigerUI系列插件的設計原則(插件盡量單獨),ligerTree是一個單獨的插件,也就是說只需要引入plugins/ligerTree.js和樣式css文件就可以使用(當然必須先引入jQuery),在這個例子中,我把tree用到的樣式和圖片分離了出來,有興趣的朋友可以下載來看看 <script src="lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> <link href="lib/ligerUI/skins/Aqua/css/ligerui-tree.css" rel="stylesheet" type="text/css"/> <script src="lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script> 加入HTML <ul id="tree1"> <li> <span>節點1</span> <ul> <li> <span>節點1.1</span> <ul> <li><span>節點1.1.1</span></li> <li><span>節點1.1.2</span></li> </ul> </li> <li><span>節點1.2</span></li> </ul> </li> </ul> 調用ligerTree <table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: inherit !important; border-collapse: collapse !important; background-position: initial initial !important; background-repeat: initial initial !important; "><td style="font-size: 1em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: initial !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; min-height: inherit !important; border-left-style: none !important; border-left-color: initial !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; ">$("#tree1").ligerTree();效果圖 三,常用場景 場景一:不使用復選框: $("#tree2").ligerTree({ checkbox: false });場景二:不使用復習框和圖標: $("#tree3").ligerTree({ checkbox: false, parentIcon: null, childIcon: null });效果如圖: ? append(parentNode, newdata)增加節點集合clear()清空collapseAll()全部節點都折疊demotion(treenode)降級為葉節點級別expandAll()全部節點都展開getChecked()獲取選擇的行(復選框)getData()獲取樹的數據源getParentTreeItem(treenode, level)獲取父節點getSelected()獲取選擇的行hasChildren(treenode)是否包含子節點 loadData(node, url, param)加載數據remove(node)刪除節點upgrade(treenode)升級為父節點級別 posted @ 2012-07-04 16:59 wyx 閱讀(2100) | 評論 (1) | 編輯 收藏 讀取 文本 文件內容 FileInputStream 亂碼處理
StringBuffer content = new StringBuffer();
// FileInputStream fis = null; // byte[] b = new byte[2048]; // try { // if(lang!=null&&lang.trim().equals("10")){ // fis = new FileInputStream(passwordTemplatePath); // }else if(lang!=null&&lang.trim().equals("20")){ // fis = new FileInputStream(passwordTemplateEnPath); // }else if(lang!=null&&lang.trim().equals("30")){ // fis = new FileInputStream(passwordTemplateChinaEnPath); // } // int m = 0; // while ((m = fis.read(b)) != -1) { // content.append(new String(b, 0, m)); // } //passwordTemplatePath 文本 文件地址 BufferedReader br = null; try { if(lang!=null&&lang.trim().equals("10")){ br = new BufferedReader(new InputStreamReader(new FileInputStream(passwordTemplatePath), "utf-8")); }else if(lang!=null&&lang.trim().equals("20")){ br = new BufferedReader(new InputStreamReader(new FileInputStream(passwordTemplateEnPath), "utf-8")); }else if(lang!=null&&lang.trim().equals("30")){ br = new BufferedReader(new InputStreamReader(new FileInputStream(passwordTemplateChinaEnPath), "utf-8")); } String s = null; while ((s = br.readLine()) != null) { content.append(s); } } catch (Exception e) { e.printStackTrace(); } finally { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } posted @ 2012-06-26 17:15 wyx 閱讀(2123) | 評論 (2) | 編輯 收藏 線程等待問題處理
class MyThread implements Runnable {
@Override public void run() { System.out.println("1、進入run()方法休眠"); try { System.out.println("2、線程休眠20秒"); Thread.sleep(20000);//這里休眠20秒 System.out.println("3、線程正常休眠完畢"); } catch (InterruptedException e) { System.out.println("4、線程發生異常休眠被中斷"); return;//返回方法調用處 } System.out.println("5、線程正常結束run()方法體"); } } public class InterruptDemo { public static void main(String[] args) { MyThread mt = new MyThread(); Thread t = new Thread(mt,"線程A"); t.start();//啟動線程 //======================================================== try { Thread.sleep(2000); //保證線程至少執行2秒 } catch (InterruptedException e) { e.printStackTrace(); } //======================================================== t.interrupt();//中斷線程 } } posted @ 2012-06-21 15:21 wyx 閱讀(207) | 評論 (0) | 編輯 收藏 "Mon Dec 28 00:00:00 CST 2008"的格式字符串轉換 yyyy-MM-dd 格式public static void main(String[] args) //將已有的時間字符串轉化為Date對象
posted @ 2012-06-19 16:12 wyx 閱讀(6996) | 評論 (1) | 編輯 收藏 JAVA開發者最常去的25個英文網站 (轉載http://handawei.iteye.com/blog/675034)posted @ 2012-06-15 15:44 wyx 閱讀(207) | 評論 (0) | 編輯 收藏 EL表達式處理字符串 是否 包含 某字符串 截取 拆分...............
JSP頁面頁頭添加
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%> <%@ taglib prefix="fn" uri="頁面內容如下: <c:if test="${fn:contains(record.name,'樣例')==false}"> <% if ((f != null && f.trim().equals("0"))&&name!=null&&!name.trim().equals("免費報告")) { %><a href="javascript:void(0);alert('很抱歉,您無權訪問!如需訪問請購買產品或聯系管理員...');"> ${record.name} </a> <% } else { %> <a href="/tcreportAction.do?method=lookReportInfo&bid=${record.bid } ">${record.name}</a> <% } %> </c:if> <c:if test="${fn:contains(record.name,'樣例')}"> <a href="/tcreportAction.do?method=lookReportInfo&bid=${record.bid } ">${record.name}</a> </c:if> ${wjcd.lrsj}原來得到的是如2006-11-12 11:22:22.0 ${fn:substring(wjcd.lrsj, 0, 16)} 使用functions函數來獲取list的長度 ${fn:length(list)}
<c:if test="${fn:length(onebeans.info)>100 }">${ fn:substring( onebeans.info ,0,100)} ...</c:if> <c:if test="${fn:length(onebeans.info)<=100 }">${ onebeans.info }</c:if> posted @ 2012-06-14 14:38 wyx 閱讀(29481) | 評論 (0) | 編輯 收藏 |
|