<?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>ByteChip &#187; Tutorials</title> <atom:link href="http://www.bytechip.com/category/tutorials/feed/" rel="self" type="application/rss+xml" /><link>http://www.bytechip.com</link> <description>Technology Blog with updated news about Mobiles, Gadgets, Laptops, Windows, Linux, Tutorial, Internet, Web</description> <lastBuildDate>Mon, 23 Jan 2012 19:48:23 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Magento Page URL Key Rewrite</title><link>http://www.bytechip.com/2011/12/magento-page-url-key-rewrite/</link> <comments>http://www.bytechip.com/2011/12/magento-page-url-key-rewrite/#comments</comments> <pubDate>Wed, 21 Dec 2011 08:54:06 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[301]]></category> <category><![CDATA[magento]]></category> <category><![CDATA[page-redirect]]></category> <category><![CDATA[redirect]]></category> <category><![CDATA[rewrite]]></category> <category><![CDATA[tutorial]]></category> <category><![CDATA[url]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=7535</guid> <description><![CDATA[Recently I migrated from WordPress to Magento framework for my second website HowPriceIndia (www.howpriceindia.com). Although... <a
class="meta-more" href="http://www.bytechip.com/2011/12/magento-page-url-key-rewrite/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>Recently I migrated from WordPress to Magento framework for my second website <strong>HowPriceIndia</strong> (<a
title="HowPriceIndia" href="http://howpriceindia.com" target="_blank">www.howpriceindia.com</a>). Although the framework is quite good for product management, there are few bugs still unresolved in Magento. One such flaw is that when you update a Page URL Key, the link address will be changed but the references still point to the old URL key. For example is I have a page called <strong>About</strong> with the URL Key &#8211; <strong>About-us</strong> and I want to modify it to <strong>About</strong>, then explicitly we need to write a redirect for the same.</p><h2>Solution</h2><p>If you are quite well in database you can simply rewrite the URL key in the database, else the best way to solve this problem is to write a redirect. To define a redirect follow the below steps.</p><ol><li>In the admin page, select <strong>Catalog -&gt; URL Rewrite Management</strong>.<p><div
id="attachment_7538" class="wp-caption aligncenter" style="width: 256px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/12/menu.png"><img
class="size-full wp-image-7538" title="menu" src="http://www.bytechip.com/wp-content/uploads/2011/12/menu.png" alt="menu Magento Page URL Key Rewrite" width="246" height="235" /></a><p
class="wp-caption-text">Magento Catalog URL Key Rewrite</p></div></li><li>Click on <strong>Add URL Rewrite</strong> button.</li><li>Select <strong>Custom</strong> from the drop down button.</li><li>In the new page that is opened, select the ID Path of the URL. For example if you need to change <strong>www.bytechip.com/about-us</strong> to <strong>www.bytechip.com/about</strong> , then the ID would be www.bytechip.com/ and the <strong>Request Path is about-us</strong> and the <strong>Target Path is about.</strong></li><li>Select <strong>Permanent(301)</strong> as the redirect type and click on <strong>save</strong> to apply the changes.</li></ol><p>&nbsp;</p><div
id="attachment_7537" class="wp-caption aligncenter" style="width: 538px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/12/redirect.png"><img
class="size-full wp-image-7537" title="redirect" src="http://www.bytechip.com/wp-content/uploads/2011/12/redirect.png" alt="redirect Magento Page URL Key Rewrite" width="528" height="505" /></a><p
class="wp-caption-text">URL Redirect - Magento</p></div> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/12/magento-page-url-key-rewrite/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to include libraries in Eclipse CDT using Plugin</title><link>http://www.bytechip.com/2011/09/how-include-libraries-eclipse-plugin/</link> <comments>http://www.bytechip.com/2011/09/how-include-libraries-eclipse-plugin/#comments</comments> <pubDate>Sat, 17 Sep 2011 08:06:31 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[c]]></category> <category><![CDATA[cdt]]></category> <category><![CDATA[eclipse]]></category> <category><![CDATA[library]]></category> <category><![CDATA[packages]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[tutorial]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=7336</guid> <description><![CDATA[This tutorial is about how to avoid specifying the libraries package in each of the... <a
class="meta-more" href="http://www.bytechip.com/2011/09/how-include-libraries-eclipse-plugin/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>This tutorial is about how to avoid specifying the libraries package in each of the project in eclipse. Eclipse CDT supports C and C++ development using their package. In many of the projects you have to manually specify the library packages but including them (Project → Properties). Certains programs using OpenGl, GTK etc have a lot of library packages that should be included. Doing so in the normal mode will be a very tedious job.</p><h2>Pkg-Config-support-for-Eclipse-CDT</h2><p>This plugin will provide automation of including library packages. More details about this plugin can be found from the <a
href="http://code.google.com/p/pkg-config-support-for-eclipse-cdt/" target="_blank">Google code page</a>.</p><h2>Installing Procedure</h2><ol><li>In Eclipse menubar select <strong>Help</strong> -&gt; <strong>Install New Software</strong>.</li><li>Add the following link to the Software list. <strong>http://petrituononen.com/pkg-config-support-for-eclipse-cdt/update</strong></li><li>Select <strong>Pkg-config support</strong> from the option and Install (Click Finish button and accept the license agreement).</li><li>Restart Eclipse for the changes to take place.</li></ol><h2>Usage</h2><ol><li>Open your Project Properties (Click right on the Project from Project Exploer and select Properties)</li><li>Select <strong>C/C++ Build</strong> and <strong>Settings</strong>.<p><div
id="attachment_7337" class="wp-caption aligncenter" style="width: 172px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/09/properties.png"><img
class="size-full wp-image-7337 " title="properties" src="http://www.bytechip.com/wp-content/uploads/2011/09/properties.png" alt="properties How to include libraries in Eclipse CDT using Plugin" width="162" height="320" /></a><p
class="wp-caption-text">Project Properties</p></div></li><li>Click on the last tab option &#8220;<strong>Pkg-config</strong>&#8220;, check the library packages that you want to include in the project.</li><li>Restart Eclipse and build the project.</li></ol><div
id="attachment_7338" class="wp-caption aligncenter" style="width: 510px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/09/Pk-config.png"><img
class="size-full wp-image-7338" title="Pk-config" src="http://www.bytechip.com/wp-content/uploads/2011/09/Pk-config.png" alt="Pk config How to include libraries in Eclipse CDT using Plugin" width="500" height="191" /></a><p
class="wp-caption-text">Pkg-config</p></div> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/09/how-include-libraries-eclipse-plugin/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to hide all posts from Friends or Pages in Facebook</title><link>http://www.bytechip.com/2011/09/hide-posts-friends-page-facebook/</link> <comments>http://www.bytechip.com/2011/09/hide-posts-friends-page-facebook/#comments</comments> <pubDate>Mon, 05 Sep 2011 02:13:59 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[facebook]]></category> <category><![CDATA[hide friends]]></category> <category><![CDATA[page]]></category> <category><![CDATA[posts]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=7308</guid> <description><![CDATA[Some of our readers have requested us to write a tutorial on how to hide... <a
class="meta-more" href="http://www.bytechip.com/2011/09/hide-posts-friends-page-facebook/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>Some of our readers have requested us to write a tutorial on how to hide posts from their friends and certain pages and applications in Facebook. If you need tutorials on anything related to computers, do drop us a mail.  Facebook has inbuilt support to hide posts. You can use them to hide all the present and the future posts of a person, page or a application in Facebook.</p><h2>Hide all Posts from a Friends, Pages and Apps in Facebook</h2><ol><li>Next to every post that you see on your Facebook homepage, you can find a small <strong>x</strong>button in the top right.<p><div
id="attachment_7310" class="wp-caption aligncenter" style="width: 572px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/09/facebook_hide.png"><img
class="size-full wp-image-7310" title="facebook_hide" src="http://www.bytechip.com/wp-content/uploads/2011/09/facebook_hide.png" alt="facebook hide How to hide all posts from Friends or Pages in Facebook" width="562" height="102" /></a><p
class="wp-caption-text">Facebook Hide Posts</p></div></li><li>Click on &#8220;<strong>hide this post</strong>&#8221; option in the drop down. <a
href="http://www.bytechip.com/wp-content/uploads/2011/09/Hide_posts_facebook.png"><img
class="aligncenter size-full wp-image-7312" title="Hide_posts_facebook" src="http://www.bytechip.com/wp-content/uploads/2011/09/Hide_posts_facebook.png" alt="Hide posts facebook How to hide all posts from Friends or Pages in Facebook" width="521" height="96" /></a></li><li>Now you will be provided with three options, to restore the hidden post, to unfriend the person and to hide all the posts from the person.<p><div
id="attachment_7316" class="wp-caption aligncenter" style="width: 285px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/09/Screenshot.png"><img
class="size-full wp-image-7316" title="Screenshot" src="http://www.bytechip.com/wp-content/uploads/2011/09/Screenshot.png" alt="Screenshot How to hide all posts from Friends or Pages in Facebook" width="275" height="72" /></a><p
class="wp-caption-text">Facebook</p></div></li><li>Click on <strong>Hide all by &lt;friend_name&gt;</strong> link to hide all the posts from the person.</li></ol><p><strong>Note :</strong> Earlier blocking people used to be one option when you click on the x button in the top right but now they have modified it, may be because users tend to click on it accidentally.</p> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/09/hide-posts-friends-page-facebook/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Best three softwares to bypass proxy</title><link>http://www.bytechip.com/2011/08/best-three-softwares-ways-to-bypass-proxy/</link> <comments>http://www.bytechip.com/2011/08/best-three-softwares-ways-to-bypass-proxy/#comments</comments> <pubDate>Thu, 04 Aug 2011 09:34:52 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[application]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[macos]]></category> <category><![CDATA[proxy]]></category> <category><![CDATA[server]]></category> <category><![CDATA[software]]></category> <category><![CDATA[tutorial]]></category> <category><![CDATA[Windows]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=7034</guid> <description><![CDATA[Proxy restrictions in offices, schools, colleges and universities are common problem for users. Today I&#8217;m... <a
class="meta-more" href="http://www.bytechip.com/2011/08/best-three-softwares-ways-to-bypass-proxy/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>Proxy restrictions in offices, schools, colleges and universities are common problem for users. Today I&#8217;m going to share with you three applications using which you can bypass proxy restrictions in both Windows and linux.</p><h2>Proxifier</h2><p>This is the probably the best and the fastest of the three proxy softwares. Proxifier works on MacOS and in Windows. Using proxifier you can connect using the HTTPS or the SOCKS proxy. Proxifier lets you browse any blocked websites. The good thing is you could download torrents in your restricted internet. There is no Linux version of Proxifier and its not compatible with WINE or other emulators.</p><div
id="attachment_7035" class="wp-caption aligncenter" style="width: 304px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/08/proxifier.gif"><img
class="size-full wp-image-7035" title="proxifier" src="http://www.bytechip.com/wp-content/uploads/2011/08/proxifier.gif" alt="proxifier Best three softwares to bypass proxy" width="294" height="69" /></a><p
class="wp-caption-text">Proxifier</p></div><h2>UltraSurf</h2><p>This proxy isn&#8217;t that fast as compared to Proxifier. Ultrasurf is completely free to use. Torrent download is somehow not possible using Ultrasurf. The good thing is it runs on Linux with WINE emulator. So if you are Linux user, you can very well use this.</p><div
id="attachment_7036" class="wp-caption aligncenter" style="width: 375px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/08/Ultrasurf.jpg"><img
class="size-full wp-image-7036" title="Ultrasurf" src="http://www.bytechip.com/wp-content/uploads/2011/08/Ultrasurf.jpg" alt="Ultrasurf Best three softwares to bypass proxy" width="365" height="261" /></a><p
class="wp-caption-text">Ultrasurf</p></div><h2>Tor</h2><p>Tor project is one of the widely proxy softwares. Tor supports Windows, Linux, MacOS. The best thing is you can use Tor to bypass restrictions in your smartphones too. The bad thing is the speed. Tor is the slowest of all three applications listed here. Torrent downloads are possible using Tor, if readers insist we would also like to write a tutorial for that.</p><p>Restrictions are made to maintain some order in the workspace, but breaking them for a good purpose is never wrong. I hope that these applications will solve your network restrictions problem. In our next tutorial we will introduce how to bypass file size limit restrictions made using Squid and other firewall services.</p><div
id="attachment_7037" class="wp-caption aligncenter" style="width: 208px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/08/Tor.png"><img
class="size-full wp-image-7037" title="Tor" src="http://www.bytechip.com/wp-content/uploads/2011/08/Tor.png" alt="Tor Best three softwares to bypass proxy" width="198" height="111" /></a><p
class="wp-caption-text">Tor</p></div> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/08/best-three-softwares-ways-to-bypass-proxy/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Magnifier &#8211; Screen Zoom for Ubuntu</title><link>http://www.bytechip.com/2011/05/linux-ubuntu-magnifier-shortcut/</link> <comments>http://www.bytechip.com/2011/05/linux-ubuntu-magnifier-shortcut/#comments</comments> <pubDate>Fri, 27 May 2011 07:13:44 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[magnifier]]></category> <category><![CDATA[tutorial]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[zoom]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=6803</guid> <description><![CDATA[This tutorial is on how to zoom the screen in Ubuntu using GNOME or KDE... <a
class="meta-more" href="http://www.bytechip.com/2011/05/linux-ubuntu-magnifier-shortcut/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>This tutorial is on how to zoom the screen in Ubuntu using GNOME or KDE Magnify feature. Windows users may be aware of the Magnifier inbuilt application, where in a user can simply select a Zoom Level(%) and magnify his screen. Since Linux is no inferior to Windows, there is a similar feature for zooming screen in Linux.</p><p>&nbsp;</p><h2>Magnify Screen using Shortcut</h2><p>The shortcut for magnifying the Screen is</p><p><strong>Zoom Up</strong> &#8211; Windows Key + Scroll Up</p><p><strong>Zoom Down &#8211; </strong>Windows Key + Scroll Down</p><p>The Level of Zoom depends on the amount of the scroll. To my amazement the tool can zoom to a much greater level than expected.</p> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/05/linux-ubuntu-magnifier-shortcut/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Simple Interface to Persist and Retrieve objects in Java Hibernate</title><link>http://www.bytechip.com/2011/05/java-hibernate-simple-interface-download/</link> <comments>http://www.bytechip.com/2011/05/java-hibernate-simple-interface-download/#comments</comments> <pubDate>Tue, 10 May 2011 18:27:37 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[database]]></category> <category><![CDATA[download]]></category> <category><![CDATA[hibernate]]></category> <category><![CDATA[interface]]></category> <category><![CDATA[java]]></category> <category><![CDATA[jdk]]></category> <category><![CDATA[persist]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[retrieve]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=6719</guid> <description><![CDATA[Hibernate is no doubt one of the famous Object Oriented Domain Model in Java. I... <a
class="meta-more" href="http://www.bytechip.com/2011/05/java-hibernate-simple-interface-download/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>Hibernate is no doubt one of the famous Object Oriented Domain Model in Java. I created a simpler interface for persisting and retrieving list of objects in Hibernate.</p><h2>Persisting an Object</h2><p>A custom function has been created to persist a single object using Hibernate. The arguments are the <strong>Class name</strong> and the object to be persisted. The function at present takes a single object, however you can tweak to persist a collection of objects. My project demanded me to mostly persist a single object, so I have designed it this way. While persisting an object <strong>SaveOrUpdate</strong> method is used. Therefore if an entry already exists it overwrites it else creates a new entry.</p><h2>Retrieving an Collection of Object</h2><p>Another function getObjects is used to get the collection of objects in a <strong>List</strong> (java.util.List). The arguments are the <strong>class name</strong> and the query. In both the functions a new SessionFactory has been created to avoid runtime errors.</p><h2>Simple Interface for Hibernate Operations in Java</h2><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;">conFIGURATION</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.hibernate.Session</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.hibernate.SessionFactory</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.hibernate.cfg.Configuration</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> Hibernate <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> persist<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> className,<span style="color: #003399;">Object</span> obj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
&nbsp;
Configuration config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Configuration<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
config.<span style="color: #006633;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span>className<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
config.<span style="color: #006633;">configure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
SessionFactory factory <span style="color: #339933;">=</span> config.<span style="color: #006633;">buildSessionFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Session new_session <span style="color: #339933;">=</span> factory.<span style="color: #006633;">openSession</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">beginTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">saveOrUpdate</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">getTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">commit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<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;Error in Persisting&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>ex.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
ex.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">List</span> getObjects<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> className,<span style="color: #003399;">String</span> query<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #003399;">List</span> list <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
&nbsp;
Configuration config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Configuration<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
config.<span style="color: #006633;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span>className<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
config.<span style="color: #006633;">configure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
SessionFactory factory <span style="color: #339933;">=</span> config.<span style="color: #006633;">buildSessionFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Session new_session <span style="color: #339933;">=</span> factory.<span style="color: #006633;">openSession</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">beginTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
list <span style="color: #339933;">=</span> new_session.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span>query<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">list</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">getTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">commit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
new_session.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<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;Error in retrieving&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>ex.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
ex.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">return</span> list<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/05/java-hibernate-simple-interface-download/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Simpler Interface for Database Operations in Java</title><link>http://www.bytechip.com/2011/03/simpler-interface-for-database-operations-in-java/</link> <comments>http://www.bytechip.com/2011/03/simpler-interface-for-database-operations-in-java/#comments</comments> <pubDate>Wed, 16 Mar 2011 03:51:45 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[codes]]></category> <category><![CDATA[database]]></category> <category><![CDATA[java]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[program]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=6461</guid> <description><![CDATA[Database operations in Java are sometimes cumbersome to the programmers. Also the existing methods in... <a
class="meta-more" href="http://www.bytechip.com/2011/03/simpler-interface-for-database-operations-in-java/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>Database operations in Java are sometimes cumbersome to the programmers. Also the existing methods in the Database classes are not that impressive or flexible. To reduce redundancy in the code and have a better programming design, I usually use a separate class for Database that fits all my needs and makes your other codes look clean. This class will basically have the following features.</p><ol><li>Constructor to give the DB details such as Database Drive Name, Database URl, Database Name, Username and Password.</li><li>Execute Method to perform executeQuery().</li><li>Updatea Method to perform executeUpdate().</li><li>Method to close the Database connection.</li></ol><h2>Simple Database Connector Interface for Java</h2><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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
</pre></td><td
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Database_connector
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> Database_connector<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_driver, <span style="color: #003399;">String</span> db_url,
			<span style="color: #003399;">String</span> db_dbName, <span style="color: #003399;">String</span> db_user, <span style="color: #003399;">String</span> db_pwd<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_driver</span> <span style="color: #339933;">=</span> db_driver<span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_url</span> <span style="color: #339933;">=</span> db_url<span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_dbName</span> <span style="color: #339933;">=</span> db_dbName<span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_user</span> <span style="color: #339933;">=</span> db_user<span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_pwd</span> <span style="color: #339933;">=</span> db_pwd<span style="color: #339933;">;</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>
			<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;Error in constructor of Database Connector&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>
&nbsp;
	<span style="color: #003399;">String</span> db_driver<span style="color: #339933;">;</span>
	<span style="color: #003399;">String</span> db_url<span style="color: #339933;">;</span>
	<span style="color: #003399;">String</span> db_dbName<span style="color: #339933;">;</span>
	<span style="color: #003399;">String</span> db_user<span style="color: #339933;">;</span>
	<span style="color: #003399;">String</span> db_pwd<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* Start of Getters &amp;amp; Setters Method */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getDb_driver<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> db_driver<span style="color: #339933;">;</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> setDb_driver<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_driver<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_driver</span> <span style="color: #339933;">=</span> db_driver<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getDb_url<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> db_url<span style="color: #339933;">;</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> setDb_url<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_url</span> <span style="color: #339933;">=</span> db_url<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getDb_dbName<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> db_dbName<span style="color: #339933;">;</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> setDb_dbName<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_dbName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_dbName</span> <span style="color: #339933;">=</span> db_dbName<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getDb_user<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> db_user<span style="color: #339933;">;</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> setDb_user<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_user<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_user</span> <span style="color: #339933;">=</span> db_user<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getDb_pwd<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> db_pwd<span style="color: #339933;">;</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> setDb_pwd<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> db_pwd<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">db_pwd</span> <span style="color: #339933;">=</span> db_pwd<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/* End of Getters &amp;amp; Setters Method */</span>
