锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日韩国产一区二区三区,日本亚洲视频在线,一本色道久久88综合亚洲精品高清http://m.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://m.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://m.tkk7.com/jsdk999/archive/2006/12/01/84892.html</guid><wfw:comment>http://m.tkk7.com/jsdk999/comments/84892.html</wfw:comment><comments>http://m.tkk7.com/jsdk999/archive/2006/12/01/84892.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jsdk999/comments/commentRss/84892.html</wfw:commentRss><trackback:ping>http://m.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://m.tkk7.com/jsdk999/aggbug/84892.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jsdk999/" target="_blank">WindDC</a> 2006-12-01 17:11 <a href="http://m.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://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://tpwelert.com" target="_blank">亚洲成在人线中文字幕</a>| <a href="http://600c20.com" target="_blank">亚洲永久中文字幕在线</a>| <a href="http://dangyuming.com" target="_blank">免费大片av手机看片高清</a>| <a href="http://jinluffcl.com" target="_blank">在线不卡免费视频</a>| <a href="http://www-993789.com" target="_blank">色噜噜亚洲男人的天堂</a>| <a href="http://gangxiangli.com" target="_blank">99国产精品永久免费视频</a>| <a href="http://9844555.com" target="_blank">国产午夜亚洲精品国产</a>| <a href="http://rbthy.com" target="_blank">午夜免费福利在线</a>| <a href="http://szq18888.com" target="_blank">久久亚洲欧美国产精品</a>| <a href="http://haha02.com" target="_blank">免费一级做a爰片性色毛片</a>| <a href="http://qq367.com" target="_blank">四虎精品免费永久免费视频</a>| <a href="http://tiantangapp.com" target="_blank">亚洲Av无码乱码在线播放</a>| <a href="http://6h6y.com" target="_blank">一级黄色片免费观看</a>| <a href="http://nyminer.com" target="_blank">亚洲乱码无码永久不卡在线</a>| <a href="http://fenxiangceo.com" target="_blank">成全视频高清免费观看电视剧</a>| <a href="http://ksyy888.com" target="_blank">亚洲视频在线视频</a>| <a href="http://4p5e.com" target="_blank">色播精品免费小视频</a>| <a href="http://by7258.com" target="_blank">亚洲成在人线aⅴ免费毛片</a>| <a href="http://woniuzn.com" target="_blank">又粗又大又硬又爽的免费视频 </a>| <a href="http://zndijgch.com" target="_blank">亚洲国产美女视频</a>| <a href="http://www454yu.com" target="_blank">成人女人A级毛片免费软件</a>| <a href="http://mlhcd.com" target="_blank">美女无遮挡免费视频网站</a>| <a href="http://h588888.com" target="_blank">久久精品国产亚洲精品</a>| <a href="http://mosason.com" target="_blank">久久久久久影院久久久久免费精品国产小说 </a>| <a href="http://junyehome.com" target="_blank">免费A级毛片无码久久版</a>| <a href="http://044242.com" target="_blank">一级做a爱过程免费视</a>| <a href="http://bdyls.com" target="_blank">久久精品国产亚洲av麻豆</a>| <a href="http://ddhlj.com" target="_blank">全免费毛片在线播放</a>| <a href="http://sxhnyl.com" target="_blank">色网站在线免费观看</a>| <a href="http://jdvgo.com" target="_blank">亚洲国产成人一区二区三区</a>| <a href="http://guanxianedu.com" target="_blank">亚洲成年人免费网站</a>| <a href="http://228609.com" target="_blank">蜜桃传媒一区二区亚洲AV </a>| <a href="http://lanoss.com" target="_blank">无限动漫网在线观看免费</a>| <a href="http://liulaogendawutai.com" target="_blank">337P日本欧洲亚洲大胆精品</a>| <a href="http://www16am8.com" target="_blank">亚洲国产一成人久久精品</a>| <a href="http://hwafarda.com" target="_blank">99久久精品日本一区二区免费 </a>| <a href="http://ttvv55.com" target="_blank">又粗又大又黑又长的免费视频</a>| <a href="http://blblkj.com" target="_blank">亚洲av日韩综合一区二区三区</a>| <a href="http://w6336.com" target="_blank">中文字幕亚洲图片</a>| <a href="http://pumanpig.com" target="_blank">免费国产黄线在线观看</a>| <a href="http://uiui6.com" target="_blank">国产VA免费精品高清在线</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>