<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Programmer Life</title>
	<atom:link href="http://www.mkyong.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mkyong.com</link>
	<description>My Personal Journey In Security and Programming</description>
	<pubDate>Fri, 10 Oct 2008 01:27:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>NullPointerException at org.enhydra.jdbc.pool.GenericPool.getFromPool</title>
		<link>http://www.mkyong.com/java/nullpointerexception-at-orgenhydrajdbcpoolgenericpoolgetfrompool/</link>
		<comments>http://www.mkyong.com/java/nullpointerexception-at-orgenhydrajdbcpoolgenericpoolgetfrompool/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 01:27:47 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[enhydra]]></category>

		<category><![CDATA[error]]></category>

		<category><![CDATA[NullPointerException]]></category>

		<category><![CDATA[xapool]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=196</guid>
		<description><![CDATA[While many concurrent connections connect to database, my web application sometime will hit NullPointerException error from GenericPool.getFromPool method. This is weird, after i googling a while, i find out this is a bug in  XAPool 1.5.jar, it already fix in  XAPool 1.6 beta released (Fix for #303462). After i upgraded to XAPool1.6 beta, [...]]]></description>
			<content:encoded><![CDATA[<p>While many concurrent connections connect to database, my web application sometime will hit NullPointerException error from GenericPool.getFromPool method. This is weird, after i googling a while, i find out this is a bug in  XAPool 1.5.jar, it already fix in  XAPool 1.6 beta released (Fix for #303462). After i upgraded to XAPool1.6 beta, error message is gone.</p>
<p>Error detail<br />
<a href="http://forge.objectweb.org/tracker/index.php?func=detail&#038;aid=303673&#038;group_id=59&#038;atid=300059" target="_blank">http://forge.objectweb.org/tracker/index.php?func=detail&#038;aid=303673&#038;group_id=59&#038;atid=300059</a></p>
<p>Here to download latest XAPool<br />
<a href="http://xapool.experlog.com/" target="_blank">http://xapool.experlog.com/</a></p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;">java.<span style="color: #006633;">lang</span>.<span style="color: #003399;">NullPointerException</span>
	at org.<span style="color: #006633;">enhydra</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">pool</span>.<span style="color: #006633;">GenericPool</span>.<span style="color: #006633;">getFromPool</span><span style="color: #009900;">&#40;</span>GenericPool.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">enhydra</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">pool</span>.<span style="color: #006633;">GenericPool</span>.<span style="color: #006633;">checkOut</span><span style="color: #009900;">&#40;</span>GenericPool.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">351</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">enhydra</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">pool</span>.<span style="color: #006633;">StandardPoolDataSource</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>StandardPoolDataSource.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">194</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">enhydra</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">pool</span>.<span style="color: #006633;">StandardPoolDataSource</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>StandardPoolDataSource.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">164</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">datasource</span>.<span style="color: #006633;">DataSourceUtils</span>.<span style="color: #006633;">doGetConnection</span><span style="color: #009900;">&#40;</span>DataSourceUtils.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">112</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">datasource</span>.<span style="color: #006633;">DataSourceUtils</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>DataSourceUtils.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">77</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">core</span>.<span style="color: #006633;">JdbcTemplate</span>.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>JdbcTemplate.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">513</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">core</span>.<span style="color: #006633;">JdbcTemplate</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>JdbcTemplate.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">581</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">core</span>.<span style="color: #006633;">JdbcTemplate</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>JdbcTemplate.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">610</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">core</span>.<span style="color: #006633;">JdbcTemplate</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>JdbcTemplate.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">618</span><span style="color: #009900;">&#41;</span>
	at org.<span style="color: #006633;">springframework</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">core</span>.<span style="color: #006633;">JdbcTemplate</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>JdbcTemplate.<span style="color: #006633;">java</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">650</span><span style="color: #009900;">&#41;</span></pre></div></div>

<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/java/javalangunsupportedclassversionerror-bad-version-number-in-class-file/" title="java.lang.UnsupportedClassVersionError: Bad version number in .class file">java.lang.UnsupportedClassVersionError: Bad version number in .class file</a></li>
<li><a href="http://www.mkyong.com/java/javalangnoclassdeffounderror-orgapachecommonslogginglogfactory/" title="java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory">java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory</a></li>
<li><a href="http://www.mkyong.com/design-pattern/adapter-design-pattern/" title="Adapter Design Pattern">Adapter Design Pattern</a></li>
<li><a href="http://www.mkyong.com/java/how-to-download-file-from-website-java-jsp/" title="How to download file from website- Java / Jsp">How to download file from website- Java / Jsp</a></li>
<li><a href="http://www.mkyong.com/java/how-to-export-data-to-csv-file-java/" title="How to export data to CSV file - Java">How to export data to CSV file - Java</a></li>
<li><a href="http://www.mkyong.com/java/java-web-start-jnlp-tutorial-unofficial-guide/" title="Java Web Start (Jnlp) Tutorial - UnOfficial Guide">Java Web Start (Jnlp) Tutorial - UnOfficial Guide</a></li>
<li><a href="http://www.mkyong.com/tomcat/tomcat-javasecurityaccesscontrolexception-access-denied-javalangruntimepermission-accessdeclaredmembers/" title="Tomcat - java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)">Tomcat - java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)</a></li>
<li><a href="http://www.mkyong.com/java/if-statement-becareful/" title="If statement Becareful !!!">If statement Becareful !!!</a></li>
<li><a href="http://www.mkyong.com/java/how-to-remove-whitespace-between-string-java/" title="How to remove Whitespace between String - Java">How to remove Whitespace between String - Java</a></li>
<li><a href="http://www.mkyong.com/java/java-decompiler-plugin-for-eclipse/" title="Java Decompiler Plugin For Eclipse">Java Decompiler Plugin For Eclipse</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/java/nullpointerexception-at-orgenhydrajdbcpoolgenericpoolgetfrompool/feed/</wfw:commentRss>
		</item>
		<item>
		<title>F-Secure Internet Security 2009 and Rising Antivirus can not installed in a same computer</title>
		<link>http://www.mkyong.com/security/f-secure-internet-security-2009-and-rising-antivirus-can-not-installed-in-a-same-computer/</link>
		<comments>http://www.mkyong.com/security/f-secure-internet-security-2009-and-rising-antivirus-can-not-installed-in-a-same-computer/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 15:03:08 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[security]]></category>

		<category><![CDATA[antivirus]]></category>

		<category><![CDATA[f-secure]]></category>

		<category><![CDATA[rising]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=195</guid>
		<description><![CDATA[I installed Rising antivirus quite a long time and very satisfied with it. However i have a F-Secure Internet Security 2009 recently. 
During installation of  F-Secure Internet Security 2009, F-Secure IS 2009 didn&#8217;t detect any conflict programs and continue until finished. After installed, F-Secure IS 2009 request for a restart, this is normal and [...]]]></description>
			<content:encoded><![CDATA[<p>I installed Rising antivirus quite a long time and very satisfied with it. However i have a F-Secure Internet Security 2009 recently. </p>
<p>During installation of  F-Secure Internet Security 2009, F-Secure IS 2009 didn&#8217;t detect any conflict programs and continue until finished. After installed, F-Secure IS 2009 request for a restart, this is normal and i just click restart.</p>
<p>P.S my windows is XP SP2</p>
<p>After windows restarted, windows can not start as usual. Windows will auto restart during log in process. Er&#8230; After installed  F-Secure Internet Security 2009 and Rising Antivirus in same computer, I can not log into my windows anymore, when windows load log in screen, it will restart automatically.  These two antivirus seem conflict each other during windows start up. It left me no choice, i have to log into windows safe mode and uninstall Rising. After uninstalled Rising, windows can start as normal and F-Secure Internet Security 2009 installed and functioned properly.</p>
<p>F-Secure Internet Security 2009 and Rising Antivirus can not installed in a same computer, it will cause windows can not start properly.</p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/security/fight-trojanimmsgwin32tbmsgio-trojan-virus-rising-avg/" title="Fight Trojan.IMMSG.Win32.TBMsg.io Trojan Virus - Rising / AVG">Fight Trojan.IMMSG.Win32.TBMsg.io Trojan Virus - Rising / AVG</a></li>
<li><a href="http://www.mkyong.com/security/google-chrome-crashes-exploits-with-undefined-handlers/" title="Google Chrome crashes / exploits with undefined-handlers">Google Chrome crashes / exploits with undefined-handlers</a></li>
<li><a href="http://www.mkyong.com/computer-tips/top-5-strongest-password/" title="Top 5 Strongest Password ">Top 5 Strongest Password </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/security/f-secure-internet-security-2009-and-rising-antivirus-can-not-installed-in-a-same-computer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fight Trojan.IMMSG.Win32.TBMsg.io Trojan Virus - Rising / AVG</title>
		<link>http://www.mkyong.com/security/fight-trojanimmsgwin32tbmsgio-trojan-virus-rising-avg/</link>
		<comments>http://www.mkyong.com/security/fight-trojanimmsgwin32tbmsgio-trojan-virus-rising-avg/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 14:37:59 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[security]]></category>

		<category><![CDATA[antivirus]]></category>

		<category><![CDATA[avg]]></category>

		<category><![CDATA[rising]]></category>

		<category><![CDATA[trojan]]></category>

		<category><![CDATA[Trojan.IMMSG.Win32.TBMsg.io]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=193</guid>
		<description><![CDATA[
Problem - Feel weird and computer performance decreased

Recently, I find out my internet and computer speed is decrease seriously. It&#8217;s very slow&#8230;. When i double click my C drive, windows open a new my computer explorer&#8230;it&#8217;s weird.

Investigate - Windows service

I started to investigate what is the root cause of it, i started to check on [...]]]></description>
			<content:encoded><![CDATA[<p><b><br />
<h2>Problem - Feel weird and computer performance decreased</h2>
<p></b><br />
Recently, I find out my internet and computer speed is decrease seriously. It&#8217;s very slow&#8230;. When i double click my C drive, windows open a new my computer explorer&#8230;it&#8217;s weird.</p>
<p><b><br />
<h2>Investigate - Windows service</h2>
<p></b><br />
I started to investigate what is the root cause of it, i started to check on my windows service and notice one suspicious execution file in my system32 folder - <b> &#8220;95B3F400.EXE&#8221; </b>, This 95B3F400.EXE also attched into windows service and start automatically during windows startup. I have no idea what is this and how to get it installed in my computer.</p>
<p><b><br />
<h2>Investigate - Googling</h2>
<p></b><br />
I try search &#8220;95B3F400.EXE&#8221; in google, however it return no result. I think this virus name &#8220;95B3F400.EXE&#8221; is random generated. This weird execution file really scare me and annoy me a lot, i assume this file 99% is a virus or trojan.</p>
<p><b><br />
<h2>Round 1 - AVG versus &#8220;95B3F400.EXE&#8221; - Failed</h2>
<p></b><br />
Ok, let get install AVG free antivirus and hope it can tell me what this suspicious file is?</p>
<p>Go to <a href="http://free.avg.com/" target=_blank>http://free.avg.com/</a>, however after scanned through my whole drive , AVG failed to detect any virus or trojan in my computer. Er&#8230; &#8220;95B3F400.EXE&#8221; in my windows service and start automatically, how can it is not a virus or trojan? Am i wrong?</p>
<p><b><br />
<h2>Round 2 - Rising versus &#8220;95B3F400.EXE&#8221; - Killed</h2>
<p></b><br />
Actually i visited quite a lot china website recently, this weird virus may be infected that time, i started to think may be china antivirus can make a different? Hehe , china&#8217;s virus need to use china&#8217;s antivirus to kill it :). Google some china antivirus and found a popular free china&#8217;s antivirus called - Rising.</p>
<p>Go to <a href="http://www.freerav.com/" target="_blank"> http://www.freerav.com/</a>, download and scan my computer. Great&#8230; virus detected , this &#8220;95B3F400.EXE&#8221; detected as Trojan.IMMSG.Win32.TBMsg.io trojan. Just click clean, Rising handle all the rest for me. After cleaned and restarted , &#8220;95B3F400.EXE&#8221; no longer appear in my system32 folder and it detached from my windows service as well. Wah&#8230; Rising antivirus impressed me!! My internet and computer speed back into normal ~ it&#8217;s fast !</p>
<p>Below is a graphic that show Rising detected a trojan while AVG detected nothing.</p>
<p><a href='http://www.mkyong.com/wp-content/uploads/2008/10/virus-rising-avg.jpg'><img src="http://www.mkyong.com/wp-content/uploads/2008/10/virus-rising-avg.jpg" alt="" title="virus-rising-avg" class="aligncenter size-full wp-image-194" /></a></p>
<p><b><br />
<h2>Conclusion</h2>
<p></b><br />
Well, i&#8217;m not try to proved that Rising is stronger the AVG, but what i want to highlight is , some virus or trojan may only detected or killed by speficied antivirus. China product is not as bad as i think, i am really impressed by Rising !!!</p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/security/f-secure-internet-security-2009-and-rising-antivirus-can-not-installed-in-a-same-computer/" title="F-Secure Internet Security 2009 and Rising Antivirus can not installed in a same computer">F-Secure Internet Security 2009 and Rising Antivirus can not installed in a same computer</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/security/fight-trojanimmsgwin32tbmsgio-trojan-virus-rising-avg/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to set / change default page in Apache</title>
		<link>http://www.mkyong.com/apache/how-to-set-change-default-page-in-apache/</link>
		<comments>http://www.mkyong.com/apache/how-to-set-change-default-page-in-apache/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 14:28:15 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[default page]]></category>

		<category><![CDATA[http.conf]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=192</guid>
		<description><![CDATA[Here i will show how to set or change default page in Apache. Apache default page is very easy to configure, we just need to configure Apache conf file in following location

Apache file path/conf/httpd.conf

Make the following changes in httpd.conf file. Change index.html or index.php to whatever default page you want.

#
# DirectoryIndex: sets the file that [...]]]></description>
			<content:encoded><![CDATA[<p>Here i will show how to set or change default page in Apache. Apache default page is very easy to configure, we just need to configure Apache conf file in following location<br />
<b><br />
Apache file path/conf/httpd.conf<br />
</b></p>
<p>Make the following changes in httpd.conf file. Change index.html or index.php to whatever default page you want.</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;">#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;IfModule</span> dir_module<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    DirectoryIndex index.html index.php
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Restart Apache ~ Done.<br />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/database/partition-table-in-postgresql-simulate-millions-data-part-2/" title="Partition Table In PostgreSQL (Simulate Millions Data) - Part 2">Partition Table In PostgreSQL (Simulate Millions Data) - Part 2</a></li>
<li><a href="http://www.mkyong.com/tomcat/how-to-install-tomcat-in-ubuntu/" title="How to install Tomcat in Ubuntu">How to install Tomcat in Ubuntu</a></li>
<li><a href="http://www.mkyong.com/html/html-color-tutorial/" title="Html Color Tutorial">Html Color Tutorial</a></li>
<li><a href="http://www.mkyong.com/tomcat/tomcat-default-administrator-password/" title="Tomcat Default Administrator Password?">Tomcat Default Administrator Password?</a></li>
<li><a href="http://www.mkyong.com/tomcat/tomcat-5525-is-suck-give-up/" title="Tomcat 5.5.25 is suck&#8230; Give Up">Tomcat 5.5.25 is suck&#8230; Give Up</a></li>
<li><a href="http://www.mkyong.com/database/how-to-install-pgagent-on-windows-postgresql-job-scheduler/" title="How to install pgAgent on windows (PostgreSQL Job Scheduler)">How to install pgAgent on windows (PostgreSQL Job Scheduler)</a></li>
<li><a href="http://www.mkyong.com/database/how-to-uninstall-postgresql-from-fedora-core/" title="How to uninstall postgresql from fedora core">How to uninstall postgresql from fedora core</a></li>
<li><a href="http://www.mkyong.com/computer-tips/clear-browsing-history-in-firefox/" title="Clear Browsing History In Firefox">Clear Browsing History In Firefox</a></li>
<li><a href="http://www.mkyong.com/database/postgresql-network-access-solution/" title="PostgreSQL Network Access - (Solution)">PostgreSQL Network Access - (Solution)</a></li>
<li><a href="http://www.mkyong.com/tomcat/how-to-check-tomcat-version-installed/" title="How to check Tomcat version Installed">How to check Tomcat version Installed</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/apache/how-to-set-change-default-page-in-apache/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adapter Design Pattern</title>
		<link>http://www.mkyong.com/design-pattern/adapter-design-pattern/</link>
		<comments>http://www.mkyong.com/design-pattern/adapter-design-pattern/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 16:35:43 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[Design Pattern]]></category>

		<category><![CDATA[adapter]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=190</guid>
		<description><![CDATA[Adapter , Adapter , Adapter ~ Actually Adapter design pattern can consider as a simple conversion program / class. It usually used to make two incompatible interfaces or classes to work together. Please review below Adapter design pattern image draw by me, a bit ugly  


Case Study

Company A developed a program in Java to [...]]]></description>
			<content:encoded><![CDATA[<p>Adapter , Adapter , Adapter ~ Actually Adapter design pattern can consider as a simple conversion program / class. It usually used to make two incompatible interfaces or classes to work together. Please review below Adapter design pattern image draw by me, a bit ugly <img src='http://www.mkyong.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href='http://www.mkyong.com/wp-content/uploads/2008/09/adapter-graphic.bmp'><img src="http://www.mkyong.com/wp-content/uploads/2008/09/adapter-graphic.bmp" alt="" title="adapter-graphic" class="aligncenter size-full wp-image-191" /></a></p>
<p><u><br />
<h2>Case Study</h2>
<p></u><br />
Company A developed a program in Java to display all of the products&#8217; detail in console. This Java program is very simple and it take an Iterator collection and iterate it to display product one by one. </p>
<p>However Company A outsource Product back end system to a vendor called Vendor B. Vendor B came out a system which will return all products as Enumeration collection.</p>
<p>Arg&#8230;wait&#8230; return Product as Enumeration? But current Company A system is design to accept product as Iterator. Company A design are all base on Iterator collection to function, now Vendor B provide an old and obsolete function (Enumeration), what should we do?  </p>
<p>Above scenarios sound similar to everyone right? Yes it always happened to me as well. So .. who going to change it? To be frankly, i can guarantee Vendor B 100% will not change it for you. </p>
<p>However company A also can not afford to redesign it because it invested so much time and manpower effort already.</p>
<p>Here Adapter come in place. What we need to do is create an adapter class which can convert Enumeration to Iterator. Understand? Study below code may make sense to you.</p>
<p><u><br />
<h2>Code Study</h2>
<p></u></p>
<p><b>This is an &#8220;EnumProduct&#8221; class provided by vendor, it will return Product as Enumeration by calling getProduct () function.</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.mkyong.adapter</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Enumeration</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Vector</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EnumProduct
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Vector</span> product;
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> EnumProduct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		product <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Vector</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
		setProduct<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ProductA&quot;</span><span style="color: #009900;">&#41;</span>;
		setProduct<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ProductB&quot;</span><span style="color: #009900;">&#41;</span>;
		setProduct<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ProductC&quot;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setProduct<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> s<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		 product.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Enumeration</span> getProduct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		 Enumeration<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> eProduct <span style="color: #339933;">=</span> product.<span style="color: #006633;">elements</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
		 <span style="color: #000000; font-weight: bold;">return</span> eProduct;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><b>Here is Company A &#8220;Product&#8221; program which is use to display all products on console screen.</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.mkyong.adapter</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Enumeration</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Vector</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Iterator</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Product
<span style="color: #009900;">&#123;</span>   
        <span style="color: #666666; font-style: italic;">//cant change here for some reason</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> displayProduct<span style="color: #009900;">&#40;</span><span style="color: #003399;">Iterator</span> iterator<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		 <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>; iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;<span style="color: #009900;">&#41;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>   
		 Product product <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Product<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
		 <span style="color: #666666; font-style: italic;">//product.displayProduct(); //display it</span>
	 <span style="color: #009900;">&#125;</span>   
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><b>Company A use displayProduct(Iterator iterator) function to display all of the products information in console. Company A do not want to change and insist want accept Iterator as parameter.</p>
<p>Here Adapter Design Pattern can make it work without any changes involve in current system and vendor&#8217;s class as well, what Company A need to do is create an Adapter class to convert Enumeration to Iterator like below</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.mkyong.adapter</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Iterator</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Enumeration</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EnumToIteratorAdapter <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Iterator</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #003399;">Enumeration</span> enumA;
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> EnumToIteratorAdapter<span style="color: #009900;">&#40;</span><span style="color: #003399;">Enumeration</span> e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		enumA <span style="color: #339933;">=</span> e;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> hasNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> enumA.<span style="color: #006633;">hasMoreElements</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> enumA.<span style="color: #006633;">nextElement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> remove<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">UnsupportedOperationException</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><b> Ok, now revisit Company A &#8220;Product&#8221; class, it can accept Enumeration now!!! </b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.mkyong.adapter</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Enumeration</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Vector</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Iterator</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Product
<span style="color: #009900;">&#123;</span>   
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> displayProduct<span style="color: #009900;">&#40;</span><span style="color: #003399;">Iterator</span> iterator<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		 <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>; iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;<span style="color: #009900;">&#41;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>   
		 Product product <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Product<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
		 EnumProduct enumProduct <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> EnumProduct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
		 EnumToIteratorAdapter enumToIteratorAdapter <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> EnumToIteratorAdapter<span style="color: #009900;">&#40;</span>enumProduct.<span style="color: #006633;">getProduct</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
		 product.<span style="color: #006633;">displayProduct</span><span style="color: #009900;">&#40;</span>enumToIteratorAdapter<span style="color: #009900;">&#41;</span>;
	 <span style="color: #009900;">&#125;</span>   
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><b>We didn&#8217;t changed anything in either Product Class nor  EnumProduct class. We just create a new Adapter class to convert Enumration to Iterator class. Done.</b></p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/java/nullpointerexception-at-orgenhydrajdbcpoolgenericpoolgetfrompool/" title="NullPointerException at org.enhydra.jdbc.pool.GenericPool.getFromPool">NullPointerException at org.enhydra.jdbc.pool.GenericPool.getFromPool</a></li>
<li><a href="http://www.mkyong.com/java/how-to-download-file-from-website-java-jsp/" title="How to download file from website- Java / Jsp">How to download file from website- Java / Jsp</a></li>
<li><a href="http://www.mkyong.com/java/how-to-export-data-to-csv-file-java/" title="How to export data to CSV file - Java">How to export data to CSV file - Java</a></li>
<li><a href="http://www.mkyong.com/java/javalangunsupportedclassversionerror-bad-version-number-in-class-file/" title="java.lang.UnsupportedClassVersionError: Bad version number in .class file">java.lang.UnsupportedClassVersionError: Bad version number in .class file</a></li>
<li><a href="http://www.mkyong.com/java/java-web-start-jnlp-tutorial-unofficial-guide/" title="Java Web Start (Jnlp) Tutorial - UnOfficial Guide">Java Web Start (Jnlp) Tutorial - UnOfficial Guide</a></li>
<li><a href="http://www.mkyong.com/java/if-statement-becareful/" title="If statement Becareful !!!">If statement Becareful !!!</a></li>
<li><a href="http://www.mkyong.com/java/how-to-remove-whitespace-between-string-java/" title="How to remove Whitespace between String - Java">How to remove Whitespace between String - Java</a></li>
<li><a href="http://www.mkyong.com/java/java-decompiler-plugin-for-eclipse/" title="Java Decompiler Plugin For Eclipse">Java Decompiler Plugin For Eclipse</a></li>
<li><a href="http://www.mkyong.com/java/open-browser-in-java-windows-or-linux/" title="Open Browser in Java windows or Linux">Open Browser in Java windows or Linux</a></li>
<li><a href="http://www.mkyong.com/java/javalangnoclassdeffounderror-orgapachecommonslogginglogfactory/" title="java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory">java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/design-pattern/adapter-design-pattern/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to set static IP address on Unix</title>
		<link>http://www.mkyong.com/linux/how-to-set-static-ip-address-on-unix/</link>
		<comments>http://www.mkyong.com/linux/how-to-set-static-ip-address-on-unix/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 08:01:25 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[static ip address]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=189</guid>
		<description><![CDATA[In Unix system like Debian, Ubuntu or Red Hat, It is possible to set a static IP address with ifconfig command. 
My current Debian system IP address is 10.70.0.61

mkyong:~# ifconfig
eth0    Link encap:Ethernet  HWaddr 00:15:17:1D:CE:2F  
          inet addr:10.70.0.61  Bcast:10.70.3.255  Mask:255.255.252.0

I [...]]]></description>
			<content:encoded><![CDATA[<p>In Unix system like Debian, Ubuntu or Red Hat, It is possible to set a static IP address with ifconfig command. </p>
<p>My current Debian system IP address is 10.70.0.61</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># ifconfig</span>
eth0    Link encap:Ethernet  HWaddr 00:<span style="color: #000000;">15</span>:<span style="color: #000000;">17</span>:1D:CE:2F  
          inet addr:10.70.0.61  Bcast:10.70.3.255  Mask:255.255.252.0</pre></div></div>

<p>I want change it to 10.70.0.66, just issue following command to set a static IP address in unix</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 10.70.0.66 netmask 255.255.252.0</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># ifconfig eth0 10.70.0.66 netmask 255.255.252.0</span>
mkyong:~<span style="color: #666666; font-style: italic;"># ifconfig</span>
eth0    Link encap:Ethernet  HWaddr 00:<span style="color: #000000;">15</span>:<span style="color: #000000;">17</span>:1D:CE:2F  
          inet addr:10.70.0.66  Bcast:10.70.3.255  Mask:255.255.252.0</pre></div></div>

<p>Done.</p>
<p>P.S eth0 is your system network card.</p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/linux/ubuntu-default-vi-is-suck/" title="Ubuntu Default VI Is Suck!!!">Ubuntu Default VI Is Suck!!!</a></li>
<li><a href="http://www.mkyong.com/linux/error-c-compiler-cannot-create-executables-ubuntu-solution/" title="error: C compiler cannot create executables - Ubuntu (Solution)">error: C compiler cannot create executables - Ubuntu (Solution)</a></li>
<li><a href="http://www.mkyong.com/linux/root-password-in-ubuntu/" title="Root password in Ubuntu?">Root password in Ubuntu?</a></li>
<li><a href="http://www.mkyong.com/linux/how-to-find-a-file-in-linux/" title="How to find a file in linux (Solution)">How to find a file in linux (Solution)</a></li>
<li><a href="http://www.mkyong.com/linux/how-to-check-linux-cpu-information/" title="How to check Linux CPU Information">How to check Linux CPU Information</a></li>
<li><a href="http://www.mkyong.com/java/how-to-install-java-jdk-on-ubuntu-linux/" title="How to install java jdk on ubuntu (linux)">How to install java jdk on ubuntu (linux)</a></li>
<li><a href="http://www.mkyong.com/linux/how-to-check-linux-unix-distribution-version/" title="How to check Linux / Unix distribution version">How to check Linux / Unix distribution version</a></li>
<li><a href="http://www.mkyong.com/linux/how-to-enable-mouse-wheel-scrolling-in-ubuntu-vmware/" title="How to Enable Mouse Wheel Scrolling in Ubuntu (VMware)">How to Enable Mouse Wheel Scrolling in Ubuntu (VMware)</a></li>
<li><a href="http://www.mkyong.com/tomcat/how-to-install-tomcat-in-ubuntu/" title="How to install Tomcat in Ubuntu">How to install Tomcat in Ubuntu</a></li>
<li><a href="http://www.mkyong.com/linux/find-a-package-with-apt-command-ubuntu/" title="Find a package with Apt command - Ubuntu">Find a package with Apt command - Ubuntu</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/linux/how-to-set-static-ip-address-on-unix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to export table data to file / csv - PostgreSQL</title>
		<link>http://www.mkyong.com/database/how-to-export-table-data-to-file-csv-postgresql/</link>
		<comments>http://www.mkyong.com/database/how-to-export-table-data-to-file-csv-postgresql/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 03:03:46 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[export]]></category>

		<category><![CDATA[export file]]></category>

		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=188</guid>
		<description><![CDATA[My boss ask me export some data from database for him to do statistic report. PostgreSQL provided easy and useful export feature to do it. Here i will demonstrate how to export data or query result from PostgreSQL into a file or csv file.
1) Connect to PostgreSQL with psql command

yongmo@abcdb:~$ psql -p 5433 -U dba [...]]]></description>
			<content:encoded><![CDATA[<p>My boss ask me export some data from database for him to do statistic report. PostgreSQL provided easy and useful export feature to do it. Here i will demonstrate how to export data or query result from PostgreSQL into a file or csv file.</p>
<p>1) Connect to PostgreSQL with psql command</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">yongmo<span style="color: #000000; font-weight: bold;">@</span>abcdb:~$ psql <span style="color: #660033;">-p</span> <span style="color: #000000;">5433</span> <span style="color: #660033;">-U</span> dba dbname</pre></div></div>

<p>P.S i installed my PostgreSQL in port 5433, so i need to specific port number.<br />
P.S Type \? to view all available command</p>
<p>2) Type <b>\o /home/yongmo/data25000.csv</b>, it will export query result to /home/yongmo/data25000.csv file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #007800;">dbname</span>=<span style="color: #000000; font-weight: bold;">&gt;</span> \o <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>yongmo<span style="color: #000000; font-weight: bold;">/</span>data25000.csv</pre></div></div>

<p>3) Type query that you want to export</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #007800;">dbname</span>=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">select</span> url from urltable where <span style="color: #007800;">scoreid</span>=<span style="color: #000000;">1</span> limit <span style="color: #000000;">25000</span>;</pre></div></div>

<p>4) Done, all query result exported to /home/yongmo/data25000.csv</p>
<p>Here is the full command</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">yongmo<span style="color: #000000; font-weight: bold;">@</span>abcdb:~$ psql <span style="color: #660033;">-p</span> <span style="color: #000000;">5433</span> <span style="color: #660033;">-U</span> dba dbname
Password <span style="color: #000000; font-weight: bold;">for</span> user dba: 
Welcome to psql 8.2.4 <span style="color: #7a0874; font-weight: bold;">&#40;</span>server 8.3.3<span style="color: #7a0874; font-weight: bold;">&#41;</span>, the PostgreSQL interactive terminal.
&nbsp;
Type:  \copyright <span style="color: #000000; font-weight: bold;">for</span> distribution terms
       \h <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">help</span> with SQL commands
       \? <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">help</span> with psql commands
       \g or terminate with semicolon to execute query
       \q to quit
&nbsp;
WARNING:  You are connected to a server with major version <span style="color: #000000;">8.3</span>,
but your psql client is major version 8.2.  Some backslash commands,
such <span style="color: #c20cb9; font-weight: bold;">as</span> \d, might not work properly.
&nbsp;
<span style="color: #007800;">dbname</span>=<span style="color: #000000; font-weight: bold;">&gt;</span> \o <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>yongmo<span style="color: #000000; font-weight: bold;">/</span>data25000.csv
<span style="color: #007800;">dbname</span>=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">select</span> url from urltable where <span style="color: #007800;">scoreid</span>=<span style="color: #000000;">1</span> limit <span style="color: #000000;">25000</span>;
<span style="color: #007800;">dbname</span>=<span style="color: #000000; font-weight: bold;">&gt;</span> \q</pre></div></div>

<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/database/to_date-function-between-postgresql-82-and-83/" title="TO_DATE function between PostgreSQL 8.2 and 8.3">TO_DATE function between PostgreSQL 8.2 and 8.3</a></li>
<li><a href="http://www.mkyong.com/database/backup-restore-database-in-postgresql-pg_dumppg_restore/" title="Backup &#038; Restore Database in PostgreSQL (pg_dump,pg_restore)">Backup &#038; Restore Database in PostgreSQL (pg_dump,pg_restore)</a></li>
<li><a href="http://www.mkyong.com/database/postgresql-error-operator-does-not-exist-smallint-character-varying-solution/" title="PostgreSQL - ERROR: operator does not exist: smallint = character varying (Solution)">PostgreSQL - ERROR: operator does not exist: smallint = character varying (Solution)</a></li>
<li><a href="http://www.mkyong.com/database/regular-expression-in-postgresql/" title="Regular Expression in PostgreSQL">Regular Expression in PostgreSQL</a></li>
<li><a href="http://www.mkyong.com/database/install-perl-in-postgresql-the-specified-module-could-not-be-found/" title="Install Perl in PostgreSQL, The specified module could not be found.">Install Perl in PostgreSQL, The specified module could not be found.</a></li>
<li><a href="http://www.mkyong.com/database/how-to-kill-terminate-postgresql-hang-query/" title="How to kill / terminate PostgreSQL hang query">How to kill / terminate PostgreSQL hang query</a></li>
<li><a href="http://www.mkyong.com/database/postgresql-how-to-change-default-schema/" title=" PostgreSQL - How to change default schema "> PostgreSQL - How to change default schema </a></li>
<li><a href="http://www.mkyong.com/database/how-to-get-random-row-from-sql-query-postgresql/" title="How to get random row from sql query - PostgreSQL">How to get random row from sql query - PostgreSQL</a></li>
<li><a href="http://www.mkyong.com/database/convert-subquery-result-to-array/" title="Convert Subquery Result to Array">Convert Subquery Result to Array</a></li>
<li><a href="http://www.mkyong.com/database/how-to-building-postgresql-libpq-programs/" title="How to building PostgreSQL libpq Programs">How to building PostgreSQL libpq Programs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/database/how-to-export-table-data-to-file-csv-postgresql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Chrome VS FireFox 3 - Crash / Stress Test</title>
		<link>http://www.mkyong.com/boring/google-chrome-vs-firefox-3-crash-stress-test/</link>
		<comments>http://www.mkyong.com/boring/google-chrome-vs-firefox-3-crash-stress-test/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:30:20 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[boring]]></category>

		<category><![CDATA[crash test]]></category>

		<category><![CDATA[firefox 3]]></category>

		<category><![CDATA[google chrome]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=183</guid>
		<description><![CDATA[Here i want to stress test on both most popular browser in the world -  Google Chrome and Firefox 3. I create a simple html code to test on both browser.
Here is the source code

&#60;html&#62;
&#60;body&#62;
&#60;textarea id=&#34;test&#34; cols=80 rows=50&#62;&#60;/textarea&#62;
&#60;br/&#62;
&#60;script&#62;
var i;
for(i =0; i&#60;10000; i++)
{
   document.getElementById(&#34;test&#34;).value += (i + &#34; - http://www.mkyong.com\n&#34;);
}
&#60;/script&#62;
&#60;/body&#62;
&#60;/html&#62;

Above code just create [...]]]></description>
			<content:encoded><![CDATA[<p>Here i want to stress test on both most popular browser in the world -  Google Chrome and Firefox 3. I create a simple html code to test on both browser.</p>
<p>Here is the source code</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;body&gt;
&lt;textarea id=&quot;test&quot; cols=80 rows=50&gt;&lt;/textarea&gt;
&lt;br/&gt;
&lt;script&gt;
var i;
for(i =0; i&lt;10000; i++)
{
   document.getElementById(&quot;test&quot;).value += (i + &quot; - http://www.mkyong.com\n&quot;);
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Above code just create a textarea and apend string into the textarea 10000 time. <b>Saved it as html file and open it with FireFox 3 and Google Chrome to test it.</b></p>
<p><u><br />
<h2>FireFox 3</h2>
<p></u><br />
Firefox 3 will hanging and display as not responding. I cant even access others tabs. It seem hanging forever , i have to use task manager to kill it manually.</p>
<p><a href='http://www.mkyong.com/wp-content/uploads/2008/09/firefox-crash.png'><img src="http://www.mkyong.com/wp-content/uploads/2008/09/firefox-crash.png" alt="" title="firefox-crash"  /></a></p>
<p><u><br />
<h2>Google Chrome</h2>
<p></u><br />
Google Chrome will hanging as well, however it allow me to access other tabs, Only the tab running the stress test code will not responding, other function working very well without any interruption.<br />
<br />
<a href='http://www.mkyong.com/wp-content/uploads/2008/09/chrome-crash.png'><img src="http://www.mkyong.com/wp-content/uploads/2008/09/chrome-crash.png" alt="" title="chrome-crash"  /></a><br />
<br />
After few seconds, Google Chrome seem detect something wrong in my code, it just stop the stress test code and display a user friendly error message as follwing<br />
<br />
<a href='http://www.mkyong.com/wp-content/uploads/2008/09/chrome-crash-1.png'><img src="http://www.mkyong.com/wp-content/uploads/2008/09/chrome-crash-1.png" alt="" title="chrome-crash-1"   /></a></p>
<p><u><br />
<h2>Google Chrome VS FireFox 3 - Crash Test Result</h2>
<p></u><br />
Google Chrome Win with no question, it can handle abnormal and huge data loading very efficiently and it will stop with a friendly error message as well. While Firefox 3 just hanging there and wait me to kill it. </p>
<p>Actually Google Chrome is using multi-threads or multi processors concept, every single tab consider as one particular process, however all traditional browser is using single-thread concept. This is why Google Chrome can be more stable then other browser, i believe all browsers will implement this multiple thread browser idea future. Google proved itself as a leader in web standard again.<br />
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/security/google-chrome-crashes-exploits-with-undefined-handlers/" title="Google Chrome crashes / exploits with undefined-handlers">Google Chrome crashes / exploits with undefined-handlers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/boring/google-chrome-vs-firefox-3-crash-stress-test/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Chrome crashes / exploits with undefined-handlers</title>
		<link>http://www.mkyong.com/security/google-chrome-crashes-exploits-with-undefined-handlers/</link>
		<comments>http://www.mkyong.com/security/google-chrome-crashes-exploits-with-undefined-handlers/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 10:41:40 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[security]]></category>

		<category><![CDATA[exploits]]></category>

		<category><![CDATA[google chrome]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=180</guid>
		<description><![CDATA[Google Chrome was released today, it is neat and pretty, i like it very much.It just like first time i using an I-Phone, elegant and GREAT!!!  However there have one security issue that concern me.

Google Chrome will crashed or exploited with certain handlers. Google Chrome will crash and result without user interaction and pup [...]]]></description>
			<content:encoded><![CDATA[<p>Google Chrome was released today, it is neat and pretty, i like it very much.It just like first time i using an I-Phone, elegant and GREAT!!!  However there have one security issue that concern me.<br />
<br />
Google Chrome will crashed or exploited with certain handlers. Google Chrome will crash and result without user interaction and pup up message window <b>&#8220;Whoa! Google Chrome has crashed.<br />
Restart now?&#8221;.</b> If someone create a malicious link and make use of this, this will be very dangerous. I hope Google fix it as soon as possible.</p>
<p>Here i demo how do crash Google Chrome, use Google Chrome to visit this page and point your mouse to Here</p>
<h1>
<p><b>Google Exploit Test</b>:<br />Click for a demo <a href="ANYTHING:%">HERE</a></p>
</h1>
<p>Google Chrome will crashed and restart as following.<br />
<a href='http://www.mkyong.com/wp-content/uploads/2008/09/google-chrome-crashed-test.png' target=_blank><img src="http://www.mkyong.com/wp-content/uploads/2008/09/google-chrome-crashed-test.png" alt="" title="google-chrome-crashed-test" width="700" height="550" /></a></p>
<p><a href='http://www.mkyong.com/wp-content/uploads/2008/09/google-chrome-crashed.png' target=_blank><img src="http://www.mkyong.com/wp-content/uploads/2008/09/google-chrome-crashed.png" alt="" title="google-chrome-crashed" width="312" height="118" class="aligncenter size-full wp-image-181" /></a></p>
<p>Source code above</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;h1&gt;
	&lt;p&gt;&lt;b&gt;Google Exploit Test&lt;/b&gt;:&lt;br&gt;Click for a demo &lt;a href=&quot;ANYTHING:%&quot;&gt;HERE&lt;/a&gt;&lt;/p&gt; 
&lt;/h1&gt;</pre></div></div>

<p>Currently it still a beta version, i also can not comment too much, Google Chrome sure can fix it soon, and i strongly believe Google Chrome will continue to rock ~ </p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/security/f-secure-internet-security-2009-and-rising-antivirus-can-not-installed-in-a-same-computer/" title="F-Secure Internet Security 2009 and Rising Antivirus can not installed in a same computer">F-Secure Internet Security 2009 and Rising Antivirus can not installed in a same computer</a></li>
<li><a href="http://www.mkyong.com/boring/google-chrome-vs-firefox-3-crash-stress-test/" title="Google Chrome VS FireFox 3 - Crash / Stress Test">Google Chrome VS FireFox 3 - Crash / Stress Test</a></li>
<li><a href="http://www.mkyong.com/computer-tips/top-5-strongest-password/" title="Top 5 Strongest Password ">Top 5 Strongest Password </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/security/google-chrome-crashes-exploits-with-undefined-handlers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to kill / terminate PostgreSQL hang query</title>
		<link>http://www.mkyong.com/database/how-to-kill-terminate-postgresql-hang-query/</link>
		<comments>http://www.mkyong.com/database/how-to-kill-terminate-postgresql-hang-query/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 06:30:40 +0000</pubDate>
		<dc:creator>mkyong</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[hang query]]></category>

		<category><![CDATA[kill]]></category>

		<category><![CDATA[postgres]]></category>

		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.mkyong.com/?p=179</guid>
		<description><![CDATA[Today i find out one of the query is hanging in PostgreSQL, it can&#8217;t release itself, it just seem like stuck in PostgreSQL forever.

I issue a command to cancel it in PostgreSQL, but it seem not working. Query just hanging there and show an &#8220;idle in transaction&#8221; status. I have no way to terminal it, [...]]]></description>
			<content:encoded><![CDATA[<p>Today i find out one of the query is hanging in PostgreSQL, it can&#8217;t release itself, it just seem like stuck in PostgreSQL forever.<br />
<br />
I issue a command to cancel it in PostgreSQL, but it seem not working. Query just hanging there and show an &#8220;idle in transaction&#8221; status. I have no way to terminal it, it left me no choice but go Debian terminal to issue kill command to terminate it manually.<br />
<br />
Query hanging or not responding in PostgreSQL is because i didn&#8217;t handle transaction manager properly in my web application. When System accidently shut down, running query will hanging in PostgreSQL and my transaction manager (DataSourceTransactionManager) is not manage to rollback whole transaction. I have no idea why it&#8217;s not working. After i changed my transaction manager to JtaTransactionManager, it work correctly and no transaction hanging in middle way when system accidentally shut down.<br />
<br />
However here i show how to terminal the hanging query in PostgreSQL. The hanging query will display as <b>&#8220;idle in transaction&#8221; </b> in PostgreSQL. I have to list out all PostgreSQL processes and issue a kill terminate command to terminate the query manually.</p>
<p>1) Issue <b>ps -ef | grep postgres</b> to list out all processes belong to postgres user.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># ps -ef | grep postgres</span>
postgres <span style="color: #000000;">13648</span>     <span style="color: #000000;">1</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>postgresql<span style="color: #000000; font-weight: bold;">/</span>PostgresPlus8.3xxxxxxx
postgres <span style="color: #000000;">13651</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: logger process                                                                        
postgres <span style="color: #000000;">13653</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: writer process                                                                        
postgres <span style="color: #000000;">13654</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: wal writer process                                                                    
postgres <span style="color: #000000;">13655</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: autovacuum launcher process                                                           
postgres <span style="color: #000000;">13656</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: stats collector process                                                               
postgres <span style="color: #000000;">13668</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: postgres postgres 10.70.1.27<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">3734</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                               
postgres <span style="color: #000000;">13689</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:05 ?        00:00:00 postgres: usrdba db_test 10.70.1.67<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4164</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                               
postgres <span style="color: #000000;">13714</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:06 ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57586</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle <span style="color: #000000; font-weight: bold;">in</span> transaction                               
postgres <span style="color: #000000;">13721</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:06 ?        00:00:<span style="color: #000000;">16</span> postgres: usrdba db_test 10.70.1.67<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4165</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                               
postgres <span style="color: #000000;">13832</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57592</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13833</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57593</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13834</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57594</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13835</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57595</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13836</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57596</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">14201</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">23</span> ?        00:00:00 postgres: nrsdba postgres 10.70.1.8<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4419</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                  
postgres <span style="color: #000000;">14202</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">23</span> ?        00:00:00 postgres: usrdba db_test 10.70.1.8<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4420</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                
postgres <span style="color: #000000;">14207</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">24</span> ?        00:00:00 postgres: usrdba db_test 10.70.1.8<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4421</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                
root     <span style="color: #000000;">18030</span> <span style="color: #000000;">17992</span>  0 <span style="color: #000000;">13</span>:<span style="color: #000000;">46</span> pts<span style="color: #000000; font-weight: bold;">/</span>0    00:00:00 <span style="color: #c20cb9; font-weight: bold;">grep</span> postgres
mkyong:~<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>2) <b>Notice process id 13714, idle in transaction</b>, this is the hanging query in PostgreSQL. Issue following command to terminate the PostgreSQL process manually.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># kill 13714</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># kill -TERM 13714</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># kill -15 13714</span></pre></div></div>

<p>3) Done, hanging query is gone</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mkyong:~<span style="color: #666666; font-style: italic;"># ps -ef | grep postgres</span>
postgres <span style="color: #000000;">13648</span>     <span style="color: #000000;">1</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>postgresql<span style="color: #000000; font-weight: bold;">/</span>PostgresPlus8.3xxxxxxx
postgres <span style="color: #000000;">13651</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: logger process                                                                        
postgres <span style="color: #000000;">13653</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: writer process                                                                        
postgres <span style="color: #000000;">13654</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: wal writer process                                                                    
postgres <span style="color: #000000;">13655</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: autovacuum launcher process                                                           
postgres <span style="color: #000000;">13656</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: stats collector process                                                               
postgres <span style="color: #000000;">13668</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:04 ?        00:00:00 postgres: postgres postgres 10.70.1.27<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">3734</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                               
postgres <span style="color: #000000;">13689</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:05 ?        00:00:00 postgres: usrdba db_test 10.70.1.67<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4164</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                                         
postgres <span style="color: #000000;">13721</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:06 ?        00:00:<span style="color: #000000;">16</span> postgres: usrdba db_test 10.70.1.67<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4165</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                               
postgres <span style="color: #000000;">13832</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57592</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13833</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57593</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13834</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57594</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13835</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57595</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">13836</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">10</span> ?        00:00:00 postgres: usrdba db_test 10.70.0.61<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57596</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                              
postgres <span style="color: #000000;">14201</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">23</span> ?        00:00:00 postgres: nrsdba postgres 10.70.1.8<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4419</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                  
postgres <span style="color: #000000;">14202</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">23</span> ?        00:00:00 postgres: usrdba db_test 10.70.1.8<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4420</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                
postgres <span style="color: #000000;">14207</span> <span style="color: #000000;">13648</span>  0 <span style="color: #000000;">11</span>:<span style="color: #000000;">24</span> ?        00:00:00 postgres: usrdba db_test 10.70.1.8<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4421</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> idle                                                
root     <span style="color: #000000;">18030</span> <span style="color: #000000;">17992</span>  0 <span style="color: #000000;">13</span>:<span style="color: #000000;">46</span> pts<span style="color: #000000; font-weight: bold;">/</span>0    00:00:00 <span style="color: #c20cb9; font-weight: bold;">grep</span> postgres
mkyong:~<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.mkyong.com/database/postgresql-error-operator-does-not-exist-smallint-character-varying-solution/" title="PostgreSQL - ERROR: operator does not exist: smallint = character varying (Solution)">PostgreSQL - ERROR: operator does not exist: smallint = character varying (Solution)</a></li>
<li><a href="http://www.mkyong.com/database/regular-expression-in-postgresql/" title="Regular Expression in PostgreSQL">Regular Expression in PostgreSQL</a></li>
<li><a href="http://www.mkyong.com/database/performance-testing-on-partition-table-in-postgresql-part-3/" title="Performance Testing on Partition Table In PostgreSQL - Part 3">Performance Testing on Partition Table In PostgreSQL - Part 3</a></li>
<li><a href="http://www.mkyong.com/database/how-to-install-pgagent-on-windows-postgresql-job-scheduler/" title="How to install pgAgent on windows (PostgreSQL Job Scheduler)">How to install pgAgent on windows (PostgreSQL Job Scheduler)</a></li>
<li><a href="http://www.mkyong.com/database/how-to-compile-postgresql-database-source-code-in-linux/" title="How to compile PostgreSQL database source code in linux">How to compile PostgreSQL database source code in linux</a></li>
<li><a href="http://www.mkyong.com/database/how-to-export-table-data-to-file-csv-postgresql/" title="How to export table data to file / csv - PostgreSQL">How to export table data to file / csv - PostgreSQL</a></li>
<li><a href="http://www.mkyong.com/database/to_date-function-between-postgresql-82-and-83/" title="TO_DATE function between PostgreSQL 8.2 and 8.3">TO_DATE function between PostgreSQL 8.2 and 8.3</a></li>
<li><a href="http://www.mkyong.com/database/postgresql-how-to-change-default-schema/" title=" PostgreSQL - How to change default schema "> PostgreSQL - How to change default schema </a></li>
<li><a href="http://www.mkyong.com/database/how-to-get-random-row-from-sql-query-postgresql/" title="How to get random row from sql query - PostgreSQL">How to get random row from sql query - PostgreSQL</a></li>
<li><a href="http://www.mkyong.com/database/convert-subquery-result-to-array/" title="Convert Subquery Result to Array">Convert Subquery Result to Array</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mkyong.com/database/how-to-kill-terminate-postgresql-hang-query/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