&nbsp;
	<span style="color: #003399;">Connection</span> con <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Start of Close Method */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> close<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;">try</span><span style="color: #009900;">&#123;</span>
			con.<span style="color: #006633;">close</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: #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>
			<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;Error in closing database&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>
<span style="color: #666666; font-style: italic;">/* End of Close Method */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Start of Execute Method */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">ResultSet</span> execute<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> query<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span><span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">ResultSet</span> rs<span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">Statement</span> stat <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</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>db_driver<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			con<span style="color: #339933;">=</span><span style="color: #003399;">DriverManager</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>db_url<span style="color: #339933;">+</span>db_dbName,db_user,db_pwd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			stat<span style="color: #339933;">=</span>con.<span style="color: #006633;">createStatement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			rs<span style="color: #339933;">=</span>stat.<span style="color: #006633;">executeQuery</span><span style="color: #009900;">&#40;</span>query<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</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: #000000; font-weight: bold;">return</span> rs<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/* End of Execute Method */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Start of Update Method */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> update<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> query<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span><span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">Statement</span> stat <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</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>db_driver<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			con<span style="color: #339933;">=</span><span style="color: #003399;">DriverManager</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>db_url<span style="color: #339933;">+</span>db_dbName,db_user,db_pwd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			stat<span style="color: #339933;">=</span>con.<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: #000000; font-weight: bold;">return</span><span style="color: #009900;">&#40;</span>stat.<span style="color: #006633;">executeUpdate</span><span style="color: #009900;">&#40;</span>query<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: #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>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</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: #000000; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/* End of Update Method */</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><h2>Usage of Database_connector</h2><p>The usage of this class is relatively much simpler. The below code illustrates the usage of this class to connect to a Database and perform the three methods.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Database_connector class with constructor(driver_name,db path,db url,username, password) */</span>
Database_connector db <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Database_connector<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.mysql.jdbc.Driver&quot;</span>, <span style="color: #0000ff;">&quot;jdbc:mysql://localhost:3306/&quot;</span>, <span style="color: #0000ff;">&quot;myDatabase&quot;</span>, <span style="color: #0000ff;">&quot;root&quot;</span>, <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Execute method - Argument is the statement*/</span>
<span style="color: #003399;">ResultSet</span> student_resultSet<span style="color: #339933;">=</span>db.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;select * from student where department=&quot;</span>computer<span style="color: #0000ff;">&quot;);
/* Do things like printing or other actions from the ResultSet */
&nbsp;
/* Update method */
int result =  db.update(&quot;</span>update student set status<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;dismissed&quot;</span> where id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;56&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Close Db */</span>
db.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h2>Note</h2><ol><li>Always call the constructor when a object of Database_connector is created.</li><li>The ResultSet returned could be null if no record found, so in your actions part, check for this condition before calling the next() function.</li><li>Update will return -1 if it failed or other integers corresponding to the original executeUpdate() method.</li><li>Best practice is to call the close() method once the work is over.</li></ol> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/03/simpler-interface-for-database-operations-in-java/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>How to Preview all tabs of Firefox in Taskbar</title><link>http://www.bytechip.com/2011/01/how-to-preview-all-tabs-of-firefox-in-taskbar/</link> <comments>http://www.bytechip.com/2011/01/how-to-preview-all-tabs-of-firefox-in-taskbar/#comments</comments> <pubDate>Fri, 14 Jan 2011 08:49:29 +0000</pubDate> <dc:creator>Ramkumar</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[browser]]></category> <category><![CDATA[browsers]]></category> <category><![CDATA[configuration]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[Internet]]></category> <category><![CDATA[preview]]></category> <category><![CDATA[tabs]]></category> <category><![CDATA[thumbnail]]></category> <category><![CDATA[trick]]></category> <category><![CDATA[tutorial]]></category> <guid
isPermaLink="false">http://www.bytechip.com/?p=6237</guid> <description><![CDATA[By default Firefox only displays the thumbnail preview of the currently open tab in taskbar,... <a
class="meta-more" href="http://www.bytechip.com/2011/01/how-to-preview-all-tabs-of-firefox-in-taskbar/">more <span
class="meta-nav">&#187;</span></a>]]></description> <content:encoded><![CDATA[<p>By default Firefox only displays the thumbnail preview of the currently open tab in taskbar, with a little trick you can make firefox to display the thumbnail preview of all the tabs that are open in all the windows of Firefox. This comes in handy when you are a regular surfer.</p><h2>How to enable Preview Thumbnail of all tabs in Firefox</h2><ul><li>Type <strong>about:config</strong> in Firefox URL tab, this is the configuration page of Firefox browser.<p><div
id="attachment_6208" class="wp-caption aligncenter" style="width: 356px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/01/firefox_setting.png"><img
class="size-full wp-image-6208" title="firefox_setting" src="http://www.bytechip.com/wp-content/uploads/2011/01/firefox_setting.png" alt="firefox setting How to Preview all tabs of Firefox in Taskbar" width="346" height="104" /></a><p
class="wp-caption-text">Firefox Configuration</p></div></li><li>Initially you will be displayed a warning message, Click on <strong>I&#8217;ll be careful, I Promise</strong> button to open the configuration page.<p><div
id="attachment_6209" class="wp-caption aligncenter" style="width: 510px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/01/firefox_warning.png"><img
class="size-full wp-image-6209" title="firefox_warning" src="http://www.bytechip.com/wp-content/uploads/2011/01/firefox_warning.png" alt="firefox warning How to Preview all tabs of Firefox in Taskbar" width="500" height="128" /></a><p
class="wp-caption-text">Firefox Warning</p></div></li><li>In the filter box, enter the word <strong>preview</strong>. This will shortlist all the configuration based on the keyword.</li><li>Double Click on the setting <strong>browser.taskbar.previews.enable</strong> to set it to true.<p><div
id="attachment_6242" class="wp-caption aligncenter" style="width: 461px"><a
href="http://www.bytechip.com/wp-content/uploads/2011/01/firefox_thumbnail.png"><img
class="size-full wp-image-6242" title="firefox_thumbnail" src="http://www.bytechip.com/wp-content/uploads/2011/01/firefox_thumbnail.png" alt="firefox thumbnail How to Preview all tabs of Firefox in Taskbar" width="451" height="290" /></a><p
class="wp-caption-text">Firefox Thumbnail Previewq</p></div></li><li>No Restart is required. You can simply mouse hover on the Firefox button in taskbar and it will display the thumbnail of all the tabs open in Firefox.</li></ul> ]]></content:encoded> <wfw:commentRss>http://www.bytechip.com/2011/01/how-to-preview-all-tabs-of-firefox-in-taskbar/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
