{"id":1007,"date":"2008-04-09T13:35:06","date_gmt":"2008-04-09T13:35:06","guid":{"rendered":"http:\/\/www.msinterdev.org\/wp\/2008\/04\/09\/tcdraftpost-2\/"},"modified":"2008-04-09T13:35:06","modified_gmt":"2008-04-09T13:35:06","slug":"tcdraftpost-2","status":"publish","type":"post","link":"http:\/\/www.msinterdev.org\/wp\/2008\/04\/09\/tcdraftpost-2\/","title":{"rendered":"\uc11c\ube14\ub81b + JDBC \uc5f0\ub3d9\uc2dc \ucf54\ub529 \uace0\ub824\uc0ac\ud56d -\uc81c2\ud0c4-"},"content":{"rendered":"<p>1\ud0c4\uc5d0 \uc774\uc5b4 2\ud0c4\ub3c4 \uac11\ub2c8\ub2e4.<\/p>\n<p>========================================================================<\/p>\n<p>\uc11c\ube14\ub81b + JDBC \uc5f0\ub3d9\uc2dc \ucf54\ub529 \uace0\ub824\uc0ac\ud56d -\uc81c2\ud0c4-<br \/>[JDBC Connection Pooling]<\/p>\n<p>\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.01.19<br \/>\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.03.20(\uc0d8\ud50c\uc608\uc81c\ucd94\uac00)<br \/>\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.10.22(\ub514\ubc84\uae45\uc744 \uc704\ud55c \ub85c\uc9c1\ucd94\uac00)<br \/>\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.10.29(Oracle JDBC2.0 \uc0d8\ud50c\ucd94\uac00)<br \/>\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.11.08(\uc724\ud55c\uc131\ub2d8 \ub3c4\uc6c0 OracleConnectionCacheImpl \uc18c\uc2a4\uc218\uc815)<br \/>\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.11.09(Trace\/Debugging\uc744 \uc704\ud55c \uc7a5\ubb38\uc758 \uc0ac\uc871\uc744 \ub2f4)<\/p>\n<p>5. JDBC Connection Pooling \uc744 \uc65c \uc0ac\uc6a9\ud574\uc57c \ud558\ub294\uac00 ?<\/p>\n<p>&nbsp;Pooling \uc774\ub780 \uc6a9\uc5b4\ub294 \uc77c\ubc18\uc801\uc778 \uc6a9\uc5b4\uc785\ub2c8\ub2e4. Socket Connection Pooling, Thread <br \/>&nbsp;Pooling, Resource Pooling \ub4f1 &#8220;\uc5b4\ub5a4 \uc790\uc6d0\uc744 \ubbf8\ub9ac Pool \uc5d0 \uc900\ube44\ud574\ub450\uace0 \uc694\uccad\uc2dc Pool\uc5d0<br \/>&nbsp;\uc788\ub294 \uc790\uc6d0\uc744 \uace7\ubc14\ub85c \uaebc\ub0b4\uc5b4 \uc81c\uacf5\ud558\ub294 \uae30\ub2a5&#8221;\uc778 \uac70\uc8e0.<\/p>\n<p>&nbsp;JDBC Connection Pooling \uc740 JDBC\ub97c \uc774\uc6a9\ud558\uc5ec \uc790\ubc14\uc5d0\uc11c DB\uc5f0\uacb0\uc744 \ud560 \ub54c, \ubbf8\ub9ac Pool\uc5d0<br \/>&nbsp;\ubb3c\ub9ac\uc801\uc778 DB \uc5f0\uacb0\uc744 \uc77c\uc815\uac1c\uc218 \uc720\uc9c0\ud558\uc5ec \ub450\uc5c8\ub2e4\uac00 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc694\uad6c\ud560 \ub54c \uace7\ubc14\ub85c<br \/>&nbsp;\uc81c\uacf5\ud574\uc8fc\ub294 \uae30\ub2a5\uc744 \uc77c\uceeb\ub294 \uc6a9\uc5b4\uc785\ub2c8\ub2e4. JDBC \uc5f0\uacb0\uc2dc\uc5d0, (DB \uc885\ub958\ub9c8\ub2e4, \uadf8\ub9ac\uace0 JDBC <br \/>&nbsp;Driver\uc758 \ud0c0\uc785\uc5d0 \ub530\ub77c \uc57d\uac04\uc529 \ub2e4\ub974\uae34 \ud558\uc9c0\ub9cc ) \ub300\ub7b5 200-400 ms \uac00 \uc18c\uc694 \ub429\ub2c8\ub2e4. \uae30\uaecf<br \/>&nbsp;0.2 \ucd08 0.4 \ucd08 \ubc16\uc5d0 \uc548\ub418\ub294 \ub370 \ubb34\uc2a8 \ubb38\uc81c\ub0d0 \ub77c\uace0 \ubc18\ubb38\ud560\uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;<br \/>&nbsp;\ud558\uc9c0\ub9cc, \uc704 \uc2dc\uac04\uc740 \ud558\ub098\uc758 \uc5f0\uacb0\uc744 \uc2dc\ub3c4\ud560 \ub54c \uadf8\ub7ec\ud558\uace0, 100 &#8211; 200\uac1c\ub97c \ub3d9\uc2dc\uc5d0 \uc5f0\uacb0\uc744<br \/>&nbsp;\uc2dc\ub3c4\ud558\uba74 \uc598\uae30\uac00 \uc644\uc804\ud788 \ub2ec\ub77c\uc9d1\ub2c8\ub2e4.<\/p>\n<p>&nbsp;\uc544\ub798\ub294 \uc9c1\uc811 JDBC \ub4dc\ub77c\uc774\ubc84\ub97c \uc774\uc6a9\ud558\uc5ec \uc5f0\uacb0\ud560 \ub54c\uc640 JDBC Connection Pooling \uc744 \uc0ac\uc6a9 <br \/>&nbsp;\ud560 \ub54c\uc758 \uc131\ub2a5 \ube44\uad50 \uacb0\uacfc\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;\ud14c\uc2a4\ud2b8 \ud658\uacbd<br \/>&nbsp;LG-IBM 570E Notebook(CPU:???MHz , MEM:320MB)<br \/>&nbsp;Windows NT 4.0 Service Pack 6 <br \/>&nbsp;IBM WebSphere 3.0.2.1 + e-Fixes<br \/>&nbsp;IBM HTTP Server 1.3.6.2<br \/>&nbsp;IBM UDB DB2 6.1<\/p>\n<p>&nbsp;\uc544\ub798\uc5d0 \ucca8\ubd80\ud55c \ud30c\uc77c\ub294 \uc790\ub8cc\ub97c \ub9cc\ub4e4\ub54c \uc0ac\uc6a9\ud55c JSP\uc18c\uc2a4\uc785\ub2c8\ub2e4. (\ucca8\ubd80\ud30c\uc77c\ucc38\uc870)<\/p>\n<p>&nbsp;[HttpConn.java] \uac04\ub2e8\ud55c Stress Test \ud504\ub85c\uadf8\ub7a8<\/p>\n<p>&nbsp;\uc544\ub798\uc758 \uc218\uce58\ub294 \uc774 \ubb38\uc11c \uc774\uc678\uc5d0\ub294 \ub2e4\ub978 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud558\uc2dc\uba74 \uc548\ub429\ub2c8\ub2e4. \ud14c\uc2a4\ud2b8\ub97c \uc800\uc758<br \/>&nbsp;\uac1c\uc778 \ub178\ud2b8\ubd81\uc5d0\uc11c \uce21\uc815\ud55c \uac83\uc774\uace0, \ub610\ud55c \ud14c\uc2a4\ud2b8 \ud504\ub85c\uadf8\ub7a8 \uc5ed\uc2dc \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\ud55c \uac83\uc778<br \/>&nbsp;\ub9cc\ud07c, \uacf5\uc815\uc131\uc774\ub098 \uc218\uce58\uc5d0 \ub300\ud55c \uc2e0\ub8b0\ub97c \ubd80\uc5ec\ud560 \uc218\ub294 \uc5c6\uc2b5\ub2c8\ub2e4. <br \/>&nbsp;\uadf8\ub7ec\ub098 JDBC Connection Pooling \uc801\uc6a9 \uc5ec\ubd80\uc5d0 \ub530\ub978 \uc0c1\ub300\uc801\uc778 \ucc28\uc774\ub97c \uc124\uba85\ud558\uae30\uc5d0\ub294 <br \/>&nbsp;\ucda9\ubd84\ud560 \uac83 \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p>&nbsp;\ud14c\uc2a4\ud2b8 \uacb0\uacfc<\/p>\n<p>&nbsp;&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>&nbsp;\ub9e4\ubc88 \uc9c1\uc811 JDBC Driver \uc5f0\uacb0\ud558\ub294 \uacbd\uc6b0<br \/>&nbsp;java HttpConn http:\/\/localhost\/db_jdbc.jsp -c &lt;\ub3d9\uc2dc\uc720\uc800\uc218&gt; -n &lt;\ud638\ucd9c\ud69f\uc218&gt; -s 0<\/p>\n<p>&nbsp;TOTAL( 1,10)&nbsp; iteration=10 ,&nbsp; average=249.40 (ms), &nbsp; TPS=3.93<br \/>&nbsp;TOTAL(50,10)&nbsp; iteration=500 , average=9,149.84 (ms), TPS=4.83<br \/>&nbsp;TOTAL(100,10)&nbsp; iteration=1000 , average=17,550.76 (ms), TPS=5.27<br \/>&nbsp;TOTAL(200,10)&nbsp; iteration=2000 , average=38,479.03 (ms), TPS=4.89<br \/>&nbsp;TOTAL(300,10)&nbsp; iteration=3000 , average=56,601.89 (ms), TPS=5.01<\/p>\n<p>&nbsp;&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>&nbsp;DB Connection Pooing \uc744 \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0<br \/>&nbsp;java HttpConn http:\/\/localhost\/db_pool_cache.jsp -c &lt;\ub3d9\uc2dc\uc720\uc800\uc218&gt; -n &lt;\ud638\ucd9c\ud69f\uc218&gt; -s 0<\/p>\n<p>&nbsp;TOTAL(1,10)&nbsp; iteration=10 , average=39.00 (ms), TPS=23.26<br \/>&nbsp;TOTAL(1,10)&nbsp; iteration=10 , average=37.10 (ms), TPS=24.33<br \/>&nbsp;TOTAL(50,10)&nbsp; iteration=500 , average=767.36 (ms), TPS=45.27<br \/>&nbsp;TOTAL(50,10)&nbsp; iteration=500 , average=568.76 (ms), TPS=61.26<br \/>&nbsp;TOTAL(50,10)&nbsp; iteration=500 , average=586.51 (ms), TPS=59.79<br \/>&nbsp;TOTAL(50,10)&nbsp; iteration=500 , average=463.78 (ms), TPS=67.02<br \/>&nbsp;TOTAL(100,10)&nbsp; iteration=1000 , average=1,250.07 (ms), TPS=57.32<br \/>&nbsp;TOTAL(100,10)&nbsp; iteration=1000 , average=1,022.75 (ms), TPS=61.22<br \/>&nbsp;TOTAL(200,10)&nbsp; iteration=1462 , average=1,875.68 (ms), TPS=61.99<br \/>&nbsp;TOTAL(300,10)&nbsp; iteration=1824 , average=2,345.42 (ms), TPS=61.51<\/p>\n<p>&nbsp;NOTE: average:\ud3c9\uade0\uc218\ud589\uc2dc\uac04, TPS:\ucd08\ub2f9 \ucc98\ub9ac\uac74\uc218<br \/>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>&nbsp;\uc989, JDBC Driver \ub97c \uc774\uc6a9\ud558\uc5ec \uc9c1\uc811 DB\uc5f0\uacb0\uc744 \ud558\ub294 \uad6c\uc870\ub294 \uae30\uaecf 1\ucd08\uc5d0 5\uac1c\uc758 \uc694\uccad\uc744<br \/>&nbsp;\ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \ub2a5\ub825\uc774 \uc788\ub294 \ubc18\uba74, DB Connection Pooling \uc744 \uc0ac\uc6a9\ud560 \uacbd\uc6b0\ub294 \ucd08\ub2f9<br \/>&nbsp;60\uc5ec\uac1c\uc758 \uc694\uccad\uc744 \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uac83\uc73c\ub85c \ub098\ud0c0\ub0ac\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;12\ubc30\uc758 \uc131\ub2a5\ud5a5\uc0c1\uc744 \uac00\uc838\uc628\uac70\uc8e0. (\uc774 \uc218\uce58\ub294 H\/W\uae30\uc885\uacfc \uce21\uc815\ubc29\ubc95, \uadf8\ub9ac\uace0 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0<br \/>&nbsp;\ub530\ub77c \ub2e4\ub974\uac8c \ub098\uc624\ub2c8 \uc774 \uc218\uce58\uc790\uccb4\uc5d0 \ub108\ubb34 \ud070 \uc758\ubbf8\ub97c \ub450\uc9c4 \ub9c8\uc138\uc694)<\/p>\n<p>&nbsp;\uc8fc\uc758: \ud754\ud788 &#8220;\uc131\ub2a5(Performance)&#8221;\uc744 \ub098\ud0c0\ub0bc \ub54c, \uc751\ub2f5\uc2dc\uac04\uc744 \uac00\uc9c0\uace0 \uc598\uae30\ud558\ub294 \uacbd\ud5a5\uc774<br \/>&nbsp; \uc788\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uc751\ub2f5\uc2dc\uac04\uc774\ub77c\ub294 \uac83\uc740 ActiveUser\uc218\uac00 \uc99d\uac00\ud558\uba74 \ub2f9\uc5f0\ud788 \uadf8\uc5d0 \ub530\ub77c<br \/>&nbsp; \ub290\ub824\uc9c0\uac8c \ub429\ub2c8\ub2e4. \ubc18\uba74 &#8220;\ub2e8\uc704\uc2dc\uac04\ub2f9 \ucc98\ub9ac\uac74\uc218&#8221;\uc778 TPS(Transaction Per Second) \ud639\uc740<br \/>&nbsp; RPS(Request Per Second)\ub294 ActiveUser\ub97c \uc9c0\uc18d\uc801\uc73c\ub85c \ub04c\uc5b4\uc62c\ub824 \uc784\uacc4\uc810\uc744 \ub118\uc5b4\uc11c\uba74,<br \/>&nbsp; \ud2b9\uc815\uc218\uce58 \uc774\uc0c1\uc744 \uc62c\ub77c\uac00\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \ub530\ub77c\uc11c \uc131\ub2a5\uc744 \uc598\uae30\ud560 \ub550 \ud3c9\uade0\uc751\ub2f5\uc2dc\uac04\uc774 \uc544\ub2c8\ub77c<br \/>&nbsp; &#8220;\ub2e8\uc704\uc2dc\uac04\ub2f9 \ucd5c\ub300\ucc98\ub9ac\uac74\uc218&#8221;\ub97c \uc774\uc57c\uae30 \ud558\uc154\uc57c \ud569\ub2c8\ub2e4.<br \/>&nbsp; \uc131\ub2a5(Performance)\uc758 \uc815\uc758(Definition)\uc740 &#8220;\ub2e8\uc704\uc2dc\uac04\ub2f9 \ucd5c\ub300\ucc98\ub9ac\uac74\uc218&#8221;\uc784\uc744 \uc8fc\uc9c0\ud558\uc138\uc694.<br \/>&nbsp; \uc131\ub2a5\uc5d0 \uad00\ub828\ud55c \uc774\ub860\uc740 \uc544\ub798\uc758 \ubb38\uc11c\ub97c \ud1b5\ud574, \ud568\uaed8 \uc5f0\uad6c\ud558\uc2dc\uc9c0\uc694.<br \/>&nbsp; [\uac15\uc88c]\uc6f9\uae30\ubc18\uc2dc\uc2a4\ud15c\ud558\uc5d0\uc11c\uc758 \uc131\ub2a5\uc5d0 \ub300\ud55c \uc774\ub860\uc801 \uace0\ucc30<br \/>&nbsp; http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=resource&amp;b=consult&amp;c=r_p&amp;n=1008701211<\/p>\n<p>&nbsp;PS: IBM WebSphere V3 \uc758 \uacbd\uc6b0, Connection \uc744 \uac00\uc838\uc62c \ub54c, JNDI\ub97c \uc0ac\uc6a9\ud558\uac8c \ub418\ub294\ub370<br \/>&nbsp;&nbsp; \uc774\ub54c \uc0ac\uc6a9\ub418\ub294 DataSource \uac1d\uccb4\ub97c \ub9e4\ubc88 initialContext.lookup() \uc744 \ud1b5\ud574 \uac00\uc838\uc624\uac8c<br \/>&nbsp;&nbsp; \ub418\uba74, \uae09\uaca9\ud55c \uc131\ub2a5\uc800\ud558\uac00 \uc77c\uc5b4\ub0a9\ub2c8\ub2e4.(NOTE: V4\ubd80\ud130\ub294 \ub0b4\ubd80\uc801\uc73c\ub85c cache\ub97c \uc0ac\uc6a9\ud558\uc5ec<br \/>&nbsp;&nbsp; \uc131\ub2a5\uc774 \ubcf4\ub2e4 \ud5a5\uc0c1\ub418\uc5c8\uc2b5\ub2c8\ub2e4)<br \/>&nbsp;&nbsp; DataSource\ub97c \ub9e4 \uc694\uccad\uc2dc\ub9c8\ub2e4 lookup \ud560 \uacbd\uc6b0 \ub2e4\uc74c\uacfc \uac19\uc740 \uacb0\uacfc\ub97c \uac00\uc838\uc654\uc2b5\ub2c8\ub2e4.<\/p>\n<p>&nbsp;&nbsp; java HttpConn http:\/\/localhost\/db_pool.jsp -c &lt;\ub3d9\uc2dc\uc720\uc800\uc218&gt; -n &lt;\ud638\ucd9c\ud69f\uc218&gt; -s 0<\/p>\n<p>&nbsp;&nbsp; TOTAL(1,10)&nbsp; iteration=10 , average=80.00 (ms), TPS=11.61<br \/>&nbsp;&nbsp; TOTAL(50,10)&nbsp; iteration=500 , average=2,468.30 (ms), TPS=16.98<br \/>&nbsp;&nbsp; TOTAL(50,10)&nbsp; iteration=500 , average=2,010.43 (ms), TPS=18.18<br \/>&nbsp;&nbsp; TOTAL(100,10)&nbsp; iteration=1000 , average=4,377.24 (ms), TPS=18.16<br \/>&nbsp;&nbsp; TOTAL(200,10)&nbsp; iteration=1937 , average=8,991.89 (ms), TPS=18.12<\/p>\n<p>&nbsp;&nbsp; TPS \uac00 18 \uc774\ub2c8\uae4c DataSource Cache \ub97c \uc0ac\uc6a9\ud560 \ub54c \ubcf4\ub2e4 1\/3 \uc131\ub2a5\ubc16\uc5d0 \ub098\uc624\uc9c0 \uc54a\ub294 \uac70\uc8e0.<\/p>\n<p>6. JDBC Connection Pooling \uc744 \uc0ac\uc6a9\ud558\uc5ec \ucf54\ub529\ud560 \ub54c \uace0\ub824\uc0ac\ud56d<\/p>\n<p>&nbsp;JDBC Connecting Pooling\uc740 JDBC 1.0 \uc2a4\ud399\uc0c1\uc5d0 \uc5b8\uae09\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub2e4\ubcf4\ub2c8<br \/>&nbsp;BEA WebLogic, IBM WebSphere, Oracle OAS, Inprise Server, Sun iPlanet \ub4f1 \uc5b4\ud50c\ub9ac\ucf00<br \/>&nbsp;\uc774\uc158 \uc11c\ubc84\ub77c\uace0 \ubd88\ub9ac\ub294 \uc81c\ud488\ub4e4\ub9c8\ub2e4 \uadf8 \uad6c\ud604\ubc29\uc2dd\uc774 \ub2ec\ub790\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;\uc778\ud130\ub137\uc5d0\uc11c \ub3cc\uc544\ub2e4\ub2c8\ub294 Hans Bergsten \uc774 \ub9cc\ub4e0 DBConnectionManager.java \ub3c4 \uadf8\ub807\uace0,<br \/>&nbsp;JDF \uc5d0 \ud3ec\ud568\ub418\uc5b4 \uc788\ub294 \ud328\ud0a4\uc9c0\ub3c4 \uadf8\ub807\uace0 \uac01\uc790 \ub3c5\ud2b9\ud55c \ubc29\uc2dd\uc73c\ub85c \uac1c\ubc1c\uc774 \ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;<br \/>&nbsp;JDBC\ub97c \uc774\uc6a9\ud558\uc5ec DB\uc5f0\uacb0\ud558\ub294 \ub300\ud45c\uc801\uc778 \ucf54\ub529 \uc608\ub97c \ub4e4\uba74 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;<br \/>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;[BEA WebLogic Application Server]<\/p>\n<p>&nbsp; &nbsp; import java.sql.*;<\/p>\n<p>&nbsp; &nbsp; \/\/ Driver loading needed.<br \/>&nbsp; &nbsp; static {<br \/>&nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; Class.forName(&#8220;weblogic.jdbc.pool.Driver&#8221;).newInstance(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; catch (Exception e) { <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; &#8230;&#8230;<\/p>\n<p>&nbsp; &nbsp; Connection conn = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; conn = DriverManager.getConnection(&#8220;jdbc:weblogic:pool:&lt;pool_name&gt;&#8221;, null);<br \/>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( conn != null ) try{conn.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;IBM WebSphere Application Server 3.0.2.x \/ 3.5.x<\/p>\n<p>&nbsp; &nbsp; \/* IBM WebSphere 3.0.2.x for JDK 1.1.8 *\/<br \/>&nbsp; &nbsp; \/\/import java.sql.*;<br \/>&nbsp; &nbsp; \/\/import javax.naming.*;<br \/>&nbsp; &nbsp; \/\/import com.ibm.ejs.dbm.jdbcext.*;<br \/>&nbsp; &nbsp; \/\/import com.ibm.db2.jdbc.app.stdext.javax.sql.*;<\/p>\n<p>&nbsp; &nbsp; \/* IBM WebSphere 3.5.x for JDK 1.2.2 *\/<br \/>&nbsp; &nbsp; import java.sql.*;<br \/>&nbsp; &nbsp; import javax.sql.*;<br \/>&nbsp; &nbsp; import javax.naming.*;<\/p>\n<p>&nbsp; &nbsp; \/\/ DataSource Cache \uc0ac\uc6a9\uc744 \uc704\ud55c ds \uac1d\uccb4 static \ucd08\uae30\ud654<br \/>&nbsp; &nbsp; private static DataSource ds = null;<br \/>&nbsp; &nbsp; static {<br \/>&nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; java.util.Hashtable props = new java.util.Hashtable();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; props.put(Context.INITIAL_CONTEXT_FACTORY, <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;com.ibm.ejs.ns.jndi.CNInitialContextFactory&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; Context ctx = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ctx = new InitialContext(props);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ds = (DataSource)ctx.lookup(&#8220;jdbc\/&lt;data_source_name&gt;&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( ctx != null ) ctx.close();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; catch (Exception e) {<br \/>&nbsp; &nbsp; &nbsp;&nbsp; &#8230;.<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; &#8230;..&nbsp; &nbsp;<\/p>\n<p>&nbsp; &nbsp; Connection conn = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; conn = ds.getConnection(&#8220;userid&#8221;, &#8220;password&#8221;);<br \/>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( conn != null ) try{conn.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;IBM WebSphere Application Server 2.0.x<br \/>&nbsp; <br \/>&nbsp; &nbsp; import java.sql.*;<br \/>&nbsp; &nbsp; import com.ibm.servlet.connmgr.*;<\/p>\n<p>&nbsp; &nbsp; \/\/ ConnMgr Cache \uc0ac\uc6a9\uc744 \uc704\ud55c connMgr \uac1d\uccb4 static \ucd08\uae30\ud654<\/p>\n<p>&nbsp; &nbsp; private static IBMConnMgr connMgr = null;<br \/>&nbsp; &nbsp; private static IBMConnSpec &nbsp; &nbsp;spec = null;<br \/>&nbsp; &nbsp; static {<br \/>&nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; String poolName = &#8220;JdbcDb2&#8221;;&nbsp; \/\/ defined in WebSphere Admin Console<br \/>&nbsp; &nbsp; &nbsp; &nbsp; spec = new IBMJdbcConnSpec(poolName, false, &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;com.ibm.db2.jdbc.app.DB2Driver&#8221;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;jdbc:db2:&lt;db_name&gt;&#8221;, &nbsp; \/\/ &#8220;jdbc:db2:\/\/ip_address:6789\/&lt;db_name&gt;&#8221;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;userid&#8221;,&#8221;password&#8221;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; connMgr = IBMConnMgrUtil.getIBMConnMgr();<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; &#8230;..<\/p>\n<p>&nbsp; &nbsp; IBMJdbcConn cmConn = null; \/\/ &#8220;cm&#8221; maybe stands for Connection Manager.<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; cmConn = (IBMJdbcConn)connMgr.getIBMConnection(spec); &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; Connection conn = jdbcConn.getJdbcConnection();<br \/>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( cmConn != null ) try{cmConn.releaseIBMConnection();}catch(Exception e){}<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; \/\/ NOTE: DO NOT &#8220;conn.close();&#8221; !!<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;Oracle OSDK(Oracle Servlet Development Kit)<\/p>\n<p>&nbsp; &nbsp; import java.sql.*;<br \/>&nbsp; &nbsp; import oracle.ec.ctx.*;<\/p>\n<p>&nbsp; &nbsp; &#8230;..<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp; &nbsp; oracle.ec.ctx.Trx trx = null;<br \/>&nbsp; &nbsp; Connection conn = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; oracle.ec.ctx.TrxCtx ctx = oracle.ec.ctx.TrxCtx.getTrxCtx();<br \/>&nbsp; &nbsp; &nbsp; trx = ctx.getTrx();<br \/>&nbsp; &nbsp; &nbsp; conn = trx.getConnection(&#8220;&lt;pool_name&gt;&#8221;);<br \/>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( conn != null ) try{ trx.close(conn,&#8221;&lt;pool_name&gt;&#8221;);}catch(Exception e){}<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; \/\/ NOTE: DO NOT &#8220;conn.close();&#8221; !!<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;Hans Bergsten \uc758 DBConnectionManager.java<\/p>\n<p>&nbsp; &nbsp; import java.sql.*;<\/p>\n<p>&nbsp; &nbsp; &#8230;..<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp; &nbsp; db.DBConnectionManager connMgr = null;<br \/>&nbsp; &nbsp; Connection conn = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; connMgr = db.DBConnectionManager.getInstance();<br \/>&nbsp; &nbsp; &nbsp; conn = connMgr.getConnection(&#8220;&lt;pool_name&gt;&#8221;);<br \/>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( conn != null ) connMgr.freeConnection(&#8220;&lt;pool_name&gt;&#8221;, conn);<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; \/\/ NOTE: DO NOT &#8220;conn.close();&#8221; !!<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;JDF \uc758 DB Connection Pool Framework<\/p>\n<p>&nbsp; &nbsp; import java.sql.*;<br \/>&nbsp; &nbsp; import com.lgeds.jdf.*;<br \/>&nbsp; &nbsp; import com.lgeds.jdf.db.*;<br \/>&nbsp; &nbsp; import com.lgeds.jdf.db.pool.*;<\/p>\n<p>&nbsp; &nbsp; private static com.lgeds.jdf.db.pool.JdbcConnSpec spec = null;<br \/>&nbsp; &nbsp; static {<br \/>&nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; com.lgeds.jdf.Config conf = new com.lgeds.jdf.Configuration();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; spec =&nbsp; new com.lgeds.jdf.db.pool.JdbcConnSpec(<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conf.get(&#8220;gov.mpb.pbf.db.emp.driver&#8221;),<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conf.get(&#8220;gov.mpb.pbf.db.emp.url&#8221;),<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conf.get(&#8220;gov.mpb.pbf.db.emp.user&#8221;),<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conf.get(&#8220;gov.mpb.pbf.db.emp.password&#8221;)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; &#8230;..<\/p>\n<p>&nbsp; &nbsp; PoolConnection poolConn = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; ConnMgr mgr = ConnMgrUtil.getConnMgr();<br \/>&nbsp; &nbsp; &nbsp; poolConn = mgr.getPoolConnection(spec);<br \/>&nbsp; &nbsp; &nbsp; Connection conn = poolConnection.getConnection();<br \/>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( poolConn != null ) poolConn.release();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; \/\/ NOTE: DO NOT &#8220;conn.close();&#8221; !!<\/p>\n<p>&nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>&nbsp;\uc5ec\uae30\uc11c \ud558\uace0\ud508 \uc598\uae30\ub294 DB Connection Pool \uc744 \uad6c\ud604\ud558\ub294 \ubc29\uc2dd\uc5d0 \ub530\ub77c\uc11c \uac1c\ubc1c\uc790\uc758 \uc18c\uc2a4\ub3c4<br \/>&nbsp;\uc804\ubd80 \uc81c \uac01\uae30 \ub2e4\ub978 API\ub97c \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4.<br \/>&nbsp;\ud504\ub85c\uc81d\ud2b8\ub97c \uc774\uacf3 \uc800\uacf3 \ub6f0\uc5b4 \ubcf8 \ubd84\uc740 \uc544\uc2dc\uaca0\uc9c0\ub9cc, \ub9e4 \ud504\ub85c\uc81d\ud2b8\ub9c8\ub098 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158 \uc11c\ubc84\uac00<br \/>&nbsp;\ub2e4\ub974\uace0 \uc9c0\ub09c \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ub41c \uc18c\uc2a4\ub97c \uc0c8 \ud504\ub85c\uc81d\ud2b8\uc5d0 \uadf8\ub300\ub85c \uc801\uc6a9\ud558\uc9c0 \ubabb\ud558\uac8c \ub429\ub2c8\ub2e4.<br \/>&nbsp;JDBC \uad00\ub828 API\uac00 \ub2e4\ub974\uae30 \ub54c\ubb38\uc774\uc8e0.<br \/>&nbsp;\uac19\uc740 \uc81c\ud488\uc77c\uc9c0\ub77c\ub3c4 \ubc84\uc804\uc5c5\uc774 \ub418\uba74\uc11c API\uac00 \ubcc0\ud574\ubc84\ub9ac\ub294 \uacbd\uc6b0\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uba74,<br \/>&nbsp;IBM WebSphere \ubc84\uc804 2.0.x\uc5d0\uc11c \ubc84\uc804 3.0.x\ub85c\uc758 \uc804\ud658\ud560 \ub54c, DB \uc5f0\uacb0\uc744 \uc704\ud55c API\uac00<br \/>&nbsp;\ubcc0\ud574\ubc84\ub824 \uae30\uc874\uc5d0 \uac1c\ubc1c\ud574\ub454 400 \uc5ec\uac1c\uc758 \uc18c\uc2a4\ub97c \ub2e4 \ub72f\uc5b4 \uace0\uccd0\uc57c \ud558\ub294 \uac83\uacfc \uac19\uc740 \uc0c1\ud669\uc774<br \/>&nbsp;\ubc8c\uc5b4\uc9c8 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;\ub2f7\ucef4\uc5c5\uccb4\uc5d0\uc11c \ud2b9\uc815 \ud328\ud0a4\uc9c0 \uc81c\ud488\uc744 \ub9cc\ub4e4\ub54c\ub3c4 \ub9c8\ucc2c\uac00\uc9c0 \uc785\ub2c8\ub2e4. \uc790\uc0ac\uc758 \uc81c\ud488\uc774 \uc5b4\ub5a0\ud55c<br \/>&nbsp;\uc5b4\ud50c\ub9ac\ucf00\uc774\uc158 \uc11c\ubc84\uc5d0\uc11c \ub3d9\uc791\ud558\ub3c4\ub85d \ud574\uc57c \ud558\ub290\ub0d0\uc5d0 \ub530\ub77c \ucf54\ub529\ud560 API\uac00 \ub2ec\ub77c\uc9c0\ub2c8 \uc18c\uc2a4\ub97c<br \/>&nbsp;\ub9e4\ubc88 \ubcc0\uacbd\ud574\uc57c\ub9cc \ud558\uaca0\uace0, \ud2b9\uc815 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158 \uc11c\ubc84\uc5d0\ub9cc \ub3d9\uc791\ud558\uac8c \ud558\ub824\ub2c8 \ub9c8\ucf13\uc2dc\uc7a5\uc774<br \/>&nbsp;\uc881\uc544\uc9c0\uac8c \ub429\ub2c8\ub2e4.<br \/>&nbsp;IBM WebSphere, BEA WebLogic \ubfd0\ub9cc \uc544\ub2c8\ub77c Apache JServ \ub098 JRun, \ud639\uc740 Tomcat \uc5d0\uc11c\ub3c4<br \/>&nbsp;\uc27d\uac8c \ud3ec\ud305\ud558\uae38 \uc6d0\ud560 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp;\uc774\uac83\uc744 \ud574\uacb0\ud558\ub294 \ubc29\ubc95\uc740 \uc6b0\ub9ac\ub4e4 &#8220;SE(System Engineer)&#8221;\ub9cc\uc758 \uace0\uc720\ud55c &#8220;Connection Adapter<br \/>&nbsp;\ud074\ub798\uc2a4&#8221;\ub97c \ub9cc\ub4e4\uc5b4\uc11c \uc0ac\uc6a9\ud558\ub294 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp;\uc608\ub97c \ub4e4\uc5b4 \uac1c\ubc1c\uc790\uc758 \uc18c\uc2a4\ub294 \uc774\uc81c \ud56d\uc0c1 \ub2e4\uc74c\uacfc \uac19\uc740 \uc720\ud615\uc73c\ub85c \ucf54\ub529\ub418\uba74 \uc5b4\ub5bb\uaca0\uc2b5\ub2c8\uae4c ?<\/p>\n<p>&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; ConnectionResource resource = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; resource = new ConnectionResource();<br \/>&nbsp; &nbsp; &nbsp; Connection conn = resource.getConnection();<\/p>\n<p>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;.&#8221;);<br \/>&nbsp; &nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; rs.close();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( resource != null ) resource.release();<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; \/\/ NOTE: DO NOT &#8220;conn.close();&#8221; !!<br \/>&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp;\uc774 \ub54c ConnectionResource \ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \ud615\uc2dd\uc73c\ub85c \ub204\uad70\uac00 \ud55c\ubd84\uc774 \ub9cc\ub4e4\uc5b4 \ub450\uba74 \ub418\uaca0\uc8e0.<\/p>\n<p>&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; &nbsp; import java.sql.*;<br \/>&nbsp; &nbsp; public class ConnectionResource<br \/>&nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; private java.sql.Connection conn = null;<br \/>&nbsp; &nbsp; &nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &#8230;&#8230;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conn =&nbsp; &#8230;.. GET Connection by Connection Pooling API<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; public Connection getConnection() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return conn;<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; public void release(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; \/\/ release conn into &#8220;Connection Pool&#8221;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &#8230;&#8230;.<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp; \uc608\ub97c \ub4e4\uc5b4 IBM WebSphere Version 3.0.2.x \uc758 \uacbd\uc6b0\ub97c \ub4e0\ub2e4\uba74 \ub2e4\uc74c\uacfc \uac19\uc774 \ub420 \uac81\ub2c8\ub2e4.<\/p>\n<p>&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; package org.jsn.connpool;<br \/>&nbsp; \/*<br \/>&nbsp;&nbsp; * ConnectionResource V 1.0<br \/>&nbsp;&nbsp; * JDBC Connection Pool Adapter for IBM WebSphere V 3.0.x\/3.5.x<br \/>&nbsp;&nbsp; * Author: WonYoung Lee, javaservice@hanmail.net, 011-898-7904<br \/>&nbsp;&nbsp; * Last Modified : 2000.11.10<br \/>&nbsp;&nbsp; * NOTICS: You can re-distribute or copy this source code freely, <br \/>&nbsp;&nbsp; * &nbsp; &nbsp; &nbsp; &nbsp; you can NOT remove the above subscriptions.<br \/>&nbsp; *\/<\/p>\n<p>&nbsp; \/* IBM WebSphere 3.0.2.x for JDK 1.1.8 *\/<br \/>&nbsp; \/\/import java.sql.*;<br \/>&nbsp; \/\/import javax.naming.*;<br \/>&nbsp; \/\/import com.ibm.ejs.dbm.jdbcext.*;<br \/>&nbsp; \/\/import com.ibm.db2.jdbc.app.stdext.javax.sql.*;<\/p>\n<p>&nbsp; \/* IBM WebSphere 3.5.x for JDK 1.2.2 *\/<br \/>&nbsp; import java.sql.*;<br \/>&nbsp; import javax.sql.*;<br \/>&nbsp; import javax.naming.*;<\/p>\n<p>&nbsp; public class ConnectionResource<br \/>&nbsp; {<br \/>&nbsp; &nbsp;&nbsp; private static final String userid = &#8220;userid&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static final String password = &#8220;password&#8221;<br \/>&nbsp; &nbsp;&nbsp; private static final String datasource = &#8220;jdbc\/&lt;data_source_name&gt;&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static DataSource ds = null;<\/p>\n<p>&nbsp; &nbsp;&nbsp; private java.sql.Connection conn = null;<\/p>\n<p>&nbsp; &nbsp;&nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; &nbsp;&nbsp; synchronized ( ConnectionResource.class ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if ( ds == null ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; java.util.Hashtable props = new java.util.Hashtable();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; props.put(Context.INITIAL_CONTEXT_FACTORY, <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;com.ibm.ejs.ns.jndi.CNInitialContextFactory&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Context ctx = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ctx = new InitialContext(props);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ds = (DataSource)ctx.lookup(&#8220;jdbc\/&lt;data_source_name&gt;&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if ( ctx != null ) ctx.close();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp; &nbsp;&nbsp; conn =&nbsp; ds.getConnection( userid, password );<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public Connection getConnection() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn == null ) throw new Exception(&#8220;Connection is NOT avaiable !!&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public void release(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ release conn into &#8220;Connection Pool&#8221;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn != null ) try { conn.close(); }catch(Excepton e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = null;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp;&nbsp; }<br \/>&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<\/p>\n<p>&nbsp; <br \/>&nbsp; \ub9cc\uc57d Hans Bersten \uc758 DBConnectionManager.java \ub97c \uc774\uc6a9\ud55c Connection Pool \uc774\ub77c\uba74<br \/>&nbsp; \ub2e4\uc74c\uacfc \uac19\uc774 \ub9cc\ub4e4\uc5b4 \uc8fc\uba74 \ub429\ub2c8\ub2e4.<\/p>\n<p>&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp;&nbsp; package org.jsn.connpool;<br \/>&nbsp;&nbsp; import java.sql.*;<br \/>&nbsp;&nbsp; public class ConnectionResource<br \/>&nbsp;&nbsp; {<br \/>&nbsp; &nbsp; &nbsp; private String poolname = &#8220;&lt;pool_name&gt;&#8221;;<br \/>&nbsp; &nbsp; &nbsp; private Connection conn = null;<br \/>&nbsp; &nbsp; &nbsp; private db.DBConnectionManager connMgr = null;<\/p>\n<p>&nbsp; &nbsp; &nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; connMgr = db.DBConnectionManager.getInstance();<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conn =&nbsp; connMgr.getConnection(poolname);<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; public Connection getConnection() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if ( conn == null ) throw new Exception(&#8220;Connection is NOT avaiable !!&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return conn;<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; public void release(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if ( conn != null ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; \/\/ Dirty Transaction\uc744 rollback\uc2dc\ud0a4\ub294 \ubd80\ubd84\uc778\ub370, \uc0dd\ub7b5\ud558\uc154\ub3c4 \ub429\ub2c8\ub2e4.<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; boolean autoCommit = true;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; try{ autoCommit = conn.getAutoCommit(); }catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if ( autoCommit == false ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; try { conn.rollback(); }catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; try { conn.setAutoCommit(true); }catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; connMgr.freeConnection(poolname, conn);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; conn = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp; &nbsp; }<br \/>&nbsp;&nbsp; }<br \/>&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp; \ub610, Resin 1.2.x \uc758 \uacbd\uc6b0\ub77c\uba74 \ub2e4\uc74c\uacfc \uac19\uc774 \ub420 \uac81\ub2c8\ub2e4.<br \/>&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; package org.jsn.connpool;<br \/>&nbsp; \/*<br \/>&nbsp;&nbsp; * ConnectionResource V 1.0<br \/>&nbsp;&nbsp; * JDBC Connection Pool Adapter for Resin 1.2.x<br \/>&nbsp;&nbsp; * Author: WonYoung Lee, javaservice@hanmail.net, 011-898-7904<br \/>&nbsp;&nbsp; * Last Modified : 2000.10.18<br \/>&nbsp;&nbsp; * NOTICS: You can re-distribute or copy this source code freely, <br \/>&nbsp;&nbsp; * &nbsp; &nbsp; &nbsp; &nbsp; you can NOT remove the above subscriptions.<br \/>&nbsp; *\/<br \/>&nbsp; import java.sql.*;<br \/>&nbsp; import javax.sql.*;<br \/>&nbsp; import javax.naming.*;<br \/>&nbsp; public class ConnectionResource<br \/>&nbsp; {<br \/>&nbsp; &nbsp;&nbsp; private static final String datasource = &#8220;jdbc\/&lt;data_source_name&gt;&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static final String userid = &#8220;userid&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static final String password = &#8220;password&#8221;<br \/>&nbsp; &nbsp;&nbsp; private static DataSource ds = null;<\/p>\n<p>&nbsp; &nbsp;&nbsp; private java.sql.Connection conn = null;<\/p>\n<p>&nbsp; &nbsp;&nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; synchronized ( ConnectionResource.class ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( ds == null ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Context env = (Context) new InitialContext().lookup(&#8220;java:comp\/env&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ds = (DataSource) env.lookup(datasource);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn =&nbsp; ds.getConnection( userid, password );<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public Connection getConnection() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn == null ) throw new Exception(&#8220;Connection is NOT avaiable !!&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public void release(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ release conn into &#8220;Connection Pool&#8221;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn != null ) try { conn.close(); }catch(Excepton e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = null;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp;&nbsp; }<br \/>&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp; Oracle 8i(8.1.6\uc774\uc0c1)\uc5d0\uc11c Oracle\uc758 JDBC 2.0 Driver \uc790\uccb4\uac00 \uc81c\uacf5\ud558\ub294 Connection <br \/>&nbsp; Pool\uc744 \uc774\uc6a9\ud55c\ub2e4\uba74 \ub2e4\uc74c\uacfc \uac19\uc774 \ub420 \uac81\ub2c8\ub2e4.<br \/>&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; package org.jsn.connpool;<br \/>&nbsp; \/*<br \/>&nbsp;&nbsp; * ConnectionResource V 1.0<br \/>&nbsp;&nbsp; * JDBC Connection Pool Adapter for Oracle JDBC 2.0<br \/>&nbsp;&nbsp; * Author: WonYoung Lee, javaservice@hanmail.net, 011-898-7904<br \/>&nbsp;&nbsp; * Last Modified : 2001.10.29<br \/>&nbsp;&nbsp; * NOTICS: You can re-distribute or copy this source code freely, <br \/>&nbsp;&nbsp; * &nbsp; &nbsp; &nbsp; &nbsp; but you can NOT remove the above subscriptions.<br \/>&nbsp; *\/<br \/>&nbsp; import java.sql.*;<br \/>&nbsp; import javax.sql.*;<br \/>&nbsp; import oracle.jdbc.driver.*;<br \/>&nbsp; import oracle.jdbc.pool.*;<\/p>\n<p>&nbsp; public class ConnectionResource<br \/>&nbsp; {<br \/>&nbsp; &nbsp;&nbsp; private static final String dbUrl = &#8220;jdbc:oracle:thin@192.168.0.1:1521:ORCL&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static final String userid = &#8220;userid&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static final String password = &#8220;password&#8221;<br \/>&nbsp; &nbsp;&nbsp; private static OracleConnectionCacheImpl oraclePool = null;<br \/>&nbsp; &nbsp;&nbsp; private static boolean initialized = false;<\/p>\n<p>&nbsp; &nbsp;&nbsp; private java.sql.Connection conn = null;<\/p>\n<p>&nbsp; &nbsp;&nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; synchronized ( ConnectionResource.class ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( initialized == false ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oraclePool = new OracleConnectionCacheImpl();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oraclePool.setURL(dbUrl);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oraclePool.setUser(userid);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oraclePool.setPassword(password);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oraclePool.setMinLimit(10);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oraclePool.setMaxLimit(50);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/oraclePool.setCacheScheme(OracleConnectionCacheImpl.FIXED_WAIT_SCHEME);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ FIXED_WAIT_SCHEME(default), DYNAMIC_SCHEME, FIXED_RETURN_NULL_SCHEME<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/oraclePool.setStmtCacheSize(0); \/\/default is 0<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initialized = true;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = oraclePool.getConnection();<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public Connection getConnection() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn == null ) throw new Exception(&#8220;Connection is NOT avaiable !!&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public void release(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ release conn into &#8220;Connection Pool&#8221;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn != null ) try { conn.close(); }catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = null;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp;&nbsp; }<br \/>&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp; \ub610\ud55c \uc124\ub839 Connection Pool \uae30\ub2a5\uc744 \uc9c0\uae08\uc744 \uc0ac\uc6a9\uce58 \uc54a\ub354\ub77c\ub3c4 \ud5a5\ud6c4\uc5d0 \uc801\uc6a9\ud560 \uacc4\ud68d\uc774<br \/>&nbsp; \uc788\ub2e4\uba74, \uc6b0\uc120\uc740 \ub2e4\uc74c\uacfc \uac19\uc740 Connection Adapter \ud074\ub798\uc2a4\ub97c \ubbf8\ub9ac \ub9cc\ub4e4\uc5b4 \ub450\uace0 \uc774\ub97c<br \/>&nbsp; \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \ud6a8\uacfc\uc801\uc785\ub2c8\ub2e4. \ud5a5\ud6c4\uc5d0 \uc774 \ud074\ub798\uc2a4\ub9cc \uace0\uccd0\uc8fc\uba74 \ub418\ub2c8\uae4c\uc694.<br \/>&nbsp; Oracle Thin Driver\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; import java.sql.*;<br \/>&nbsp; public class ConnectionResource<br \/>&nbsp; {<br \/>&nbsp; &nbsp;&nbsp; private static final String userid = &#8220;userid&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static final String password = &#8220;password&#8221;<br \/>&nbsp; &nbsp;&nbsp; private static final String driver = &#8220;oracle.jdbc.driver.OracleDriver&#8221;<br \/>&nbsp; &nbsp;&nbsp; private static final String url = &#8220;jdbc:oracle:thin@192.168.0.1:1521:ORCL&#8221;;<br \/>&nbsp; &nbsp;&nbsp; private static boolean initialized = false;<\/p>\n<p>&nbsp; &nbsp;&nbsp; private java.sql.Connection conn = null;<\/p>\n<p>&nbsp; &nbsp;&nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; synchronized ( ConnectionResource.class ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( initialized == false ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Class.forName(driver);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initialized = true;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = DriverManager.getConnection( url, userid, password );<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public Connection getConnection() throws Exception {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn == null ) throw new Exception(&#8220;Connection is NOT avaiable !!&#8221;);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp; &nbsp;&nbsp; public void release(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn != null ) try { conn.close(); }catch(Excepton e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = null;<br \/>&nbsp; &nbsp;&nbsp; }<br \/>&nbsp;&nbsp; }<br \/>&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp;<br \/>&nbsp;\ud504\ub85c\uadf8\ub7a8\uc758 \uc720\ud615\uc774\ub098, \ud074\ub798\uc2a4 \uc774\ub984\uc774\uc57c \ubb50\ub4e0 \uc0c1\uad00\uc5c6\uc2b5\ub2c8\ub2e4. \uc704\ucc98\ub7fc \uc6b0\ub9ac\ub4e4\ub9cc\uc758 \uace0\uc720\ud55c<br \/>&nbsp;&#8220;Connection Adapter \ud074\ub798\uc2a4&#8221;\ub97c \ub9cc\ub4e4\uc5b4\uc11c \uc0ac\uc6a9\ud55c\ub2e4\ub294 \uac83\uc774 \uc911\uc694\ud558\uace0, \ub9cc\uc57d \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158<br \/>&nbsp;\uc11c\ubc84\uac00 \ubcc0\uacbd\ub41c\ub2e4\uac70\ub098, DB Connection Pooling \ubc29\uc2dd\uc774 \ub2ec\ub77c\uc9c0\uba74 \ud574\ub2f9 ConnectionResource<br \/>&nbsp;\ud074\ub798\uc2a4 \ub0b4\uc6a9\ub9cc \uc0b4\uc9dd \uace0\uccd0\uc8fc\uba74 \uac1c\ubc1c\uc790\uc758 \uc18c\uc2a4\ub294 \uc804\ud600 \uace0\uce58\uc9c0 \uc54a\uc544\ub3c4 \ub420 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp;NOTE: ConnectionResource \ud074\ub798\uc2a4\ub97c \ub9cc\ub4e4\ub54c \uc8fc\uc758\ud560 \uac83\uc740 \uc808\ub300 Exception \uc744 \ud074\ub798\uc2a4 \ub0b4\ubd80\uc5d0\uc11c<br \/>&nbsp;&nbsp; \uac00\ub85c\ucc44\uc5b4 \ubb34\uc2dc\ud558\uac8c \ud558\uc9c0 \ub9d0\ub77c\ub294 \uac83\uc785\ub2c8\ub2e4. \uadf8\ub0e5 \uadf8\ub300\ub85c throw \uac00 \uc77c\uc5b4\ub098\uac8c \uad6c\ud604\ud558\uc138\uc694.<br \/>&nbsp;&nbsp; \uc774\ub807\uac8c \ud558\uc154\uc57c\ub9cc \uac1c\ubc1c\uc790\uc758 \uc18c\uc2a4\uc5d0\uc11c &#8220;Exception \ucc98\ub9ac&#8221;\ub97c \ud560 \uc218 \uc788\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<p>&nbsp;NOTE2: ConnectionResource \ud074\ub798\uc2a4\ub97c \ub9cc\ub4e4\ub54c \ubc18\ub4dc\uc2dc package \ub97c \uc120\uc5b8\ud558\ub3c4\ub85d \ud558\uc138\uc694.<br \/>&nbsp;&nbsp; IBM WebSphere 3.0.x \uc758 \uacbd\uc6b0 JSP\uc5d0\uc11c &#8220;\uc11c\ube14\ub81b\ud074\ub798\uc2a4\ud328\uc2a4&#8221;\uc5d0 \uac78\ub824 \uc788\ub294 \ud074\ub798\uc2a4\ub97c<br \/>&nbsp;&nbsp; \ucc38\uc870\ud560 \ub54c, \uadf8 \ud074\ub798\uc2a4\uac00 default package \uc989 package \uac00 \uc5c6\ub294 \ud074\ub798\uc2a4\uc77c \uacbd\uc6b0 \ucc38\uc870\ud558\uc9c0<br \/>&nbsp;&nbsp; \ubabb\ud558\ub294 \ubc84\uadf8\uac00 \uc788\uc2b5\ub2c8\ub2e4. \ud1b5\uc0c1 &#8220;Bean&#8221;\uc774\ub77c \ubd88\ub9ac\ub294 \ud074\ub798\uc2a4 \uc5ed\uc2dc \uc870\uac74\uc5d0 \ub530\ub77c \uc778\uc2dd\ud558\uc9c0<br \/>&nbsp;&nbsp; \uc54a\uc744 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<br \/>&nbsp;&nbsp; \ud074\ub798\uc2a4 \ub2e4\uc9c0\uc778 \ubc0f \uc124\uacc4 \uc0c1\uc73c\ub85c \ubcf4\ub354\ub77c\ub3c4 package \ub97c \uc120\uc5b8\ud558\ub294 \uac83\uc774 \ubc14\ub78c\uc9c1\ud569\ub2c8\ub2e4.<\/p>\n<p>&nbsp;NOTE3: \uc704\uc5d0\uc11c&nbsp; &#8220;userid&#8221;, &#8220;password&#8221; \ub4f1\uacfc \uac19\uc774 \uba85\uc2dc\uc801\uc73c\ub85c \ud504\ub85c\uadf8\ub7a8\uc5d0 \ubc15\uc544 \ub123\uc9c0<br \/>&nbsp;&nbsp; \uc54a\uace0, \ud30c\uc77c\ub85c \uad00\ub9ac\ud558\uae30\ub97c \uc6d0\ud55c\ub2e4\uba74, \uadf8\ub807\uac8c \ud558\uc154\ub3c4 \ub429\ub2c8\ub2e4.<br \/>&nbsp;&nbsp; JDF\uc758 Configuration Framework \uc744 \ucc38\uc870\ud558\uc138\uc694.<\/p>\n<p>&nbsp;PS: \ud639\uc790\ub294 \uc65c ConnectionResource \uc758 release() \uba54\uc18c\ub4dc\uac00 \ud544\uc694\ud558\ub0d0\uace0 \ubc18\ubb38\ud560 \uc218\ub3c4 \uc788\uc2b5<br \/>&nbsp;&nbsp; \ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \uac1c\ubc1c\uc790\uc758 \uc18c\uc2a4\uac00 \ub2e4\uc74c\ucc98\ub7fc \ub418\ub3c4\ub85d \ud574\ub3c4 \ub418\uc9c0 \uc54a\ub290\ub0d0\ub77c\ub294 \uac70\uc8e0.<\/p>\n<p>&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; Connection conn = null;<br \/>&nbsp; &nbsp; Statement stmt = null;<br \/>&nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; conn = ConnectionResource.getConnection(); \/\/ &lt;&#8212;- !!!<\/p>\n<p>&nbsp; &nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; catch(Exception e){<br \/>&nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; finally {<br \/>&nbsp; &nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; if ( conn != null ) try{conn.close();}catch(Exception e){} \/\/ &lt;&#8212;- !!!<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp; \uc774\ub807\uac8c \ud558\uc154\ub3c4 \ud070 \ubb34\ub9ac\ub294 \uc5c6\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098, JDBC 2.0 \uc744 \uc9c0\uc6d0\ud558\ub294 \uc81c\ud488\uc5d0\uc11c\ub9cc<br \/>&nbsp; conn.close() \ub97c \ud1b5\ud574 \ud574\ub2f9 Connection \uc744 \uc2e4\uc81c close() \uc2dc\ud0a4\ub294 \uac83\uc774 \uc544\ub2c8\ub77c DB Pool\uc5d0<br \/>&nbsp; \ubc18\ud658\ud558\uac8c \ub429\ub2c8\ub2e4. BEA WebLogic \uc774\ub098 IBM WebSphere 3.0.2.x, 3.5.x \ub4f1\uc774 \uadf8\ub807\uc2b5\ub2c8\ub2e4.<br \/>&nbsp; \uadf8\ub7ec\ub098, \uc790\uccb4\uc81c\uc791\ub41c \ub300\ubd80\ubd84\uc758 DB Connection Pool \uae30\ub2a5\uc740 Connection \uc744 DB Pool\uc5d0<br \/>&nbsp; \ubc18\ud658\ud558\ub294 \uace0\uc720\ud55c API\ub97c \uac00\uc9c0\uace0 \uc788\uc2b5\ub2c8\ub2e4. WebSphere Version 2.0.x \uc5d0\uc11c\ub294 <br \/>&nbsp; cmConn.releaseIBMConnection(), Oracle OSDK \uc5d0\uc11c\ub294 trx.close(conn, &#8220;&lt;pool_name&#8221;&gt;);<br \/>&nbsp; Hans Bersten \uc758 DBConnectionManager \uc758 \uacbd\uc6b0\ub294 <br \/>&nbsp; connMgr.freeConnection(poolname, conn); \ub4f1\ub4f1 \uc11c\ub85c \ub2e4\ub985\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc81c\ud488\ub4e4\uae4c\uc9c0<br \/>&nbsp; \ubaa8\ub450 \uc9c0\uc6d0\ud558\ub824\uba74 &#8220;release()&#8221; \ub77c\ub294 \uc6b0\ub9ac\ub4e4(!)\ub9cc\uc758 \uc608\uc57d\ub41c \uba54\uc18c\ub4dc\uac00 \uaf2d \ud544\uc694\ud558\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<p>&nbsp; \ubb3c\ub860, java.sql.Connection Interface\ub97c implements \ud55c \ubcc4\ub3c4\uc758 MyConnection \uc744 \ub9cc\ub4e4\uc5b4<br \/>&nbsp; \ub450\uace0, \uc2e4\uc81c java.sql.Connection \uc744 \uc5bb\uc740 \ud6c4 MyConnection\uc758 \uc0dd\uc131\uc790\uc5d0 \uadf8 reference\ub97c<br \/>&nbsp; \ub123\uc5b4\uc900 \ud6c4, \uc774\ub97c return \uc2dc\uc5d0 \ub118\uae30\ub3c4\ub85d \ud558\uac8c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub54c, MyConnection\uc758<br \/>&nbsp; close() \ud568\uc218\ub97c \uc57d\uac04 \uac1c\uc870\ud558\uc5ec DB Connection Pool\ub85c \ub3cc\uc544\uac00\uac8c \ud560 \uc218 \uc788\uc73c\ub2c8\uae4c\uc694.<\/p>\n<p>&nbsp;PS: \ud558\ub098 \uc774\uc0c1\uc758 DB \ub97c \ud544\uc694\ub85c \ud55c\ub2e4\uba74, \ub2e4\uc74c\uacfc \uac19\uc740 \uc0dd\uc131\uc790\ub97c \ucd94\uac00\ub85c \ub9cc\ub4e4\uc5b4\uc11c \uad6c\ubd84\ucf00<br \/>&nbsp; \ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>&nbsp; &#8230;.<br \/>&nbsp; private String poolname = &#8220;default_pool_name&#8221;;<br \/>&nbsp; private String userid = &#8220;scott&#8221;;<br \/>&nbsp; private String password = &#8220;tiger&#8221;;<br \/>&nbsp; public ConnectionResource() throws Exception {<br \/>&nbsp; &nbsp; initialize();<br \/>&nbsp; }<br \/>&nbsp; public ConnectionResource(String poolname) throws Exception {<br \/>&nbsp; &nbsp; this.poolname = poolname;<br \/>&nbsp; &nbsp; initialize();<br \/>&nbsp; }<br \/>&nbsp; public ConnectionResource(String poolname,String userid, String passwrod)<br \/>&nbsp; throws Exception <br \/>&nbsp; {<br \/>&nbsp; &nbsp; this.poolname = poolname;<br \/>&nbsp; &nbsp; this.userid = userid;<br \/>&nbsp; &nbsp; this.password = password;<br \/>&nbsp; &nbsp; initialize();<br \/>&nbsp; }<br \/>&nbsp; private void initialize() throws Exception {<br \/>&nbsp; &nbsp; &#8230;.<br \/>&nbsp; }<br \/>&nbsp; &#8230;<br \/>&nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>2001.03.20 \ucd94\uac00<br \/>2001.10.22 \uc218\uc815<br \/>2001.11.09 \uc218\uc815(\uc544\ub798 \uc124\uba85\uc744 \ucd94\uac00\ud568)<\/p>\n<p>\uc2e4 \uc6b4\uc601 \uc0ac\uc774\ud2b8\uc758 \uc7a5\uc560\uc9c4\ub2e8 \ubc0f \ud29c\ub2dd\uc744 \ub2e4\ub140\ubcf4\uba74, \uc7a5\uc560\uc758 \uc6d0\uc778\uc774 DataBase \uc5f0\uacb0\uac1c\uc218\uac00<br \/>\uc9c0\uc18d\uc801\uc73c\ub85c \uc99d\uac00\ud558\uace0, Connection Pool \uc5d0\uc11c \ub354\uc774\uc0c1 \uac00\uc6a9\ud55c \uc5f0\uacb0\uc774 \ub0a8\uc544 \uc788\uc9c0 \uc54a\uc544<br \/>\ubc1c\uc0dd\ud558\ub294 \ubb38\uc81c\uac00 \uc758\uc678\ub85c \ub9ce\uc2b5\ub2c8\ub2e4. \uc774 \uc0c1\ud669\uc758 \uc2ed\uc911\ud314\uad6c\ub294 \uac1c\ubc1c\uc790\uc758 \ucf54\ub4dc\uc5d0\uc11c Pool\ub85c<br \/>\ubd80\ud130 \uac00\uc838\uc628 DB\uc5f0\uacb0\uc744 \uc0ac\uc6a9\ud558\uace0 \ub09c \ud6c4, \uc774\ub97c \uc5ec\ud558\ud55c\uc758 Exception \uc0c1\ud669\uc5d0\uc11c\ub3c4 \ub2e4\uc2dc <br \/>Pool\ub85c \ub3cc\ub824\ubcf4\ub0b4\uc57c \ud55c\ub2e4\ub294 Rule \ub97c \uc9c0\ud0a4\uc9c0 \uc54a\uc544\uc11c \ubc1c\uc0dd\ud55c \ubb38\uc81c\uac00 \ud0dc\ubc18\uc785\ub2c8\ub2e4.<br \/>\uc774\ub984\ub9cc \ub9d0\ud558\uba74 \ub204\uad6c\ub098 \uc54c\ubc95\ud55c \ud07c\uc9c1\ud55c \uae08\uc735\/\ubc45\ud0b9\uc0ac\uc774\ud2b8\uc758 \ud504\ub85c\uadf8\ub7a8\uc18c\uc2a4\uc5d0\uc11c\ub3c4 \ub9c8\ucc2c\uac00\uc9c0<br \/>\uc785\ub2c8\ub2e4.<br \/>\ubb38\uc81c\ub294 \ubd84\uba85\ud788 \uc5b4\ub5a4 \ud2b9\uc815 \uc751\uc6a9\ud504\ub85c\uadf8\ub7a8\uc5d0\uc11c DB Connection \uc744 \uc81c\ub300\ub85c \ubc18\ud658\ud558\uc9c0 \uc54a\uc740<br \/>\uac83\uc740 \ubd84\uba85\ud55c\ub370, \uadf8 &#8220;\uc5b4\ub5a4 \ud2b9\uc815 \uc751\uc6a9\ud504\ub85c\uadf8\ub7a8&#8221;\uc774 \uaf2d\uc9d1\uc5b4 \ubb50\ub0d0 \ub77c\ub294 \uac83\uc744 \ucc3e\uc544\ub0b4\uae30\ub780<br \/>\uc815\ub9d0 \uc27d\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uc815\ub9d0 \uc27d\uc9c0 \uc54a\uc544\uc694. 1\ucd08\ub2f9 \uc218\uc2ed\uac1c\uc529\uc758 Request \uac00 \ub2e4\uc591\ud558\uac8c \ub4e4\uc5b4<br \/>\uc624\ub294 \uc0c1\ud669\uc5d0\uc11c, &#8220;netstat -n&#8221;\uc73c\ub85c \ubcf4\uc774\ub294 TCP\/IP \ub808\ubca8\uc5d0\uc11c\uc758 DB\uc5f0\uacb0\uc218\ub294 \ubd84\uba85\ud788 \uc99d\uac00<br \/>\ud558\uace0 \uc788\ub294\ub370, \uadf8 \uc218\uc2ed\uac1c \uc911 \uc5b4\ub5a4 \uac83\uc774 \ubb38\uc81c\ub97c \uc57c\uae30\ud558\ub290\ub0d0\ub97c \ub3c4\uc800\ud788 \ubabb\ucc3e\uaca0\ub2e4\ub294 \uac83\uc774\uc9c0\uc694.<br \/>\uc0ac\uc6a9\uc790\uac00 \uc544\ubb34\ub3c4 \uc5c6\ub294 \uc0c8\ubcbd\uc5d0 \ud558\ub098\uc529 \ucee8\ud150\uce20\ub97c \uaf2d\uaf2d \ub20c\ub7ec \ubcf8\ub4e4, \uadf8 \ubb38\uc81c\uc758 \uc0c1\ud669\uc740<br \/>\ub300\ubd80\ubd84 \uc815\uc0c1\uc801\uc778 \ub85c\uc9c1 flow \uc5d0\uc11c\ub294 \ub098\ud0c0\ub098\uc9c0 \uc54a\uace0, \uc5b4\ub5a4 \ud2b9\ubcc4\ud55c \uc870\uac74, \ud639\uc740 \uc5b4\ub5a4<br \/>Exception \uc774 \ubc1c\uc0dd\ud560 \ub54c\ub9cc \ub098\ud0c0\ub0a0 \uc218 \uc788\uae30 \ub54c\ubb38\uc5d0, \uc774\ub7f0 \ubc29\ubc95\uc73c\ub85c\ub294 \uc190\ubc1c\uacfc \ub208\ub9cc \uc544\ud504\uac8c<br \/>\ub418\uace4 \ud569\ub2c8\ub2e4.<\/p>\n<p>\ub530\ub77c\uc11c, \uc560\ucd08 \ubd80\ud130, \uc774\ub7ec\ud55c \uc0c1\ud669\uc744 \uace0\ub824\ud558\uc5ec, \ub9cc\uc57d, \uac1c\ubc1c\uc790\uc758 \ucf54\ub4dc\uc5d0\uc11c \uc2e4\uc218\ub85c DB\uc5f0\uacb0\uc744<br \/>\uc81c\ub300\ub85c Pool \uc5d0 \ubc18\ud658\ud558\uc9c0 \uc54a\uc558\uc744 \ub54c, \uadf8 \uac1c\ubc1c\uc790 \ud504\ub85c\uadf8\ub7a8 \uc18c\uc2a4\uc758 \ud074\ub798\uc2a4 \uc774\ub984\uacfc \ud568\uaed8<br \/>Warnning \uc131 \uba54\uc138\uc9c0\ub97c \ub0a8\uaca8 \ub193\uc73c\uba74, \ub418\uc9c0 \uc54a\uaca0\ub290\ub0d0\ub294 \uac81\ub2c8\ub2e4.<\/p>\n<p>Java \uc5d0\uc11c\ub294 java.lang.Object \uc758 finalize() \ub77c\ub294 \uae30\ub9c9\ud78c \uba54\uc18c\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4. \ud574\ub2f9<br \/>Object instance\uc758 reference \uac00 \ub354\uc774\uc0c1 \uadf8 \uc5b4\ub5a4 Thread \uc5d0\ub3c4 \ub0a8\uc544 \uc788\uc9c0 \uc54a\uc744 \uacbd\uc6b0<br \/>JVM\uc758 GC\uac00 \uc77c\uc5b4\ub0a0 \ub54c \uadf8 Object \uc758 finalize() \uba54\uc18c\ub4dc\ub97c \uaf2d \ud55c\ubc88 \ubd88\ub7ec\uc8fc\ub2c8\uae4c\uc694.<\/p>\n<p>\uacc4\uc18d \ubc18\ubcf5\ub418\ub294 \uc598\uae30\uc778\ub370, \uc544\ub798 \uae00\uc5d0\uc11c \ub610\ud55c\ubc88 \uad00\ub828 \uc758\ubbf8\ub97c \ucc3e\uc744 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4.<br \/>Re: DB Connection Pool: Orphan and Idle Timeout<br \/>http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=devtip&amp;b=servlet&amp;c=r_p&amp;n=1005294960<\/p>\n<p>\uc544\ub798\ub294 \uc774\uac83\uc744 \uc751\uc6a9\ud558\uc5ec, Hans Bergsten \uc758 DBConnectionManager \ub97c \uc0ac\uc6a9\ud558\ub294 <br \/>ConnectionAdapter \ud074\ub798\uc2a4\ub97c \ub9cc\ub4e4\uc5b4 \ubcf8 \uc0d8\ud50c\uc785\ub2c8\ub2e4. Trace\/Debuging \uc744 \uc704\ud55c \uba87\uac00\uc9c0<br \/>\uae30\ub2a5\uc774 \ucca8\uac00\ub418\uc5b4 \uc788\uc73c\uba70, \ub2e4\ub978 ConnectionPool\uc744 \uc704\ud55c Connection Adapter \ub97c \ub9cc\ub4e4\ub54c\ub3c4<br \/>\uc57d\uac04\ub9cc \uc218\uc815\/\uc751\uc6a9\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2e4 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>\/**<br \/>&nbsp;* Author : Lee WonYoung, javaservice@hanmail.net<br \/>&nbsp;* Date &nbsp; : 2001.03.20, 2001.10.22<br \/>&nbsp;*\/<\/p>\n<p>import java.util.*;<br \/>import java.sql.*;<br \/>import java.io.*;<br \/>import java.text.SimpleDateFormat;<\/p>\n<p>public class ConnectionResource<br \/>{<br \/>&nbsp; &nbsp; private boolean DEBUG_MODE = true;<br \/>&nbsp; &nbsp; private String DEFAULT_DATASOURCE = &#8220;idb&#8221;;&nbsp; \/\/ default db name<br \/>&nbsp; &nbsp; private long GET_CONNECTION_TIMEOUT = 2000; \/\/ wait only 2 seconds if no<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ avaiable connection in the pool<br \/>&nbsp; &nbsp; private long WARNNING_MAX_ELAPSED_TIME = 3000;<\/p>\n<p>&nbsp; &nbsp; private SimpleDateFormat df = new SimpleDateFormat(&#8220;yyyyMMdd\/HHmmss&#8221;);<br \/>&nbsp; &nbsp; private db.DBConnectionManager manager = null;<br \/>&nbsp; &nbsp; private Connection conn = null;<br \/>&nbsp; &nbsp; private String datasource = DEFAULT_DATASOURCE;<br \/>&nbsp; &nbsp; private String caller = &#8220;unknown&#8221;;<br \/>&nbsp; &nbsp; private long starttime = 0;<\/p>\n<p>&nbsp; &nbsp; private static int used_conn_count = 0;<br \/>&nbsp; &nbsp; private static Object lock = new Object();<\/p>\n<p>&nbsp; &nbsp; \/\/ detault constructor<br \/>&nbsp; &nbsp; public ConnectionResource()<br \/>&nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; manager = db.DBConnectionManager.getInstance();<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; \/\/ For debugging, get the caller object reference<br \/>&nbsp; &nbsp; public ConnectionResource(Object caller_obj)<br \/>&nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; this();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( caller_obj != null ) <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; caller = caller_obj.getClass().getName();<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; public Connection getConnection()&nbsp; throws Exception<br \/>&nbsp; &nbsp; { <br \/>&nbsp; &nbsp; &nbsp; &nbsp; return getConnection(DEFAULT_DATASOURCE);<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; public Connection getConnection(String datasource)&nbsp; throws Exception<br \/>&nbsp; &nbsp; { <br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn != null ) throw new Exception<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (&#8220;You must release the connection first to get connection again !!&#8221;);<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; this.datasource = datasource;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ CONNECTION_TIMEOUT is very important factor for performance tuning<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = manager.getConnection(datasource, GET_CONNECTION_TIMEOUT);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; synchronized( lock ) { ++used_conn_count; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; starttime = System.currentTimeMillis();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; \/\/ you don&#8217;t have to get &#8220;connection reference&#8221; as parameter,<br \/>&nbsp; &nbsp; \/\/ because we already have the referece as the privae member variable.<br \/>&nbsp; &nbsp; public synchronized void release() throws Exception { &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn == null ) return;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ The following is needed for some DB connection pool.<br \/>&nbsp; &nbsp; &nbsp; &nbsp; boolean mode = true;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; try{<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mode = conn.getAutoCommit();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( mode == false ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try{conn.rollback();}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try{conn.setAutoCommit(true);}catch(Exception e){}<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; manager.freeConnection(datasource, conn);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; conn = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; int count = 0;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; synchronized( lock ) { count = &#8211;used_conn_count; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( DEBUG_MODE ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; long endtime = System.currentTimeMillis();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( (endtime-starttime) &gt; WARNNING_MAX_ELAPSED_TIME ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.err.println(df.format(new java.util.Date()) + <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;:POOL:WARNNING:&#8221; + count +<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;:(&#8221; + (endtime-starttime) + &#8220;):&#8221; +<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;\\t&#8221; + caller<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; \/\/ finalize() method will be called when JVM&#8217;s GC time.<br \/>&nbsp; &nbsp; public void finalize(){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ if &#8220;conn&#8221; is not null, this means developer did not release the &#8220;conn&#8221;.<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ( conn != null ) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.err.println(df.format(new java.util.Date()) + <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;:POOL:ERROR connection was not released:&#8221; +<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; used_conn_count + &#8220;:\\t&#8221; + caller<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; release();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; }<br \/>}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>\uc704\uc758 Connection Adaptor \ud074\ub798\uc2a4\ub97c Servlet \uc774\ub098 JSP\uc5d0\uc11c \uc0ac\uc6a9\ud560 \ub54c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774<br \/>\uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc0ac\uc6a9\ubc95: DB Transaction \ucc98\ub9ac\uac00 \ud544\uc694\uce58 \uc54a\uc744 \ub54c&#8230;<\/p>\n<p>ConnectionResource resource = null;<br \/>Connection conn = null;<br \/>Statement stmt = null;<br \/>try{<br \/>&nbsp; &nbsp; \/\/ For debugging and tracing, I recommand to send caller&#8217;s reference to <br \/>&nbsp; &nbsp; \/\/ the adapter&#8217;s constructor.<br \/>&nbsp; &nbsp; resource = new ConnectionResource(this); \/\/ &lt;&#8212; !!!<br \/>&nbsp; &nbsp; \/\/resource = new ConnectionResource();<\/p>\n<p>&nbsp; &nbsp; conn = resource.getConnection();<br \/>&nbsp; &nbsp; \/\/ or you can use another database name<br \/>&nbsp; &nbsp; \/\/conn = resource.getConnection(&#8220;other_db&#8221;);<\/p>\n<p>&nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; ResultSet rs = stmt.executeQuery(&#8220;select &#8230;&#8221;);<br \/>&nbsp; &nbsp; while(rs.next()){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8230;..<br \/>&nbsp; &nbsp; }<br \/>&nbsp; &nbsp; rs.close();<\/p>\n<p>}<br \/>\/\/catch(Exception e){<br \/>\/\/ &nbsp;&nbsp; \/\/ error handling if you want<br \/>\/\/ &nbsp;&nbsp; &#8230;.<br \/>\/\/}<br \/>finally{<br \/>&nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; if ( conn != null ) resource.release(); \/\/ &lt;&#8212; !!!<br \/>}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\uc0ac\uc6a9\ubc95: Transaction \ucc98\ub9ac\uac00 \ud544\uc694\ud560 \ub54c.<\/p>\n<p>ConnectionResource resource = null;<br \/>Connection conn = null;<br \/>Statement stmt = null;<br \/>try{<br \/>&nbsp; &nbsp; \/\/ For debugging and tracing, I recommand to send caller&#8217;s reference to <br \/>&nbsp; &nbsp; \/\/ the adapter&#8217;s constructor.<br \/>&nbsp; &nbsp; resource = new ConnectionResource(this);<br \/>&nbsp; &nbsp; \/\/resource = new ConnectionResource();<\/p>\n<p>&nbsp; &nbsp; conn = resource.getConnection();<br \/>&nbsp; &nbsp; \/\/ or you can use another database name<br \/>&nbsp; &nbsp; \/\/conn = resource.getConnection(&#8220;other_db&#8221;);<\/p>\n<p>&nbsp; &nbsp; conn.setAutoCommit(false); \/\/ &lt;&#8212; !!!<\/p>\n<p>&nbsp; &nbsp; stmt = conn.createStatement();<br \/>&nbsp; &nbsp; stmt.executeUpdate(&#8220;update &#8230;&#8221;);<br \/>&nbsp; &nbsp; stmt.executeUpdate(&#8220;insert &#8230;&#8221;);<br \/>&nbsp; &nbsp; stmt.executeUpdate(&#8220;update &#8230;&#8221;);<br \/>&nbsp; &nbsp; stmt.executeUpdate(&#8220;insert &#8230;&#8221;);<br \/>&nbsp; &nbsp; stmt.executeUpdate(&#8220;update &#8230;&#8221;);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp; &nbsp; int affected = stmt.executeUpdate(&#8220;update&#8230;.&#8221;);<br \/>&nbsp; &nbsp; \/\/ depends on your business logic,<br \/>&nbsp; &nbsp; if ( affected == 0 ) <br \/>&nbsp; &nbsp; &nbsp; &nbsp; throw new Exception(&#8220;NoAffectedException&#8221;);<br \/>&nbsp; &nbsp; else if ( affected &gt; 1 ) <br \/>&nbsp; &nbsp; &nbsp; &nbsp; throw new Exception(&#8220;TooManyAffectedException:&#8221; + affected);<\/p>\n<p>&nbsp; &nbsp; conn.commit(); \/\/&lt;&lt;&#8211; commit() must locate at the last position in the &#8220;try{}&#8221;<br \/>}<br \/>catch(Exception e){<br \/>&nbsp; &nbsp; \/\/ if error, you MUST rollback <br \/>&nbsp; &nbsp; if ( conn != null ) try{conn.rollback();}catch(Exception e){}<\/p>\n<p>&nbsp; &nbsp; \/\/ another error handling if you want<br \/>&nbsp; &nbsp; &#8230;.<br \/>&nbsp; &nbsp; throw e; \/\/ &lt;&#8212; throw this exception if you want<br \/>}<br \/>finally{<br \/>&nbsp; &nbsp; if ( stmt != null ) try{stmt.close();}catch(Exception e){}<br \/>&nbsp; &nbsp; if ( conn != null ) resource.release(); \/\/ &lt;&#8211; NOTE: autocommit mode will be<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initialized<br \/>}<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>PS: \ub354 \uae4a\uc774\uc788\ub294 \ub0b4\uc6a9\uc744 \uc6d0\ud558\uc2dc\uba74 \ub2e4\uc74c \ubb38\uc11c\ub4e4\uc744 \ucc38\uc870 \ud558\uc138\uc694&#8230;<br \/>&nbsp; &nbsp; JDF \uc81c4\ud0c4 &#8211; DB Connection Pool<br \/>&nbsp; &nbsp; http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=jdf&amp;b=framework&amp;c=r_p&amp;n=945156790<\/p>\n<p>&nbsp; &nbsp; JDF \uc81c5\ud0c4 &#8211; DB Connection Resource Framework<br \/>&nbsp; &nbsp; http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=jdf&amp;b=framework&amp;c=r_p&amp;n=945335633<\/p>\n<p>&nbsp; &nbsp; JDF \uc81c6\ud0c4 &#8211; Transactional Connection Resource Framework<br \/>&nbsp; &nbsp; http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=jdf&amp;b=framework&amp;c=r_p&amp;n=945490586<\/p>\n<p>PS: IBM WebSphere\uc758 JDBC Connection Pool \uc5d0 \uad00\uc2ec\uc774 \uc788\ub2e4\uba74 \ub2e4\uc74c \ubb38\uc11c\ub3c4 \uaf2d \ucc38\uc870<br \/>&nbsp;\ud558\uc138\uc694&#8230;<br \/>&nbsp; &nbsp; Websphere V3 Connection Pool \uc0ac\uc6a9\ubc95<br \/>&nbsp; &nbsp; http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=appserver&amp;b=was&amp;c=r_p&amp;n=970209527<br \/>&nbsp; &nbsp; WebSphere V3 DB Connection Recovery \uae30\ub2a5 \uace0\ucc30<br \/>&nbsp; &nbsp; http:\/\/www.javaservice.net\/~java\/bbs\/read.cgi?m=appserver&amp;b=was&amp;c=r_p&amp;n=967473008<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>NOTE: 2004.04.07 \ucd94\uac00<br \/>\uadf8\ub7ec\ub098, 2004\ub144 \uc911\ubc18\uc744 \ub118\uc5b4\uc11c\ub294 \uc774 \uc2dc\uc810\uc5d0\uc11c\ub294, ConnectionResource\uc640 \uac19\uc740 Wapper\uc758<br \/>\uc911\uc694\uc131\uc774 \ubcc4\ub85c \ub192\uc774 \ud3c9\uac00\ub418\uc9c0 \uc54a\ub294\ub370, \uadf8 \uc774\uc720\ub294 Tomcat 5.0\uc744 \ube44\ub86f\ud55c \ub300\ubd80\ubd84\uc758 WAS(Web<br \/>Application Server)\uac00 \uc790\uccb4\uc758 Connection Poolinig\uae30\ub2a5\uc744 \uc81c\uacf5\ud558\uba70, \uadf8 \uc0ac\uc6a9\ubc95\uc740 \ub2e4\uc74c\uacfc<br \/>\uac19\uc774 JDBC 2.0\uc5d0 \uc900\ud558\uc5ec \ubaa8\ub450 \ub3d9\uc77c\ud55c \ud615\ud0dc\ub97c \ub760\uace0 \uc788\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4.<\/p>\n<p>InitialContext ctx = new InitialContext();<br \/>DataSource ds = (DataSoruce)ctx.lookup(&#8220;java:comp\/env\/jdbc\/ds&#8221;);<br \/>Connection conn = ds.getConnection();<br \/>&#8230;<br \/>conn.close();<\/p>\n<p>\uacb0\uad6d ConnectionResource\uc758 release()\ub958\uc758 \uba54\uc18c\ub4dc\ub294 Vendor\ubcc4\ub85c, JDBC Connection Pool\uc758<br \/>\uc885\ub958\uac00 \ub09c\ubb34\ud558\ub358 3-4\ub144 \uc804\uc5d0\ub294 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\ucf54\ub4dc\uc758 Vendor\uc885\uc18d\uc131\uc744 \ud0c8\ud53c\ud558\uae30 \uc704\ud574 \uc758\ubbf8\ub97c<br \/>\uac00\uc84c\uc73c\ub098, \uc9c0\uae08\uc740 \uad73\uc774 \ud544\uc694\uac00 \uc5c6\ub2e4\uace0 \ubcf4\uc5ec \uc9d1\ub2c8\ub2e4.<\/p>\n<p>\ub2e8\uc9c0, caller\uc640 callee\uc758 \uc815\ubcf4, \uc989, \uc751\ub2f5\uc2dc\uac04\uc744 \ucd94\uc801\ud55c\ub2e4\uac70\ub098, close() \ud558\uc9c0 \uc54a\uc740<br \/>\uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ucd94\uc801\ud558\ub294 \uc758\ubbf8\uc5d0\uc11c\uc758 \uac00\uce58\ub9cc \ub0a8\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.&nbsp; (\uadf8\ub7ec\ub098, \uc774\uac83\ub3c4,<br \/>IBM WebSphere v5\uc758 \uacbd\uc6b0, \uac1c\ubc1c\uc790\uac00 conn.close() \uc870\ucc28 \ud558\uc9c0 \uc54a\uc744 \uc9c0\ub77c\ub3c4 \uc790\ub3d9\uc744 \ud574\ub2f9<br \/>Thread\uc758 request ending\uc2dc\uc810\uc5d0 &#8220;\uc790\ub3d9\ubc18\ud658&#8221;\uc774 \uc77c\uc5b4\ub098\uac8c \ub429\ub2c8\ub2e4.)<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>2005.01.21 \ucd94\uac00<br \/>JDBC Connection\/Statement\/ResultSet\uc744 close\ud558\uc9c0 \uc54a\uc740 \uc18c\uc2a4\uc758 \uc704\uce58\ub97c \uc7a1\uc544\ub0b4\ub294 \uac83\uc740<br \/>\uc2e4\uc81c \uc2dc\uc2a4\ud15c \uc6b4\uc601 \uc911\uc5d0 \ucc3e\uae30\ub780 \uc815\ub9d0 \ubaa8\ub798\uc0ac\uc7a5\uc5d0\uc11c \ubc14\ub298\ucc3e\uae30 \uac19\uc740 \uac83\uc774\uc5c8\uc2b5\ub2c8\ub2e4.<br \/>\uadf8\ub7ec\ub098, \uc81c\ub2c8\ud37c(Jennifer2.0)\uacfc \uac19\uc740 APM\uc744 \uc81c\ud488\uc744 \uc801\uc6a9\ud558\uc2dc\uba74, \uc6b4\uc601 \uc911\uc5d0, \uc5b4\ub290 \uc18c\uc2a4\uc758<br \/>\uc5b4\ub290 \uc704\uce58\uc5d0\uc11c \uc81c\ub300\ub85c \ubc18\ud658\uc2dc\ud0a4\uc9c0 \uc54a\uc558\ub294\uc9c0\ub97c \uc815\ud655\ud558\uac8c \ucc3e\uc544\uc90d\ub2c8\ub2e4.<br \/>\ubfd0\ub9cc \uc544\ub2c8\ub77c, \ubaa8\ub4e0 SQL\uc758 \uc218\ud589\ud1b5\uacc4 \ubc0f \ud604\uc7ac \uc218\ud589\ud558\uace0 \uc788\ub294 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc5b4\ub5a4 SQL\uc744<br \/>\uc218\ud589\uc911\uc778\uc9c0 \uc2e4\uc2dc\uac04\uc73c\ub85c \ud655\uc778\ub418\ub2c8, \uc131\ub2a5\uc800\ud558\ub97c \ubcf4\uc774\ub294 SQL\uc744 \ud29c\ub2dd\ud558\ub294 \uac83 \ub4f1, \ub9ce\uc740 \ubd80\ubd84\ub4e4\uc774<br \/>\uba85\ud655\ud574\uc838 \uac00\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc774\uc820 \ub354\uc774\uc0c1 \uc704 \uae00\uacfc \uac19\uc740 \ubb38\uc11c\uac00 \ud544\uc694\uc5c6\ub294 \uc138\uc0c1\uc744 \uae30\ub300\ud574 \ubd05\ub2c8\ub2e4.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &nbsp;<br \/>&nbsp; \ubcf8 \ubb38\uc11c\ub294 \uc790\uc720\ub86d\uac8c \ubc30\ud3ec\/\ubcf5\uc0ac \ud560 \uc218 \uc788\uc73c\ub098 \ubc18\ub4dc\uc2dc<br \/>&nbsp; \uc774 \ubb38\uc11c\uc758 \uc800\uc790\uc5d0 \ub300\ud55c \uc5b8\uae09\uc744 \uc0ad\uc81c\ud558\uc2dc\uba74 \uc548\ub429\ub2c8\ub2e4<br \/>================================================<br \/>&nbsp; \uc790\ubc14\uc11c\ube44\uc2a4\ub137 \uc774\uc6d0\uc601<br \/>&nbsp; E-mail: javaservice@hanmail.net<br \/>&nbsp; PCS:011-898-7904<br \/>================================================<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\ud0c4\uc5d0 \uc774\uc5b4 2\ud0c4\ub3c4 \uac11\ub2c8\ub2e4. ======================================================================== \uc11c\ube14\ub81b + JDBC \uc5f0\ub3d9\uc2dc \ucf54\ub529 \uace0\ub824\uc0ac\ud56d -\uc81c2\ud0c4-[JDBC Connection Pooling] \ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.01.19\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.03.20(\uc0d8\ud50c\uc608\uc81c\ucd94\uac00)\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.10.22(\ub514\ubc84\uae45\uc744 \uc704\ud55c \ub85c\uc9c1\ucd94\uac00)\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.10.29(Oracle JDBC2.0 \uc0d8\ud50c\ucd94\uac00)\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.11.08(\uc724\ud55c\uc131\ub2d8 \ub3c4\uc6c0 OracleConnectionCacheImpl \uc18c\uc2a4\uc218\uc815)\ucd5c\uadfc\uc218\uc815\uc77c\uc790 : 2001.11.09(Trace\/Debugging\uc744 \uc704\ud55c \uc7a5\ubb38\uc758 \uc0ac\uc871\uc744 \ub2f4) 5. JDBC Connection Pooling \uc744 \uc65c \uc0ac\uc6a9\ud574\uc57c \ud558\ub294\uac00 ? &nbsp;Pooling \uc774\ub780 \uc6a9\uc5b4\ub294 \uc77c\ubc18\uc801\uc778 \uc6a9\uc5b4\uc785\ub2c8\ub2e4. Socket Connection Pooling, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[163],"tags":[],"class_list":["post-1007","post","type-post","status-publish","format-standard","hentry","category-about-knowledge-programs_java"],"_links":{"self":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/posts\/1007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/comments?post=1007"}],"version-history":[{"count":0,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/posts\/1007\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/media?parent=1007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/categories?post=1007"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/tags?post=1007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}