⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connpool_8c-source.html

📁 ORACLE编程的好东西,纯C写的OCI封装.很好用,支持数据池.
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<a name="l00436"></a><a class="code" href="group__g__connpool.html#g5d8458d13c8704dbf60cb7289b8c6240">00436</a> <span class="keywordtype">boolean</span> OCI_API <a class="code" href="group__g__connpool.html#g5d8458d13c8704dbf60cb7289b8c6240" title="Set the waiing mode used when no more connections are available from the pool.">OCI_ConnPoolSetNoWait</a>(<a class="code" href="struct_o_c_i___conn_pool.html" title="Oracle Connection Pool.">OCI_ConnPool</a> *pool, <span class="keywordtype">boolean</span> value)<a name="l00437"></a>00437 {<a name="l00438"></a>00438     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00439"></a>00439 <a name="l00440"></a>00440     OCI_CHECK_PTR(OCI_IPC_CONNPOOL, pool, 0);<a name="l00441"></a>00441 <a name="l00442"></a>00442 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00443"></a>00443 <span class="preprocessor"></span><a name="l00444"></a>00444     <span class="keywordflow">if</span> (OCILib.ver_runtime &gt;= OCI_9)<a name="l00445"></a>00445     {<a name="l00446"></a>00446         ub1 nowait = (ub1) value;<a name="l00447"></a>00447 <a name="l00448"></a>00448         OCI_CALL3<a name="l00449"></a>00449         (<a name="l00450"></a>00450             res, pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#e960f1a00bee41c9d195c15332dafd2d">err</a>,<a name="l00451"></a>00451             <a name="l00452"></a>00452             OCIAttrSet((dvoid *) pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#167d91c8dc07bb4713b11394c839457b">handle</a>, (ub4) OCI_HTYPE_CPOOL,<a name="l00453"></a>00453                        (dvoid *) &amp;nowait, (ub4) <span class="keyword">sizeof</span>(nowait),<a name="l00454"></a>00454                        (ub4) OCI_ATTR_CONN_NOWAIT, pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#e960f1a00bee41c9d195c15332dafd2d">err</a>)<a name="l00455"></a>00455         )<a name="l00456"></a>00456     }<a name="l00457"></a>00457 <a name="l00458"></a>00458 <span class="preprocessor">#endif</span><a name="l00459"></a>00459 <span class="preprocessor"></span><a name="l00460"></a>00460     <span class="keywordflow">if</span> (res == TRUE)<a name="l00461"></a>00461         pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#b935cb48925a7e1e8307f5c7a5637316">nowait</a> = value;<a name="l00462"></a>00462 <a name="l00463"></a>00463     OCI_RESULT(res);<a name="l00464"></a>00464 <a name="l00465"></a>00465     <span class="keywordflow">return</span> TRUE;<a name="l00466"></a>00466 }<a name="l00467"></a>00467 <a name="l00468"></a>00468 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00469"></a>00469 <span class="comment"> * OCI_ConnPoolGetBusyCount</span><a name="l00470"></a>00470 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00471"></a>00471 <a name="l00472"></a><a class="code" href="group__g__connpool.html#ga2cbd17675866a81848c5cd586dd43b6">00472</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__connpool.html#ga2cbd17675866a81848c5cd586dd43b6" title="Return the current number of busy connections.">OCI_ConnPoolGetBusyCount</a>(<a class="code" href="struct_o_c_i___conn_pool.html" title="Oracle Connection Pool.">OCI_ConnPool</a> *pool)<a name="l00473"></a>00473 {<a name="l00474"></a>00474     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00475"></a>00475 <a name="l00476"></a>00476     OCI_CHECK_PTR(OCI_IPC_CONNPOOL, pool, 0);<a name="l00477"></a>00477 <a name="l00478"></a>00478 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00479"></a>00479 <span class="preprocessor"></span><a name="l00480"></a>00480     <span class="keywordflow">if</span> (OCILib.ver_runtime &gt;= OCI_9)<a name="l00481"></a>00481     {<a name="l00482"></a>00482         ub4 value = 0;<a name="l00483"></a>00483 <a name="l00484"></a>00484         OCI_CALL3<a name="l00485"></a>00485         (<a name="l00486"></a>00486             res, pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#e960f1a00bee41c9d195c15332dafd2d">err</a>,<a name="l00487"></a>00487             <a name="l00488"></a>00488             OCIAttrGet((dvoid *) pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#167d91c8dc07bb4713b11394c839457b">handle</a>,(ub4) OCI_HTYPE_CPOOL,<a name="l00489"></a>00489                        (dvoid *) &amp;value, (ub4 *) NULL,<a name="l00490"></a>00490                        (ub4) OCI_ATTR_CONN_BUSY_COUNT, pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#e960f1a00bee41c9d195c15332dafd2d">err</a>)<a name="l00491"></a>00491         )<a name="l00492"></a>00492 <a name="l00493"></a>00493         <span class="keywordflow">if</span> (res == TRUE)<a name="l00494"></a>00494             pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#eeacb1dbd6dce15eaf01e8413dbb06e9">nb_busy</a> = value;<a name="l00495"></a>00495     }<a name="l00496"></a>00496 <a name="l00497"></a>00497 <span class="preprocessor">#endif</span><a name="l00498"></a>00498 <span class="preprocessor"></span><a name="l00499"></a>00499     OCI_RESULT(res);<a name="l00500"></a>00500 <a name="l00501"></a>00501     <span class="keywordflow">return</span> pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#eeacb1dbd6dce15eaf01e8413dbb06e9">nb_busy</a>;<a name="l00502"></a>00502 }<a name="l00503"></a>00503 <a name="l00504"></a>00504 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00505"></a>00505 <span class="comment"> * OCI_ConnPoolGetOpenedCount</span><a name="l00506"></a>00506 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00507"></a>00507 <a name="l00508"></a><a class="code" href="group__g__connpool.html#gfe8e50af422954eac1fa3f33c6624cfd">00508</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__connpool.html#gfe8e50af422954eac1fa3f33c6624cfd" title="Return the current number of opened connections.">OCI_ConnPoolGetOpenedCount</a>(<a class="code" href="struct_o_c_i___conn_pool.html" title="Oracle Connection Pool.">OCI_ConnPool</a> *pool)<a name="l00509"></a>00509 {<a name="l00510"></a>00510     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00511"></a>00511 <a name="l00512"></a>00512     OCI_CHECK_PTR(OCI_IPC_CONNPOOL, pool, 0);<a name="l00513"></a>00513 <a name="l00514"></a>00514 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00515"></a>00515 <span class="preprocessor"></span><a name="l00516"></a>00516     <span class="keywordflow">if</span> (OCILib.ver_runtime &gt;= OCI_9)<a name="l00517"></a>00517     {<a name="l00518"></a>00518         ub4 value = 0;<a name="l00519"></a>00519 <a name="l00520"></a>00520         OCI_CALL3<a name="l00521"></a>00521         (<a name="l00522"></a>00522             res, pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#e960f1a00bee41c9d195c15332dafd2d">err</a>,<a name="l00523"></a>00523             <a name="l00524"></a>00524             OCIAttrGet((dvoid *) pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#167d91c8dc07bb4713b11394c839457b">handle</a>, (ub4) OCI_HTYPE_CPOOL, <a name="l00525"></a>00525                        (dvoid *) &amp;value, (ub4 *) NULL, <a name="l00526"></a>00526                        (ub4) OCI_ATTR_CONN_OPEN_COUNT, pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#e960f1a00bee41c9d195c15332dafd2d">err</a>)<a name="l00527"></a>00527         )<a name="l00528"></a>00528 <a name="l00529"></a>00529         <span class="keywordflow">if</span> (res == TRUE)<a name="l00530"></a>00530             pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#156dc09d514ccbbb775f4582445a6126">nb_opened</a> = value;<a name="l00531"></a>00531     }<a name="l00532"></a>00532 <a name="l00533"></a>00533 <span class="preprocessor">#endif</span><a name="l00534"></a>00534 <span class="preprocessor"></span><a name="l00535"></a>00535      OCI_RESULT(res);<a name="l00536"></a>00536 <a name="l00537"></a>00537      <span class="keywordflow">return</span> pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#156dc09d514ccbbb775f4582445a6126">nb_opened</a>;<a name="l00538"></a>00538 }<a name="l00539"></a>00539 <a name="l00540"></a>00540 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00541"></a>00541 <span class="comment"> * OCI_ConnPoolGetMin</span><a name="l00542"></a>00542 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00543"></a>00543 <a name="l00544"></a><a class="code" href="group__g__connpool.html#g11d1656264645b9ffb01405c2ff53021">00544</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__connpool.html#g11d1656264645b9ffb01405c2ff53021" title="Return the minimum number of connections that can be opened to the database.">OCI_ConnPoolGetMin</a>(<a class="code" href="struct_o_c_i___conn_pool.html" title="Oracle Connection Pool.">OCI_ConnPool</a> *pool)<a name="l00545"></a>00545 {<a name="l00546"></a>00546     OCI_CHECK_PTR(OCI_IPC_CONNPOOL, pool, 0);<a name="l00547"></a>00547   <a name="l00548"></a>00548     OCI_RESULT(TRUE);<a name="l00549"></a>00549 <a name="l00550"></a>00550     <span class="keywordflow">return</span> pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#ef66b256823aa066b81a6e8f7fd15d5c">min</a>;<a name="l00551"></a>00551 }<a name="l00552"></a>00552 <a name="l00553"></a>00553 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00554"></a>00554 <span class="comment"> * OCI_ConnPoolGetMax</span><a name="l00555"></a>00555 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00556"></a>00556 <a name="l00557"></a><a class="code" href="group__g__connpool.html#g24a3b2eaca171d4dbc3d40e1dc0229ca">00557</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__connpool.html#g24a3b2eaca171d4dbc3d40e1dc0229ca" title="Return the maximum number of connections that can be opened to the database.">OCI_ConnPoolGetMax</a>(<a class="code" href="struct_o_c_i___conn_pool.html" title="Oracle Connection Pool.">OCI_ConnPool</a> *pool)<a name="l00558"></a>00558 {<a name="l00559"></a>00559     OCI_CHECK_PTR(OCI_IPC_CONNPOOL, pool, 0);<a name="l00560"></a>00560 <a name="l00561"></a>00561     OCI_RESULT(TRUE);<a name="l00562"></a>00562 <a name="l00563"></a>00563     <span class="keywordflow">return</span> pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#39c9b42b23f075338efd5f29aece833f">max</a>;<a name="l00564"></a>00564 }<a name="l00565"></a>00565 <a name="l00566"></a>00566 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00567"></a>00567 <span class="comment"> * OCI_ConnPoolGetIncrement</span><a name="l00568"></a>00568 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00569"></a>00569 <a name="l00570"></a><a class="code" href="group__g__connpool.html#gc8f2a7bd2d053c9f774eb86a18533355">00570</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__connpool.html#gc8f2a7bd2d053c9f774eb86a18533355" title="Return the increment for connections to be opened to the database when the pool is...">OCI_ConnPoolGetIncrement</a>(<a class="code" href="struct_o_c_i___conn_pool.html" title="Oracle Connection Pool.">OCI_ConnPool</a> *pool)<a name="l00571"></a>00571 {<a name="l00572"></a>00572     OCI_CHECK_PTR(OCI_IPC_CONNPOOL, pool, 0);<a name="l00573"></a>00573 <a name="l00574"></a>00574     OCI_RESULT(TRUE);<a name="l00575"></a>00575 <a name="l00576"></a>00576     <span class="keywordflow">return</span> pool-&gt;<a class="code" href="struct_o_c_i___conn_pool.html#cc48d8aa34b0bf06ba6bb83be6ec120a">incr</a>;<a name="l00577"></a>00577 }</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Oct 9 10:07:42 2008 for OCILIB (C Driver for Oracle) by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -