<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NULL.in</title>
	<atom:link href="http://www.nalinmakar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nalinmakar.com</link>
	<description>Nalin's Labyrinth</description>
	<lastBuildDate>Thu, 24 Dec 2009 01:50:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Running single test or class using TestNG and Ant</title>
		<link>http://www.nalinmakar.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/</link>
		<comments>http://www.nalinmakar.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 01:50:15 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testng]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=656</guid>
		<description><![CDATA[I have been using TestNG for a while now in the latest project that I am working on. We have developed a whole suite of tests for an application and TestNG has really served us well.
When it comes to running tests, we find that people (developer, testers and others) usually are hesitant to use something [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using <a  href="http://testng.org/doc/index.html">TestNG</a> for a while now in the latest project that I am working on. We have developed a whole suite of tests for an application and TestNG has really served us well.</p>
<p>When it comes to running tests, we find that people (developer, testers and others) usually are hesitant to use something that involves much learning or is different from how they are used to doing things currently. So, we found it very useful to provide utilities that made it easy for anyone to be able to pick up test artifacts and with-in a few steps be able to run tests to reproduce bugs. Because we are building our project using <a  href="http://ant.apache.org/">ant</a>, it was easy to provide a <code>build.xml</code> with the test distribution that will able to run the TestNG tests. This keeps things simple and uniform.</p>
<p>The TestNG ant task uses TestNG suites defined in XML files to run tests. It doesn&#8217;t provide an easy way to run a single test method or all the test methods in a single class. Basically, anytime someone has to run a test using this task, they need to create an XML file specifying the class and method for that test in an XML file and then execute the ant task. This can be simplified by letting ant targets take care of setting up the XML file with the require test and then executing it.</p>
<p><em>It&#8217;s quite simple</em>. You just need to create a TestNG suite XML template, modify it with the parameters that the user passes in on command line and then execute the TestNG ant task. Here&#8217;s how this can be achieved. First, create a template XML file like the following at <code>${testng.templates}/testfn.xml</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; !DOCTYPE suite SYSTEM <span style="color: #ff0000;">&quot;http://testng.org/testng-1.0.dtd&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;suite</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Single Method Suite&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Single Method Test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;@CLASS@&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;methods<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclude</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;.*&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;@TEST@&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/methods<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/classes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/suite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now, you can add the following target to the build file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;run-single-test&quot;</span> </span>
<span style="color: #009900;">         <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;run a specific test. Requires class.name property set to fully qualified name of test class and test.name property set to method name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;condition</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;propsSpecified&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;and<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isset</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;class.name&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isset</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;test.name&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/and<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/condition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fail</span> <span style="color: #000066;">unless</span>=<span style="color: #ff0000;">&quot;propsSpecified&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;class.name and/or test.name property not specified.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${tmp.dir}&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${testng.templates}/testfn.xml&quot;</span> <span style="color: #000066;">overwrite</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filterset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">token</span>=<span style="color: #ff0000;">&quot;CLASS&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${class.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">token</span>=<span style="color: #ff0000;">&quot;TEST&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${test.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filterset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;testng</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;lib.path&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">outputDir</span>=<span style="color: #ff0000;">&quot;${results.dir}/${DSTAMP}.${TSTAMP}-single-test-${class.name}-${test.name}&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">workingDir</span>=<span style="color: #ff0000;">&quot;${results.dir}/${DSTAMP}.${TSTAMP}-single-test-${class.name}-${test.name}&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">verbose</span>=<span style="color: #ff0000;">&quot;2&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">useDefaultListeners</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">listeners</span>=<span style="color: #ff0000;">&quot;${testng.listeners}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xmlfileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${tmp.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;testfn.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jvmarg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-Xmx1024m&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/testng<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The target picks the testfn.xml file, replaces the tokens with the specified input and copies it to the temp location. Now, the TestNG task can use this updated XML file to run tests. This target is invoked as:</p>
<p><code>ant run-single-test -Dclass.name=com.nalinmakar.testng.ant.Demo -Dtest.name=Test1</code></p>
<p>for the following class:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.nalinmakar.testng.ant</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Demo
<span style="color: #009900;">&#123;</span>
   @Test
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> Test1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">//do something</span>
   <span style="color: #009900;">&#125;</span>
   @Test
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> Test2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">//do something</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Similarly, you can also create a template and another ant target for running all the test methods in a class:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; !DOCTYPE suite SYSTEM <span style="color: #ff0000;">&quot;http://testng.org/testng-1.0.dtd&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;suite</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Single Class Suite&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Class Test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;@CLASS@&quot;</span>  <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/classes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/suite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;run-class&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;run all methods in a specific test class. Requires class.name property to be set to fully qualified name of class&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;condition</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;classNameSpecified&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isset</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;class.name&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/condition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fail</span> <span style="color: #000066;">unless</span>=<span style="color: #ff0000;">&quot;classNameSpecified&quot;</span></span>
<span style="color: #009900;">         <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;class.name property not specified. Don't know which test class to run.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${tmp.dir}&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${testng.templates}/class.xml&quot;</span> <span style="color: #000066;">overwrite</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filterset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">token</span>=<span style="color: #ff0000;">&quot;CLASS&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${class.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filterset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;testng</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;lib.path&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">outputDir</span>=<span style="color: #ff0000;">&quot;${results.dir}/${DSTAMP}.${TSTAMP}-class&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">workingDir</span>=<span style="color: #ff0000;">&quot;${results.dir}/${DSTAMP}.${TSTAMP}-class&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">verbose</span>=<span style="color: #ff0000;">&quot;2&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">useDefaultListeners</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">           <span style="color: #000066;">listeners</span>=<span style="color: #ff0000;">&quot;${testng.listeners}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jvmarg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-Xmx1024m&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xmlfileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${tmp.dir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;class.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/testng<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>and can invoke this as </p>
<p><code>ant run-single-test -Dclass.name=com.nalinmakar.testng.ant.Demo</code></p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2006/02/09/imagine-you-and-me/" title="Imagine you and Me">Imagine you and Me</a></li><li><a  href="http://www.nalinmakar.com/2006/01/24/zinda-2/" title="Zinda">Zinda</a></li><li><a  href="http://www.nalinmakar.com/2006/03/15/happy-holi/" title="Happy Holi !!">Happy Holi !!</a></li><li><a  href="http://www.nalinmakar.com/2006/04/15/v-for-vendetta/" title="V for Vendetta">V for Vendetta</a></li><li><a  href="http://www.nalinmakar.com/2006/04/06/some-game/" title="Some Game">Some Game</a></li><li><a  href="http://www.nalinmakar.com/2006/03/11/memoirs-of-a-geisha/" title="Memoirs of a Geisha">Memoirs of a Geisha</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix &#8220;500 Internal Error&#8221; in Wordpress</title>
		<link>http://www.nalinmakar.com/2009/11/30/fix-500-internal-error-in-wordpress/</link>
		<comments>http://www.nalinmakar.com/2009/11/30/fix-500-internal-error-in-wordpress/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 00:59:54 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[internal]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=645</guid>
		<description><![CDATA[I recently upgraded my Wordpress installation to the latest version (2.8.6) and started running into issues with uploading images. Every time I tried using the Flash Uploader I would see
HTTP Error.
On trying to use the non-flash browser based uploader, I saw the following:
Error 500 &#8211; Internal server error
An internal server error has occured!
Please try again [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my Wordpress installation to the latest version (2.8.6) and started running into issues with uploading images. Every time I tried using the Flash Uploader I would see</p>
<blockquote><p><span style="color: #ff0000;">HTTP Error.</span></p></blockquote>
<p>On trying to use the non-flash browser based uploader, I saw the following:</p>
<blockquote><p><strong><span style="color: #000080;">Error 500 &#8211; Internal server error</span></strong><br />
An internal server error has occured!<br />
Please try again later.</p></blockquote>
<p>I googled quite a bit and finally found a solution. This error can happen because of quite a few different reasons:</p>
<ol>
<li>Incompatible plugins</li>
<li>Incorrect .htaccess file contents</li>
<li>PHP running out of memory</li>
<li>Incorrect file permissions</li>
<li>Not using PHP5</li>
</ol>
<h4>Incompatible plugins</h4>
<p>Easiest way to find if this is the issue is to deactivate all plug-ins and see if the issue still persists. If it goes away you can activate each plug-in one by one to find the culprit. You can read more on managing plug-ins <a  href="http://codex.wordpress.org/Managing_Plugins">here</a>.</p>
<h4>Incorrect .htaccess file contents</h4>
<p>For some people, the issue went away after fixing the <code>.htaccess</code> file contents. You need to ensure that the .htaccess file at root of your website has the following contents:</p>
<pre># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
# END WordPress</pre>
<p>You can read more about it <a  href="http://edwardkhoo.com/internal-server-error-500-for-wordpress-blog/">here</a>.</p>
<h4>PHP running out of Memory</h4>
<p>This can happen if you are using some memory hungry plug-ins. You can fix this issue by adding a <code>php.ini</code> file in <code>&lt;wordpresss_root&gt;/wp-admin</code> folder with the following contents:</p>
<pre>memory=20MB</pre>
<p>You can read more about this at <a  href="http://www.codedifferent.com/2009/01/12/solution-for-500-internal-server-error-after-upgrading-to-wordpress-27-at-1and1-server/">codedifferent.com</a>, where this is explained in more details.</p>
<h4>Incorrect file permissions</h4>
<p>Wordpress can start acting up if the permissions on directories and files in Wordpress installation aren&#8217;t set up properly. You can ensure that this is fixed by logging into your hosting provider and making sure all files and directories have permissions set to <strong>755</strong>.</p>
<p>Another issue that might lead to errors while uploading is certain security issues with files used for uploading. This can be fixed by using <a  href="http://wordpress.org/extend/plugins/image-upload-http-error-fix/">Image Upload HTTP Error Fix</a> plug-in. Otherwise, you could edit .htaccess to add the following lines:</p>
<pre>#BEGIN Image Upload HTTP Error Fix
&lt;IfModule mod_security.c&gt;
&lt;Files async-upload.php&gt;
SecFilterEngine Off
SecFilterScanPOST Off
&lt;/Files&gt;
&lt;/IfModule&gt;
&lt;IfModule security_module&gt;
&lt;Files async-upload.php&gt;
SecFilterEngine Off
SecFilterScanPOST Off
&lt;/Files&gt;
&lt;/IfModule&gt;
&lt;IfModule security2_module&gt;
&lt;Files async-upload.php&gt;
SecFilterEngine Off
SecFilterScanPOST Off
&lt;/Files&gt;
&lt;/IfModule&gt;
#END Image Upload HTTP Error Fix</pre>
<h4>Not using PHP5</h4>
<p>Even after doing all the above, things weren&#8217;t working for me. That is when I came across <a  href="http://wordpress.org/support/topic/274197">this post</a>, which explains that the issue could be because PHP5 wasn&#8217;t enabled. According to a <a  href="http://faq.1and1.com/scripting_languages_supported/php/upgrade/6.html">help article on 1and1.com</a>, fix is to just add the following line in <code>.htaccess</code> file:</p>
<pre>#enable php5
AddType x-mapp-php5 .php</pre>
<p>This fixed the issue for me!</p>
<p>Hope this helps.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2008/12/06/removing-tags-from-posts-contents-in-wordpress/" title="Removing tags from Wordpress posts content">Removing tags from Wordpress posts content</a></li><li><a  href="http://www.nalinmakar.com/2008/09/02/hemingwayex-15-final/" title="HemingwayEx 1.5 Final">HemingwayEx 1.5 Final</a></li><li><a  href="http://www.nalinmakar.com/2008/04/29/hemingwayex-11-is-finally-here/" title="Hemingwayex 1.1 is finally here">Hemingwayex 1.1 is finally here</a></li><li><a  href="http://www.nalinmakar.com/2007/12/02/hemingwayex-11-on-its-way/" title="HemingwayEx 1.1 on it&#8217;s way">HemingwayEx 1.1 on it&#8217;s way</a></li><li><a  href="http://www.nalinmakar.com/2007/11/20/long-long-time-ago/" title="Long long time ago&#8230;">Long long time ago&#8230;</a></li><li><a  href="http://www.nalinmakar.com/2007/07/15/say-hello-to-hemingwayex-10/" title="Say Hello to HemingwayEx 1.0">Say Hello to HemingwayEx 1.0</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2009/11/30/fix-500-internal-error-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What is wrong with me?</title>
		<link>http://www.nalinmakar.com/2009/11/28/what-is-wrong-with-me/</link>
		<comments>http://www.nalinmakar.com/2009/11/28/what-is-wrong-with-me/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 22:41:29 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[wrong]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=619</guid>
		<description><![CDATA[Click to enlarge and see if you can figure this out&#8230;

Related PostsConnect to MS SQL Server using JDBC]]></description>
			<content:encoded><![CDATA[<p>Click to enlarge and see if you can figure this out&#8230;</p>
<p><a  ref="lightbox" href="http://www.nalinmakar.com/blog/wp-content/uploads/2009/11/whats-wrong-with-me.png" rel="lightbox"><img class="aligncenter size-full wp-image-642" title="Whats wrong with me?" src="http://www.nalinmakar.com/blog/wp-content/uploads/2009/11/whats-wrong-with-me.png" alt="Whats wrong with me?" width="620" height="251" /></a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2008/12/13/connect-to-ms-sql-server-using-jdbc/" title="Connect to MS SQL Server using JDBC">Connect to MS SQL Server using JDBC</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2009/11/28/what-is-wrong-with-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tropical Cyclone Nisha</title>
		<link>http://www.nalinmakar.com/2009/04/09/tropical-cyclone-nisha/</link>
		<comments>http://www.nalinmakar.com/2009/04/09/tropical-cyclone-nisha/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 20:51:42 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=547</guid>
		<description><![CDATA[Came across this last year while checking on Hyderabad&#8217;s weather in December. They actually named a tropical cyclone after my wife&#8217;s name !!  
The cyclone went over the southern regions of India and has now settled in my life  

Random PostsFirefox 1.5 BetaPontiac VibeMemoirs of a GeishaRang De BasantiHarry Potter and The Deathly [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this last year while checking on Hyderabad&#8217;s weather in December. They actually named a tropical cyclone after my wife&#8217;s name !! <img src='http://www.nalinmakar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The cyclone went over the southern regions of India and has now settled in my life <img src='http://www.nalinmakar.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p style="text-align: center;"><a  rel="lightbox" href="http://www.nalinmakar.com/blog/wp-content/uploads/2009/04/tropicalcyclonenisha.png"><img class="size-full wp-image-594 aligncenter" title="tropicalcyclonenisha" src="http://www.nalinmakar.com/blog/wp-content/uploads/2009/04/tropicalcyclonenisha.png" alt="tropicalcyclonenisha" width="419" height="455" /></a></p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2006/07/04/mt-rushmore-trip/" title="Mt Rushmore Trip">Mt Rushmore Trip</a></li><li><a  href="http://www.nalinmakar.com/2005/12/01/december-is-here/" title="December is here">December is here</a></li><li><a  href="http://www.nalinmakar.com/2005/11/29/when-love-and-hate-collide-by-def-leppard/" title="When love and hate collide by Def Leppard">When love and hate collide by Def Leppard</a></li><li><a  href="http://www.nalinmakar.com/2007/02/18/introducing-hemingwayex-for-wordpress/" title="Introducing HemingwayEx for Wordpress">Introducing HemingwayEx for Wordpress</a></li><li><a  href="http://www.nalinmakar.com/2007/03/10/citibank-credit-line-increase/" title="Citibank credit line increase">Citibank credit line increase</a></li><li><a  href="http://www.nalinmakar.com/2005/12/04/firefox-15-and-flock/" title="Firefox 1.5 and Flock">Firefox 1.5 and Flock</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2009/04/09/tropical-cyclone-nisha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Desi Habits</title>
		<link>http://www.nalinmakar.com/2009/04/05/desi-habits/</link>
		<comments>http://www.nalinmakar.com/2009/04/05/desi-habits/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 23:17:31 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[desi]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=577</guid>
		<description><![CDATA[Got the following list as a forward. Being quite a typical desi, I do have to agree with quite a few of them  

The only reason you go to a temple on festivals is because there is free food.
You keep comparing prices at electronics store for the phone you bought six months ago.
You bought [...]]]></description>
			<content:encoded><![CDATA[<p>Got the following list as a forward. Being quite a typical desi, I do have to agree with quite a few of them <img src='http://www.nalinmakar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<ul>
<li>The only reason you go to a temple on festivals is because there is free food.</li>
<li>You keep comparing prices at electronics store for the phone you bought six months ago.</li>
<li>You bought a Toyota or Honda car only because it has better resale value.</li>
<li>You ask for a small drink at fast food restaurant because the refill is free.</li>
<li>You spent 2 days cleaning your apartment before leaving so you can get full security refund from your landlord.</li>
<li>You don&#8217;t know any American outside your work.</li>
<li>You try to ignore all other unknown desis around you.</li>
<li>You talk to Americans as if you represent your whole country.</li>
<li>You frequent to yard sales every week.</li>
<li>You use grocery bags as garbage bags.</li>
<li>Office supplies mysteriously find their way in your house.</li>
<li>You don&#8217;t want to buy a printer because you can always use the office printer.</li>
<li>You decide to marry a girl/guy that your parents fixed you up with.</li>
<li>You split the tax from your common grocery bill.</li>
<li>You know more than one plans offered by long distance companies.</li>
<li>You take plain water instead of Coke for lunch.</li>
<li>You take any drink with no ice because you can&#8217;t drink ice.</li>
<li>You ask before eating any meat &#8220;Is this beef?&#8221;</li>
<li>You know all the facilities available at public library.</li>
<li>You find taco bell sauce packets in your kitchen drawer.</li>
<li>You take off your shoes before stepping foot in your living room.</li>
<li>You like onion rings at Burger King.</li>
<li>You are looking for dual voltage appliances and GSM cellphones</li>
<li>The number of long distance calls is more than domestic calls.<span style="font-family: Calibri,Verdana,Helvetica,Arial;"><span style="font-size: 11pt;"> </span></span></li>
<li>Your first name ends with kumar, bhai or ben</li>
<li>You have at least one India made pressure cooker in your kitchen.</li>
<li>You know how much a 7 layer burrito costs at Taco Bell.</li>
<li>Put oil in your hair.</li>
<li>You have a picture of Indian Deity on the dashboard of your car.</li>
<li>This thought comes to you &#8220;Oh Shit I just saw another desis&#8221; when you are window shopping at a local mall.</li>
<li>You are compelled to visit every major city in U.S. just so as to say that &#8220;Yes, I have been there&#8221;.</li>
<li>You pay your bills the day they come in mail.</li>
<li>You buy rice in the 20lb bags or larger.</li>
<li>You have postponed buying answering machine because the phone you are planning to buy six months later has built-in answering machine.</li>
<li>You start spelling your name to the operator like A as in Apple, B as in boy, T as in train&#8230; well you get the idea.</li>
<li>You bring over the counter medicine like Iodex and Vicks from India</li>
<li>You know the current differential in gold prices between India and U.S.</li>
<li>Use the credit card with maximum cash back</li>
<li>You have collected enough frequent flier miles for an international trip.</li>
<li>You are saving more than 30% of your salary.</li>
</ul>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2006/06/03/credit-report/" title="Credit Report">Credit Report</a></li><li><a  href="http://www.nalinmakar.com/2005/10/21/sprite-ad-for-desi-techies/" title="Sprite Ad for Desi techies">Sprite Ad for Desi techies</a></li><li><a  href="http://www.nalinmakar.com/2005/08/10/top-21-things-an-indian-does-after-returning-to-india-from-us/" title="Top 21 things an Indian does after returning to India from &#8220;US&#8221;">Top 21 things an Indian does after returning to India from &#8220;US&#8221;</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2009/04/05/desi-habits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove menu icons in Mac</title>
		<link>http://www.nalinmakar.com/2009/02/28/remove-menu-icons-in-mac/</link>
		<comments>http://www.nalinmakar.com/2009/02/28/remove-menu-icons-in-mac/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 20:58:40 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[remove]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=575</guid>
		<description><![CDATA[I had a lingering networking related icon in the menu bar that I could find a way to get rid of. I tried looking at all the settings I could find in System Preferences to get hide the icon, but was unsuccessfuly.
Finally after googling a bit, I came to know that it is infact very [...]]]></description>
			<content:encoded><![CDATA[<p>I had a lingering networking related icon in the menu bar that I could find a way to get rid of. I tried looking at all the settings I could find in System Preferences to get hide the icon, but was unsuccessfuly.</p>
<p>Finally after googling a bit, I came to know that it is infact very very simple to do this.</p>
<blockquote><p>Hold down the command key and drag the <span class="highlight">icon</span> out of the menu bar. Done.</p></blockquote>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2006/05/04/water/" title="Water">Water</a></li><li><a  href="http://www.nalinmakar.com/2005/06/07/pete-cabrinha-riding-a-70ft/" title="Pete Cabrinha riding a 70ft">Pete Cabrinha riding a 70ft</a></li><li><a  href="http://www.nalinmakar.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/" title="Running single test or class using TestNG and Ant">Running single test or class using TestNG and Ant</a></li><li><a  href="http://www.nalinmakar.com/2006/02/16/the-pink-panther/" title="The Pink Panther">The Pink Panther</a></li><li><a  href="http://www.nalinmakar.com/2005/07/07/testing-blogjet/" title="testing Blogjet">testing Blogjet</a></li><li><a  href="http://www.nalinmakar.com/2006/03/24/16-blocks/" title="16 Blocks">16 Blocks</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2009/02/28/remove-menu-icons-in-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This door is alarmed</title>
		<link>http://www.nalinmakar.com/2008/12/17/this-door-is-alarmed/</link>
		<comments>http://www.nalinmakar.com/2008/12/17/this-door-is-alarmed/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 06:30:58 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=571</guid>
		<description><![CDATA[
Random PostsGlobat SucksEdisonMovie Time&#8230;Kiss Kiss Bang BangTop 21 things an Indian does after returning to India from &#8220;US&#8221;I cooked !]]></description>
			<content:encoded><![CDATA[<p><a  rel="lightbox" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/6a00e3989eb38f000200f48cef67350002-500pi.jpg"><img class="alignnone size-full wp-image-572" title="Door is alarmed" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/6a00e3989eb38f000200f48cef67350002-500pi.jpg" alt="" width="500" height="400" /></a></p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2005/09/27/amazoncom-contact-phone-number/" title="Amazon.com Contact Phone Number">Amazon.com Contact Phone Number</a></li><li><a  href="http://www.nalinmakar.com/2005/07/05/hello-world/" title="Hello World">Hello World</a></li><li><a  href="http://www.nalinmakar.com/2006/09/24/flurry-the-best-screensaver-ever/" title="Flurry: The best screensaver ever !!">Flurry: The best screensaver ever !!</a></li><li><a  href="http://www.nalinmakar.com/2006/03/08/usual-suspects/" title="Usual Suspects">Usual Suspects</a></li><li><a  href="http://www.nalinmakar.com/2005/08/20/google-desktop-v20-beta/" title="Google Desktop v2.0 BETA">Google Desktop v2.0 BETA</a></li><li><a  href="http://www.nalinmakar.com/2005/08/19/types-of-girls/" title="Types of Girls">Types of Girls</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2008/12/17/this-door-is-alarmed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect to MS SQL Server using JDBC</title>
		<link>http://www.nalinmakar.com/2008/12/13/connect-to-ms-sql-server-using-jdbc/</link>
		<comments>http://www.nalinmakar.com/2008/12/13/connect-to-ms-sql-server-using-jdbc/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 00:51:56 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=537</guid>
		<description><![CDATA[The following example shows a java class that can be used to verify if you connection to MS SQL Server using JDBC is working properly. The following code establishes a connection to MS SQL server and then executes a query to print system tables. You need to get Microsoft&#8217;s JDBC drivers or jTDS JDBC drivers.

import [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows a java class that can be used to verify if you connection to MS SQL Server using JDBC is working properly. The following code establishes a connection to MS SQL server and then executes a query to print system tables. You need to get <a  href="http://msdn.microsoft.com/en-us/data/aa937724.aspx">Microsoft&#8217;s JDBC drivers</a> or <a  href="http://jtds.sourceforge.net/">jTDS JDBC drivers</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.Connection</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.DriverManager</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.ResultSet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.Statement</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ConnectMSSQLServer
<span style="color: #009900;">&#123;</span>
¬†¬† <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> dbConnect<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_connect_string,
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #003399;">String</span> db_userid,
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #003399;">String</span> db_password<span style="color: #009900;">&#41;</span>
¬†¬† <span style="color: #009900;">&#123;</span>
¬†¬†¬†¬†¬† <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #003399;">Connection</span> conn <span style="color: #339933;">=</span> <span style="color: #003399;">DriverManager</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>db_connect_string,
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† db_userid, db_password<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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><span style="color: #0000ff;">&quot;connected&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #003399;">Statement</span> statement <span style="color: #339933;">=</span> conn.<span style="color: #006633;">createStatement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #003399;">String</span> queryString <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select * from sysobjects where type='u'&quot;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #003399;">ResultSet</span> rs <span style="color: #339933;">=</span> statement.<span style="color: #006633;">executeQuery</span><span style="color: #009900;">&#40;</span>queryString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>rs.<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;">&#123;</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>rs.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #009900;">&#125;</span>
¬†¬†¬†¬†¬† <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
¬†¬†¬†¬†¬†¬†¬†¬† e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬† <span style="color: #009900;">&#125;</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>
¬†¬†¬†¬†¬† ConnectMSSQLServer connServer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ConnectMSSQLServer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬†¬†¬†¬† connServer.<span style="color: #006633;">dbConnect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jdbc:sqlserver://&amp;lt;hostname&amp;gt;&quot;</span>, <span style="color: #0000ff;">&quot;&amp;lt;user&amp;gt;&quot;</span>,
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† <span style="color: #0000ff;">&quot;&amp;lt;password&amp;gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
¬†¬† <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Change <code>&lt;hostname&gt;</code>, <code>&lt;user&gt;</code> and <code>&lt;password&gt;</code> to the correct values. Also, if you use the jTDS drivers, the driver class should be set to <code>net.sourceforge.jtds.jdbc.Driver</code>.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2009/11/28/what-is-wrong-with-me/" title="What is wrong with me?">What is wrong with me?</a></li><li><a  href="http://www.nalinmakar.com/2008/12/06/removing-tags-from-posts-contents-in-wordpress/" title="Removing tags from Wordpress posts content">Removing tags from Wordpress posts content</a></li><li><a  href="http://www.nalinmakar.com/2006/08/01/mass-string-replace-in-mysql/" title="Mass string replace in MySQL">Mass string replace in MySQL</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2008/12/13/connect-to-ms-sql-server-using-jdbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Friend&#8217;s Laptop</title>
		<link>http://www.nalinmakar.com/2008/12/10/my-friends-laptop/</link>
		<comments>http://www.nalinmakar.com/2008/12/10/my-friends-laptop/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 06:50:31 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[laptop]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=548</guid>
		<description><![CDATA[One of my friends is using a really messed up Dell Inspiron 8600 right now that should have actually been decommissioned ages ago&#8230; Almost the whole of left half of the screen is useless and it needs a support to hold up the screen while in use. Pictures below show what I am talking about:

Related [...]]]></description>
			<content:encoded><![CDATA[<p>One of my friends is using a really messed up Dell Inspiron 8600 right now that should have actually been decommissioned ages ago&#8230; Almost the whole of left half of the screen is useless and it needs a support to hold up the screen while in use. Pictures below show what I am talking about:</p>
<p><a  rel="lightbox[laptop]" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/img_1682.jpg"><img class="alignnone size-thumbnail wp-image-557" title="img_1682" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/img_1682-150x150.jpg" alt="" width="150" height="150" /></a><a  rel="lightbox[laptop]" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/img_1681.jpg"><img class="alignnone size-thumbnail wp-image-556" title="img_1681" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/img_1681.jpg" alt="" width="150" height="150" /></a><a  rel="lightbox[laptop]" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/img_1680.jpg"><img class="alignnone size-thumbnail wp-image-555" title="img_1680" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/img_1680-150x150.jpg" alt="" width="150" height="150" /></a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2005/10/27/inspiron-8600-problems-update/" title="Inspiron 8600 Problems (Update)">Inspiron 8600 Problems (Update)</a></li><li><a  href="http://www.nalinmakar.com/2005/10/23/dell-8600-problems/" title="Dell 8600 problems">Dell 8600 problems</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2008/12/10/my-friends-laptop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Triumph</title>
		<link>http://www.nalinmakar.com/2008/12/07/triumph/</link>
		<comments>http://www.nalinmakar.com/2008/12/07/triumph/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 00:00:25 +0000</pubDate>
		<dc:creator>Nalin</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[driving]]></category>
		<category><![CDATA[light]]></category>

		<guid isPermaLink="false">http://www.nalinmakar.com/?p=533</guid>
		<description><![CDATA[Oh Shit !!
Come on&#8230; you can make it&#8230;
Yesssssssss !
Random Posts?JarheadUrban DictionaryThe Skeleton KeyUsual SuspectsZinda]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a  rel="lightbox[triumph]" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/1.jpg"><img class="size-full wp-image-565 aligncenter" title="1" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/1.jpg" alt="" width="500" height="142" /></a>Oh Shit !!</p>
<p style="text-align: center;"><a  rel="lightbox[triumph]" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/2.jpg"><img class="aligncenter size-full wp-image-566" title="2" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/2.jpg" alt="" width="500" height="142" /></a>Come on&#8230; you can make it&#8230;</p>
<p style="text-align: center;"><a  rel="lightbox[triumph]" href="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/3.jpg"><img class="aligncenter size-full wp-image-567" title="3" src="http://www.nalinmakar.com/blog/wp-content/uploads/2008/12/3.jpg" alt="" width="500" height="142" /></a>Yesssssssss !</p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a  href="http://www.nalinmakar.com/2005/06/29/audioblogger/" title="Audioblogger">Audioblogger</a></li><li><a  href="http://www.nalinmakar.com/2005/06/27/movie-review-mr-mrs-smith/" title="Mr. &#038; Mrs. Smith">Mr. &#038; Mrs. Smith</a></li><li><a  href="http://www.nalinmakar.com/2005/06/07/googles-proposed-future/" title="Google&#8217;s proposed future">Google&#8217;s proposed future</a></li><li><a  href="http://www.nalinmakar.com/2005/09/12/matchstick-men-movie-review/" title="Matchstick Men">Matchstick Men</a></li><li><a  href="http://www.nalinmakar.com/2005/06/27/movie-review-batman-begins/" title="Batman Begins">Batman Begins</a></li><li><a  href="http://www.nalinmakar.com/2006/06/18/cars/" title="Cars">Cars</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.nalinmakar.com/2008/12/07/triumph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
