锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日韩国产一区二区三区,日本亚洲视频在线,一本色道久久88综合亚洲精品高清http://www.tkk7.com/jsdk999/category/17765.htmlzh-cnWed, 28 Feb 2007 04:09:33 GMTWed, 28 Feb 2007 04:09:33 GMT60.net瀹炵幇鐨勬暟鎹簱閾炬帴姹?/title><link>http://www.tkk7.com/jsdk999/archive/2006/12/01/84892.html</link><dc:creator>WindDC</dc:creator><author>WindDC</author><pubDate>Fri, 01 Dec 2006 09:11:00 GMT</pubDate><guid>http://www.tkk7.com/jsdk999/archive/2006/12/01/84892.html</guid><wfw:comment>http://www.tkk7.com/jsdk999/comments/84892.html</wfw:comment><comments>http://www.tkk7.com/jsdk999/archive/2006/12/01/84892.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/jsdk999/comments/commentRss/84892.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/jsdk999/services/trackbacks/84892.html</trackback:ping><description><![CDATA[ <p>聽聽聽聽聽聽聽 鏈枃鏄敤.net瀹炵幇鐨勬暟鎹簱閾炬帴姹?澶т綋浣撶幇浜嗘暟鎹簱閾炬帴姹犵殑瀹炵幇鎬濇兂,ADO.NET宸茬粡鎻愪緵浜嗗緢濂界殑閾炬帴姹犵淮鎶?鎵浠ユ湰紼嬪簭鍩烘湰娌℃湁浠涔堝疄鐢ㄤ環(huán)鍊?<br /><br />1.閾炬帴姹犵鐞嗙被<br />using System;<br />using System.Data;<br />using System.Data.SqlClient;<br />using System.Data.OleDb;<br />using System.Collections;<br />using System.Configuration;</p> <p>/// <summary><br />/// DbConnectionPool 鐨勬憳瑕佽鏄?br />/// </summary></p> <p>namespace dbopr<br />{<br />聽聽聽 public class DbConnectionPool<br />聽聽聽 {<br />聽聽聽聽聽聽聽 //瀹氫箟瀛樻斁鏁版嵁搴撻摼鎺ョ殑闃熷垪<br />聽聽聽聽聽聽聽 private static Queue connections=new Queue();</p> <p>聽聽聽聽聽聽聽 //鏁版嵁搴撳弬鏁?br />聽聽聽聽聽聽聽 private static string ConnString = "";聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //閾炬帴瀛楃涓?/p> <p>聽聽聽聽聽聽聽 //閾炬帴姹犲弬鏁?br />聽聽聽聽聽聽聽 private static int InitSize = 20;聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //鍒濆鍖栭摼鎺ユ睜澶у皬<br />聽聽聽聽聽聽聽 private static int MaxSize = 100;聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //鏈澶ч摼鎺ユ暟<br />聽聽聽聽聽聽聽 private static int QueueSize = 50;聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //闃熷垪涓渶澶х淮鎶ょ殑閾炬帴鏁?br />聽聽聽聽聽聽聽 private static int ConnNum = 0;聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //緋葷粺緇存姢鐨勯摼鎺ユ繪暟</p> <p> <br />聽聽聽聽聽聽聽 //瀹氫箟鏁版嵁搴撶被鍨嬶紝1琛ㄧず涓篠qlServer鏁版嵁搴擄紝2琛ㄧず鍏跺畠鐨凮LE DB錛涢粯璁や負(fù)SqlServer<br />聽聽聽聽聽聽聽 private static int聽 DbType = 1;<br />聽聽聽聽聽聽聽 public static int DbType<br />聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 set<br />聽聽聽聽聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 DbType = value;<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 private DbConnectionPool()<br />聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 try{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ConnString = Configuration.connectionStrings["DbSource"].connectionString;<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 InitSize = int.Parse(Configuration.connectionStrings["InitSize"].connectionString);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 MaxSize = int.Parse(Configuration.connectionStrings["MaxSize"].connectionString);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 QueueSize = int.Parse(Configuration.connectionStrings["QueueSize"].connectionString);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 DbType = int.Parse(Configuration.connectionStrings["DbType"].connectionString);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 initPool();<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽聽聽聽聽 catch(Exception e) {<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽 <br />聽聽聽聽聽聽聽 //鍒濆鍖栭摼鎺ユ睜<br />聽聽聽聽聽聽聽 private static void initPool(){<br />聽聽聽聽聽聽聽聽聽聽聽 int i;<br />聽聽聽聽聽聽聽聽聽聽聽 for (i = 1; i <= InitSize; i++) {<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if (DbType == 1)<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 connections.Enqueue(newSqlConn());<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 else<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 connections.Enqueue(newOleConn());<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 //鑾峰彇涓涓猄ql Server閾炬帴瀵硅薄<br />聽聽聽聽聽聽聽 private static SqlConnection newSqlConn()<br />聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 ConnNum++;<br />聽聽聽聽聽聽聽聽聽聽聽 return new SqlConnection(ConnString);<br />聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽 <br />聽聽聽聽聽聽聽 //鑾峰彇涓涓狾LE DB閾炬帴瀵瑰儚<br />聽聽聽聽聽聽聽 private static OleDbConnection newOleConn() <br />聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 ConnNum++;<br />聽聽聽聽聽聽聽聽聽聽聽 return new OleDbConnection(ConnString);<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 //鑾峰彇涓涓暟鎹簱閾炬帴<br />聽聽聽聽聽聽聽 public static IDbConnection getConn() {<br />聽聽聽聽聽聽聽聽聽聽聽 if (connections.Count == 0)聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //濡傛灉闃熷垪涓摼鎺ョ敤瀹岋紝鍒欐柊寤轟竴涓摼鎺ユ斁鍏ラ槦鍒?br />聽聽聽聽聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if (ConnNum > MaxSize)聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //濡傛灉褰撳墠媧誨姩閾炬帴杈懼埌鏈澶э紝鍒欑瓑寰呴摼鎺?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return null;<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 else<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if (DbType == 1)<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 connections.Enqueue(newSqlConn());<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 else<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 connections.Enqueue(newOleConn());<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return connections.Dequeue();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽聽聽聽聽 else<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return connections.Dequeue();<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 //閲婃斁涓涓椿榪愰摼鎺?br />聽聽聽聽聽聽聽 public static void reConn(IDbConnection conn) {<br />聽聽聽聽聽聽聽聽聽聽聽 if (connections.Count > QueueSize)聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 //濡傛灉闃熷垪涓厓绱犱釜鏁板凡杈懼埌鏈澶э紝鍒欏叧闂摼鎺?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 conn.Close();<br />聽聽聽聽聽聽聽聽聽聽聽 else<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 connections.Enqueue(conn);<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 //閿姣侀摼鎺ユ睜<br />聽聽聽聽聽聽聽 public static void ClearPool() {<br />聽聽聽聽聽聽聽聽聽聽聽 while(connections.Count>0)<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 (IDbConnection)connections.Dequeue().Close();<br />聽聽聽聽聽聽聽 }<br />聽聽聽 }<br />}<br /><br />2.閾炬帴鐢熸垚綾?br />using System;<br />using System.Data;<br />using System.Data.SqlClient;<br />using System.Data.OleDb;<br />using System.Configuration;<br />using System.Web;</p> <p>/// <summary><br />/// DbConn 鐨勬憳瑕佽鏄?br />/// </summary></p> <p>namespace dbopr<br />{<br />聽聽聽 public class DbConnection<br />聽聽聽 {<br />聽聽聽聽聽聽聽 private static IDbConnection conn;<br />聽聽聽聽聽聽聽 <br />聽聽聽聽聽聽聽 public DbConnection()<br />聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 //<br />聽聽聽聽聽聽聽聽聽聽聽 // TODO: 鍦ㄦ澶勬坊鍔犳瀯閫犲嚱鏁伴昏緫<br />聽聽聽聽聽聽聽聽聽聽聽 //<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 public static SqlConnection getSqlConn()<br />聽聽聽聽聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 //鑾峰彇閾炬帴姹犱腑鐨凷ql Server鐨勯摼鎺?br />聽聽聽聽聽聽聽聽聽聽聽 conn = DbConnectionPool.getConn();<br />聽聽聽聽聽聽聽聽聽聽聽 return (SqlConnection)conn;<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 public static OleDbConnection getOleConn() {<br />聽聽聽聽聽聽聽聽聽聽聽 //鑾峰彇鍏跺畠OLE DB鐨勯摼鎺?br />聽聽聽聽聽聽聽聽聽聽聽 conn = DbConnectionPool.getConn();<br />聽聽聽聽聽聽聽聽聽聽聽 return (OleDbConnection)conn;<br />聽聽聽聽聽聽聽 }</p> <p>聽聽聽聽聽聽聽 public static void Close() {<br />聽聽聽聽聽聽聽聽聽聽聽 //鏀懼洖鐢ㄨ繃鐨勯摼鎺?br />聽聽聽聽聽聽聽聽聽聽聽 DbConnectionPool.reConn(conn);<br />聽聽聽聽聽聽聽 }<br />聽聽聽 }<br />}</p> <img src ="http://www.tkk7.com/jsdk999/aggbug/84892.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/jsdk999/" target="_blank">WindDC</a> 2006-12-01 17:11 <a href="http://www.tkk7.com/jsdk999/archive/2006/12/01/84892.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://ynkaishan.com" target="_blank">亚洲乱妇老熟女爽到高潮的片 </a>| <a href="http://wwwseselu.com" target="_blank">一区在线免费观看</a>| <a href="http://www827556.com" target="_blank">久久久久久久91精品免费观看</a>| <a href="http://m0808dy.com" target="_blank">亚洲av无码乱码国产精品</a>| <a href="http://www-741.com" target="_blank">中国内地毛片免费高清</a>| <a href="http://6132423.com" target="_blank">国产精品亚洲w码日韩中文</a>| <a href="http://ytsp88.com" target="_blank">特a级免费高清黄色片</a>| <a href="http://dstbxg.com" target="_blank">亚洲AV无码一区二区三区在线观看</a>| <a href="http://45-po.com" target="_blank">亚洲AV无码一区二区三区久久精品 </a>| <a href="http://43sihu.com" target="_blank">免费国产污网站在线观看15</a>| <a href="http://lebaojj.com" target="_blank">国产精品久久久亚洲</a>| <a href="http://tedegold.com" target="_blank">免费毛片在线看不用播放器</a>| <a href="http://igao4.com" target="_blank">亚洲日产无码中文字幕</a>| <a href="http://cc19123.com" target="_blank">亚洲精品偷拍视频免费观看</a>| <a href="http://biarn.com" target="_blank">免费国产黄网站在线看</a>| <a href="http://haohaoshuo.com" target="_blank">亚洲国产中文字幕在线观看</a>| <a href="http://tpwelert.com" target="_blank">一区二区三区精品高清视频免费在线播放 </a>| <a href="http://mcjc1.com" target="_blank">精品熟女少妇AV免费观看</a>| <a href="http://xf002.com" target="_blank">亚洲天然素人无码专区</a>| <a href="http://ynkmht.com" target="_blank">69成人免费视频无码专区</a>| <a href="http://998wc.com" target="_blank">亚洲中文字幕久久精品无码A</a>| <a href="http://7766qq.com" target="_blank">国内外成人免费视频</a>| <a href="http://wwby66636.com" target="_blank">黄色毛片免费观看</a>| <a href="http://qmoread.com" target="_blank">亚洲欧洲无码AV电影在线观看</a>| <a href="http://8xcb.com" target="_blank">久久久精品免费国产四虎</a>| <a href="http://cdkunyu.com" target="_blank">色噜噜综合亚洲av中文无码</a>| <a href="http://pjwys.com" target="_blank">AA免费观看的1000部电影</a>| <a href="http://www44414.com" target="_blank">亚洲欧美国产欧美色欲</a>| <a href="http://woaianli.com" target="_blank">亚洲A∨精品一区二区三区</a>| <a href="http://szgyk.com" target="_blank">国产午夜不卡AV免费</a>| <a href="http://hnqkzj.com" target="_blank">亚洲导航深夜福利</a>| <a href="http://4p5e.com" target="_blank">日韩一级在线播放免费观看</a>| <a href="http://phlinhng.com" target="_blank">一道本不卡免费视频</a>| <a href="http://aicbbs.com" target="_blank">亚洲日本va午夜中文字幕一区</a>| <a href="http://22222xxx.com" target="_blank">国产成人yy免费视频</a>| <a href="http://qianmiu.com" target="_blank">视频一区在线免费观看</a>| <a href="http://kingrel.com" target="_blank">久久夜色精品国产嚕嚕亚洲av</a>| <a href="http://zuche001.com" target="_blank">jjizz全部免费看片</a>| <a href="http://wwwse09.com" target="_blank">青娱乐在线免费观看视频</a>| <a href="http://dw168cn.com" target="_blank">亚洲AV成人精品网站在线播放</a>| <a href="http://1111xxxx.com" target="_blank">97免费人妻无码视频</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>