<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Binary Spectrum Geeks at work</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/" />
    <link rel="self" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork/atom.xml" />
   <id>tag:binaryspectrum.com,2010:/geeksatwork/1</id>
    <link rel="service.post" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1" title="Binary Spectrum Geeks at work" />
    <updated>2010-02-19T07:13:25Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.2ysb5-20051201</generator>
 
<entry>
    <title>Stored Procedures using Input Parameters</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2010/02/stored_procedures_using_input.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=53" title="Stored Procedures using Input Parameters" />
    <id>tag:binaryspectrum.com,2010:/geeksatwork//1.53</id>
    
    <published>2010-02-18T11:38:07Z</published>
    <updated>2010-02-19T07:13:25Z</updated>
    
    <summary><![CDATA[&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tauseef.M&nbsp;Well guys, in my previous articles I have given a preliminary description about the Stored Procedure and also had given a word that I will be dealing with it in more detail in my upcoming articles. As the saying...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p align="left" class="MsoNormal">&nbsp;<span><span><span><span>-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>Tauseef.M<br /></span></span></span><span><span>&nbsp;</span></span></p><span><span><p><br /><span><span>Well guys, in my previous articles I have given a preliminary description about the Stored Procedure and also had given a word that I will be dealing with it in more detail in my upcoming articles. As the saying goes &ldquo;Once a word has been allowed to escape, it cannot be recalled&rdquo;, and so I am back here with advanced stored procedure concepts.</span></span></p></span><span><span><span><p><br /><span><span><span><span><strong><span>Insertion using Stored Procedure&rsquo;s Input Parameters<br /></span></strong><span>&nbsp;</span></span></span></span></span></p></span><span><span><span><span>Let&rsquo;s get on by creating a table name <strong>tblEmployee</strong> with the following fields as below:</span><span><br /></span>&nbsp;<span> </span><span /></span></span><span><span><span><span><p>&nbsp;<img width="339" height="134" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T1.JPG" border="0" /></p><p><span><span>&nbsp;</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Fig (a)</span></p></span><span><span>Now let&rsquo;s create a Stored Procedure for insertion. Open a new <strong>Query window</strong> and type the below stored procedure.<br /></span></span><span><span><p>&nbsp;<img width="401" height="150" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T2.JPG" border="0" /></p></span><span><p><br /><span>Stored procedure named <strong>usp_insert</strong> gets created into database.<br /><span><strong>&nbsp;</strong></span></span></p></span><span><span><strong>Execute Stored Procedure??<br /></strong></span><span>Yeah!! The below syntax is used for executing the above created stored procedure.<span>&nbsp; </span></span></span><span><p class="MsoNormal"><span><span><strong><img width="300" height="84" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T3.JPG" border="0" /></strong></span></span></p><span><span><span><span><span><span>Here <strong>EmpId Column</strong> inside the table is a primary key with identity being set to [1].</span></span></span></span></span></span><span><span><span><span><span><span> <p><br /><span><span><span><strong>Updating table - Stored Procedure using Input Parameters</strong></span></span></span></p></span><span><span><span><p><br />Let&rsquo;s have a glance over the fig (a) above. Now we are going to use the same table for creating the stored procedure for updating the table.</p><p><br /><span>Portray the same as below in a new <strong>Query Window.<br /></strong></span></p></span><span><span><p class="MsoNormal"><span><strong><img width="541" height="109" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T4.JPG" border="0" /></strong></span></p><p><span><strong>Stored procedure named usp_Update gets created into database.</strong></span></p><p><span><strong>Execute Stored Procedure??<br /></strong></span><span>Before executing let us see the records inside the table tblEmployee.</span></p><p><span><br /></span><strong><img width="213" height="23" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T5.JPG" border="0" /></strong><span><span><span /></span></span></p><span><span><span><p><strong><img width="239" height="149" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T6.JPG" border="0" />&nbsp;</strong></p></span><p class="MsoNormal"><span><strong>&nbsp;<img width="293" height="20" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T7.JPG" border="0" /></strong></span></p><p class="MsoNormal"><span><strong>&nbsp;<img width="439" height="106" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T8.JPG" border="0" /></strong></span></p><span><span><span><span><p><span><span><span><strong>Deleting Records - Stored Procedure using Input Parameters<br /></strong></span></span></span></p><span><span><span>The last step in any CRUD operation is deleting the records in the table.<br /></span><span>Let&rsquo;s create a stored procedure named usp_Delete<br /></span><span><span><span><span><span><span><span><span><p class="MsoNormal"><span><strong>&nbsp;<img width="354" height="68" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T9.JPG" border="0" /></strong></span></p><span><span><span><span><span><strong>Execute Stored Procedure??</strong></span><span><br /></span><strong>&nbsp;</strong><span><span><br /></span><span><span><br /></span><span><strong><img width="257" height="290" title="Stored Procedures" alt="Stored Procedures" src="http://www.binaryspectrum.com/images/T10.JPG" border="0" /></strong></span><span><br /></span><span><span><span><span><span><span><span><span><p><span>Stored Procedure using Output variables will be explained in my upcoming articles!!</span></p></span><span><br /></span><span><span><span><strong>(The author, Tauseef.M, is a Software Engineer at Binary Spectrum).<br /></strong></span></span></span><span><span><span><p>&nbsp;</p><p>&nbsp;</p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Using SMO for Dynamically Creating Stored Procedure and Database Tables in c#.net</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/09/using_smo_for_dynamically_crea.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=52" title="Using SMO for Dynamically Creating Stored Procedure and Database Tables in c#.net" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.52</id>
    
    <published>2009-09-08T07:15:02Z</published>
    <updated>2009-09-08T07:24:11Z</updated>
    
    <summary><![CDATA[-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tauseef.M &nbsp;According to me &ldquo;Giving a deadly desired storm to your brain yields in an &lsquo;invention &lsquo;.&nbsp;What is SMO??Server Management Object (SMO) is Microsoft&reg; .NET Framework library of objects that let you manage one or more database servers. SMO...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<span><span /><span><p class="MsoListParagraph"><span><span>-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Tauseef.M </p><p class="MsoListParagraph">&nbsp;</p><p><span>According to me &ldquo;Giving a deadly desired storm to your brain yields in an &lsquo;invention &lsquo;.&nbsp;</span></p><span><p align="justify"><br /><strong><span>What is SMO??</span></strong></p></span><p align="justify"><span>Server Management Object (SMO) <strong>is Microsoft</strong><span class="superscript">&reg;</span> .NET Framework library of objects that let you manage one or more database servers. <strong>SMO</strong> can be used to examine a database&rsquo;s objects and to perform a variety of administrative tasks like backing up and restoring databases, and issuing Data Definition Language (DDL) commands. Using SQL SMO you can also connect to SQL Server, iterate through a collection of database objects and perform a variety of tasks against them.<br /></span><span><span>Let me demonstrate the use of SMO for dynamically creating of Stored Procedures and Database Tables.</span></span></p><span><span /><span><span><span>For start up, let us first reference the appropriate assemblies that use <strong>SMO</strong>.</span></span></span></span><span><span><span><span> <p align="justify"><br /><span>The two main DLLs you must reference are:</span></p></span><span><ul><li><div align="justify"><span>Microsoft.SqlServer.Smo.dll </span></div></li><li><div align="justify"><span><span>Microsoft.SqlServer.ConnectionInfo.dll</span></span></div></li></ul><p align="justify"><span><span>You will also need the following assembly for creating indexes for primary key:<br /></span><span>Microsoft.SqlServer.SqlEnum.dll <br /></span></span></p></span><span><span><span><p align="justify" class="MsoNormal"><span>After adding the above assemblies let&rsquo;s begin Dynamic Creation of Stored Procedure and Database Tables.</span></p><span><span><span><strong>Dynamically Creating Database Tables <br /></strong></span></span></span><span><span><span><p align="justify" class="MsoNormal"><span>Below is a simple Code that creates the database table known as tblEmployee in my personal database Employee with a primary key and identity on the ID column.<span>&nbsp;&nbsp;&nbsp;</span></span></p><p align="justify" class="MsoNormal"><span><span><span><span><strong><img src="http://www.binaryspectrum.com/images/binary-1.gif" border="0" /></strong></span></span></span></span></p><span><span><span><span><span><span><span><span><span><span><span><span>&nbsp;</span><span>//Establish Conection <br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>SqlConnection</span> conn = <span>new</span> <span>SqlConnection<br /></span></span><span>(<span>&quot;Server=&lt;servername&gt;;DATABASE=&lt;databasename&gt;;uid=&lt;userid&gt;;pwd=&lt;pwd&gt;&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create Server instance<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Server</span> server = <span>new</span> <span>Server</span>(<span>new</span> <span>ServerConnection</span>(conn));<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create Database Instance from existing databases<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Database</span> database = server.Databases[<span>&quot;Employee&quot;</span>];<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create Table<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Microsoft.SqlServer.Management.Smo.<span>Table</span> table = <span>new</span> <br /></span><span><span>&nbsp;&nbsp;&nbsp; </span>Microsoft.SqlServer.Management.Smo.<span>Table</span>(database, <span>&quot;tblEmployee&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create Column &quot;ID&quot; as Primary key<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Column</span> IDcolumn = <span>new</span> <span>Column</span>(table, <span>&quot;ID&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>IDcolumn.DataType = <span>DataType</span>.Int; <span>//Specify the datatype<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>IDcolumn.Nullable = <span>false</span>;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Allow Nulls=False<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>IDcolumn.Identity = <span>true</span>;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Set Identity=True<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>IDcolumn.IdentitySeed = 1;<span>&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>//Set Identity to start from 0<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>IDcolumn.IdentityIncrement = 1; <span>//Increment identity value by 1 <span>&nbsp; </span><span>&nbsp;&nbsp;</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create Column &quot;Title&quot; <br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Column</span> TitleColumn = <span>new</span> <span>Column</span>(table, <span>&quot;Title&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>TitleColumn.DataType = <span>DataType</span>.VarChar(50);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>TitleColumn.Nullable=<span>true</span>;<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Add Columns to the &quot;table&quot;<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>table.Columns.Add(IDcolumn);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>table.Columns.Add(TitleColumn);<br /></span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create index<span>&nbsp; </span>for primary key column &quot;ID&quot;<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Index</span> prIndex = <span>new</span> <span>Index</span>(table, <span>&quot;PK_ID&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//specify as primary key<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>prIndex.IndexKeyType = <span>IndexKeyType</span>.DriPrimaryKey;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Assign the column &quot;ID&quot; to the created Index<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>prIndex.IndexedColumns.Add(<span>new</span> <span>IndexedColumn</span>(prIndex,<span>&quot;ID&quot;</span>));<br /></span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Add the new Index to the table<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>table.Indexes.Add(prIndex);<br /></span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//PHYSICALLY create the table in the database<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>table.Create();<br /></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><p class="MsoNormal"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Response.Write(<span>&quot;Table Created Sucessfully...&quot;</span>);</span></p><span><span><p><br /><span><strong>Dynamically Creating Stored<span>&nbsp; </span>Procedures <br /></strong>Below is a simple Code that creates the Stored Procedure known as &ldquo;</span><span>dsp_created</span><span> &ldquo;in my personal database Employee with @cityid being the input variable.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp; </strong></span><br /></span></p></span><p class="MsoNormal"><strong><img src="http://www.binaryspectrum.com/images/binary-2.gif" border="0" /></strong></p><p class="MsoNormal">&nbsp;</p><span>//Establish Conection <br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>SqlConnection</span> conn = <span>new</span> <span>SqlConnection<br /></span></span><span>(<span>&quot;Server=&lt;servername&gt;;DATABASE=&lt;databasename&gt;;uid=&lt;userid&gt;;pwd=&lt;pwd&gt;&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create Server instance<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Server</span><span> server = <span>new</span> <span>Server</span>(<span>new</span> <span>ServerConnection</span>(db));<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Select the database where stored procedure needs to be added<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>Database</span> dsb = server.Databases[<span>&quot;Employee&quot;</span>];</span><span> <p><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Create a Stored Procedure named &quot;dsp_created&quot; in &quot;Employee&quot; <br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>StoredProcedure</span> sp = <span>new</span> <span>StoredProcedure</span>(dsb, <span>&quot;dsp_created&quot;</span>);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sp.TextMode = <span>false</span>;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //set TextMode as false<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sp.AnsiNullsStatus = <span>false</span>; <span>//set AnsiNullsStatus as false<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sp.QuotedIdentifierStatus = <span>false</span>;</span></p></span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//Add an input parameter &quot;@cityid&quot; to the Stored Procedure<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp; </span>StoredProcedureParameter</span><span> idparam = <span>new <span>&nbsp;&nbsp;</span><br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>StoredProcedureParameter</span><span>(sp, <span>&quot;@cityid&quot;</span>, <span>DataType</span>.Int);<span><br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sp.Parameters.Add(idparam);<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//The Sql Statement<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sp.TextBody = <span>&quot;Select *from tblCity where Citycode= @cityid&quot;</span>;<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>//PHYSICALLY create Stored Procedure<br /></span></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sp.Create();</span></span><span> <p class="MsoNormal"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Response.Write(<span>&quot;Stored Procedure Created Sucessfully....&quot;</span>);</span> </p><span><span><strong>Dynamically deletion of stored procedure is also very simple, which will be explained later.</strong>&nbsp;&nbsp;&nbsp;&nbsp; </span><p class="MsoNormal">(The author, Tauseef.M, is a Software Engineer at Binary Spectrum.)</p><p class="MsoNormal">&nbsp;</p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Create an Ongoing task in MS Project</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/08/create_an_ongoing_task_in_ms_project_.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=51" title="Create an Ongoing task in MS Project" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.51</id>
    
    <published>2009-08-03T08:52:48Z</published>
    <updated>2009-08-03T09:30:18Z</updated>
    
    <summary><![CDATA[- Jayanth Raj&nbsp;We can create an ongoing task in MS Project by creating a &ldquo;Hammock Task&rdquo;. Hammock task duration changes automatically when the project finish date is changed. Steps for creating a Hammock Task: 1.&nbsp;&nbsp;&nbsp;&nbsp; Click on Project start date...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p>- Jayanth Raj</p><p>&nbsp;</p><p><span>We can create an ongoing task in MS Project by creating a &ldquo;Hammock Task&rdquo;. Hammock task duration changes automatically when the project finish date is changed. </span></p><p><span><br /></span><strong><span>Steps for creating a Hammock Task</span></strong><span>: <br /></span><span><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>Click on Project start date cell, the start date cell will be highlighted. <br /></span><span><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>On the edit menu, click copy (cell)<br /></span><span><span>3.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>Click on the &lsquo;ongoing task&rsquo; start date, the start date cell will be highlighted.<br /></span><span><span>4.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>On edit menu, click &lsquo;Paste Special&rsquo; and click &lsquo;Paste Link&rsquo;. <br /></span><span><span>5.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>Click on Project end date cell, the end date cell will be highlighted. <br /></span><span><span>6.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>On the edit menu, click copy (cell)<br /></span><span><span>7.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>Click on the &lsquo;ongoing task&rsquo; end date, the end date cell will be highlighted.<br /></span><span><span>8.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>On edit menu, click &lsquo;Paste Special&rsquo; and click &lsquo;Paste Link&rsquo;. </span></p><span><p><br /><span><span>For more details see the below link: <br /></span><span><a href="http://support.microsoft.com/kb/141733">http://support.microsoft.com/kb/141733</a> (How to build a Hammock Task). </span></span></p></span><span><span><br /></span><span><span>(The author, Jayanth Raj is a Software Engineer&nbsp;at Binary Spectrum).<br /></span></span></span><span><span><span><p>&nbsp;</p></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Excel to MYSQL: Here&apos;s another technique</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/06/excel_to_mysql_heres_another_t.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=50" title="Excel to MYSQL: Here's another technique" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.50</id>
    
    <published>2009-06-19T12:17:24Z</published>
    <updated>2009-06-19T12:26:19Z</updated>
    
    <summary><![CDATA[- Anjana. MI had to upload pin codes in excel to database. After procrastinating on net for considerable time, I decided to find a quick solution... :) Though I am aware of available excel api&rsquo;s, I dint want to spend...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p>- Anjana. M</p><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">I had to upload pin codes in excel to database. After procrastinating on net for considerable time, I decided to find a quick solution... :) Though I am aware of available excel api&rsquo;s, I dint want to spend time in reading api docs for breaking a thin twig. </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">This method can be followed if you want to export a single column from excel to a table. </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;</span></span></p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">Steps: </span></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><ol style="margin-top: 0in"><li class="MsoNormal" style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'">So i copied the pin code column&nbsp; from the excel and pasted on to a notepad </span></li><li class="MsoNormal" style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'">Save the file as ok.txt </span></li><li class="MsoNormal" style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'">then I wrote program that will read a the file line by line and a simple string operation </span></li><li class="MsoNormal" style="margin: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'">The program will generate a Sql script and will also execute the script and will insert the data into database. </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&quot;*********Sample output*********&quot; </span></p></span></li></ol><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">insert into tblpincode_zone(pincodes,zone)values(834001,9); </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">insert into tblpincode_zone(pincodes,zone)values(834002,9); </span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">*********************************** </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">package beans; </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">import java.io.*; </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">import java.sql.*; </span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">class FileRead </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">{&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp; public static void main(String args[]) </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp; {&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try{ </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connection con=null;&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Statement pst=null; </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String str=&quot;&quot;;&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Class.forName(&quot;com.mysql.jdbc.Driver&quot;); </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; con=DriverManager.getConnection(&quot;jdbc:mysql://192.169.70.45/application?user=root&amp;password=root&quot;);&nbsp;</span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; // Open the file that is the first </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; // command line parameter&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; FileInputStream fstream = new FileInputStream(&quot;D:/ok.txt&quot;); </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; // Get the object of DataInputStream&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; DataInputStream in = new DataInputStream(fstream); </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BufferedReader br = new BufferedReader(new InputStreamReader(in));&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; String strLine; </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; //Read File Line By Line&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; while ((strLine = br.readLine()) != null)&nbsp;&nbsp; { </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pst=con.createStatement();&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Print the content on the console </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println (&quot;insert into tblpincode_zone(pincodes,zone)values(&quot;+strLine+&quot;,9);&quot;);&nbsp;</span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp; str=&quot;insert into tblpincode_zone(pincodes,zone)values(&quot;+strLine+&quot;,9);&quot;;&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp; pst.executeUpdate(str); </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; }&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; //Close the input stream </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; in.close();&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; }catch (Exception e){//Catch exception if any </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println(&quot;Error: &quot; + e.getMessage());&nbsp;</span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp;&nbsp;&nbsp; } </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">&nbsp; } </span></p></span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'">} </span><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'" /><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><span style="font-size: 10pt; font-family: 'Calibri','sans-serif'"><p class="MsoNormal" style="margin: 0in 0in 0pt">&nbsp;</p><p class="MsoNormal" style="margin: 0in 0in 0pt">(The author, Anjana.M, is a Software Engineer at Binary Spectrum).</p><p class="MsoNormal" style="margin: 0in 0in 0pt">&nbsp;</p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Ruby on Rails: Convensions over Configurations</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/06/ruby_on_rails_convensions_over.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=49" title="Ruby on Rails: Convensions over Configurations" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.49</id>
    
    <published>2009-06-19T09:32:26Z</published>
    <updated>2009-06-19T11:02:20Z</updated>
    
    <summary><![CDATA[- Jagadish. MThe interest of developer will always be towards learning new technologies. It&rsquo;s secondary that whether in real-time you are going to use it in or not. One of the most popular and fastest growing technologies that I came...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p align="justify">- Jagadish. M</p><p align="justify">The interest of developer will always be towards learning new technologies. It&rsquo;s secondary that whether in real-time you are going to use it in or not. One of the most popular and fastest growing technologies that I came across is Ruby on Rails (RoR).</p><p align="justify">Ruby on Rails was developed by <strong>David Heinemeier Hansson</strong> from his work on <strong>BaseCamp</strong>; a project management tool, which offers to-do lists, wiki-style web-based text documents, milestone management, file sharing, time tracking, and a messaging system.</p><p align="justify">Like many web frameworks, Rails uses the Model View Controller (MVC) architecture to organize applications.</p><strong>Features of Ruby:<br /></strong><ul><li><strong>Each and Everything is Object:</strong> Even numbers in ruby are treated as object. Looking at the example, what output you can expect from this?</li></ul><blockquote><p align="left"><span>8.times {print &ldquo;Guess what&rdquo;} its </span><span>prints Guess what 8 times</span><span>.</span></p></blockquote><ul><li><span><span><strong>Powerful blocks:</strong></span><span> Code blocks can be passed as parameter to method. Following example prints out all the elements in an array</span> <p align="left"><span><span>jArray.each{|element| print element}</span></span></p></span></li><li><span><span><span><span><span><span><strong>Return is optional in Methods:</strong> In ruby return statement is optional in methods. The value </span></span></span><span><span><span>of&nbsp;the last expression becomes the return value of that method. For example:</span></span></span><span><span><span><span>&nbsp;</span></span></span></span></span></span><span> <p><span><span><span><span><span><span><span><span>def</span> <span>testReturn</span><span>&nbsp;</span></span><span><span><span>n = 2 * 3</span></span><span> </span></span></span></span></span><span><span><span><span><span><span><span><span>en</span></span></span></span></span></span></span></span></span></span></span></p><span><span><li><span><span><span><span><span><span><span><span><span><span><span><span><span><strong>Parallel Assignment in Ruby:</strong> We can change the multiple variables in one assignment statement. Swapping of two variables is the good example for it.<span>&nbsp;</span><span>&nbsp;</span> <span><span>n1 = 1</span></span><span> </span><span><p><span><span>n2 = 3</span></span></p><p><span><span><span><span><span>&nbsp;</span></span><span>n1, n2 = n2,n1</span></span></span></span></p></span></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><li><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><strong>Everything in Ruby is open: </strong>Including the built-in classes, in ruby, additional methods can be added to the classes even at run-time also. For example: FixNum is the build in Data Type for all to which I added the method called <strong>old</strong>.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></li></span></span></span></span><blockquote><p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>class Fixnum</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span> </span></p><p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>def old</span> </span><span><span><span><span><span>return self-1</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>end</span></span></span></span></span></span></span></span></span></span></span><span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span /></span></span><span><span><span><span><span><span><p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>end</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p><p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>8.old&nbsp;&nbsp;<span>#&nbsp;prints 7</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p><p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>(The author, Jagadish.M, is a Software Engineer&nbsp;at Binary Spectrum).</span></span></span></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span><span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p><p><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></blockquote></span></span></span></span></span></span></span></span></span></li></span></span></span></span></li></ul>]]>
        
    </content>
</entry>
<entry>
    <title>ATG: Enhancing ecommerce!</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/05/atg_enhancing_ecommerce.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=43" title="ATG: Enhancing ecommerce!" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.43</id>
    
    <published>2009-05-19T12:34:38Z</published>
    <updated>2009-05-19T12:35:55Z</updated>
    
    <summary>-Jagadish.M Recently, while I visited few sites, I was caught by this very interesting tale of ATG. I came across their dynamic capabilities and thought of sharing it and creating awareness to all.ATG Technologies:In the line of ecommerce, ATG is...</summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p align="justify"><span>-Jagadish.M </span></p><span /><span><p align="justify"><span>Recently, while I visited few sites, I was caught by this very interesting tale of ATG. I came across their dynamic capabilities and thought of sharing it and creating awareness to all.</span></p><span><span><p align="justify"><br /><strong><span>ATG Technologies:<br /></span></strong><span>In the line of ecommerce, ATG is the technology that is growing faster than any other technologies currently. <strong>ATG</strong> (Art Technology Group, Inc., NASDAQ: ARTG) develops software and delivers e-commerce and Web marketing solutions that many global brands utilize to empower their e-commerce Web sites. ATG's ecosystem of Complementary Software Providers extends the ATG Commerce suite with unique and innovative capabilities like dynamic imaging, ratings and reviews, and payment.</span></p></span><span><span><p align="justify"><br /><strong><span>ATG Commerce Suite:<br /></span></strong><span>ATG Commerce Suite provides a solid, stable, yet highly flexible and agile foundation for the highest volume e-commerce sites. With its<span>&nbsp; </span>dynamic customization and targeting capabilities , ATG lets you drive cross-channel sales and marketing from a single platform &mdash; even for multiple brands, and across multiple geographies.</span></p></span><span><span>ATG provides direct control over user-friendly website management tools to various marketers and merchandisers. You can choose your delivery model as licensed e-commerce software, or a fully hosted on demand solution.</span><span><br /></span>&nbsp; </span><span><p align="justify"><span>To learn more, you can visit <a href="http://www.atg.com/">http://www.atg.com</a> and discover the comprehensive feature list they provide.</span><span><br /></span>&nbsp; </p><p align="justify"><span>(The author, Jagadish, is a Software Engineer at Binary Spectrum)</span></p><span><p align="justify"><br />&nbsp;</p></span>&nbsp;</span></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Agile practices - Requirement to Implementation</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/04/agile_practices_requirement_to.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=42" title="Agile practices - Requirement to Implementation" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.42</id>
    
    <published>2009-04-17T07:27:42Z</published>
    <updated>2009-04-17T07:29:32Z</updated>
    
    <summary><![CDATA[ - Anjana.M&nbsp;&nbsp;We often see programmers jump to their seats and start coding as soon as they just hear any requirement. They may be able to complete the task, but may actually be lost in fixing the logical errors for...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[  <p class="MsoNormal" style="text-align: justify">- Anjana.M&nbsp;</p><p class="MsoNormal" style="text-align: justify">&nbsp;</p><p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">We often see programmers jump to their seats and start coding as soon as they just hear any requirement. They may be able to complete the task, but may actually be lost in fixing the logical errors for a long time.</span></p>    <p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">I have followed this approach that I am stating below, and yes, it worked well. I also believe that this is a stress free approach towards developing and implementing the requirement.</span></p>    <p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">This is just doing object modeling in a well planned way. This surely can be achieved with UML tools. But paper work at times does prove to be quicker. </span></p>    <p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Let me know your thoughts on it and looking forward to know your development approaches as well.</span></p>    <p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"><br /></span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; color: rgb(153, 51, 0)">Here are the 10 steps for a planned approach:</span></strong></p>    <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-1:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Get requirement</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-2:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Don&rsquo;t start development as soon as you get the requirement</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-3</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">: Lets follow the divide and rule approach - Divide the requirement into subtasks! We may have a list of subtasks</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-4:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Rule Them -Recognize the dependent task</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-5:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Create a class with requirement's name</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-6:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Make the subtasks as methods in the class</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-7:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Recognize the Inputs and Outputs for each method</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-8: </span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Build the DBQUERY</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-9</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">: Include the logic</span></p>  <p class="MsoNormal" style="text-align: justify"><strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;">Step-10:</span></strong><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;"> Unit test with SOP for each method in the class.</span></p>  <p class="MsoNormal" style="text-align: justify"><span>&nbsp;</span></p><p class="MsoNormal" style="text-align: justify">(The author, Anjana.M, is a Software Engineer at Binary Spectrum)&nbsp;</p><p class="MsoNormal" style="text-align: justify">&nbsp;</p>  ]]>
        
    </content>
</entry>
<entry>
    <title>STORED PROCEDURES FOR NOVICE (BEGINNERS) IN SQL SERVER 2005</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/04/stored_procedures_for_novice_b.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=41" title="STORED PROCEDURES FOR NOVICE (BEGINNERS) IN SQL SERVER 2005" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.41</id>
    
    <published>2009-04-13T05:18:28Z</published>
    <updated>2009-04-13T05:54:59Z</updated>
    
    <summary><![CDATA[-Tauseef. M&nbsp;As the saying goes, &ldquo;Necessity is the mother of invention. It is true, but its father is creativity, and knowledge is the midwife&quot;; Well guy's I am very happy to share my knowledge too regarding stored Procedures. For now,...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p>-Tauseef. M</p><p>&nbsp;</p><p align="justify">As the saying goes,<strong> </strong>&ldquo;Necessity is the mother of invention. It is true, but its father is creativity, and knowledge is the midwife&quot;; Well guy's I am very happy to share my knowledge too regarding stored Procedures. For now, I have decided to write a preliminary description on <strong>Stored Procedure</strong> in <strong>SQL Server 2005.</strong></p><p>&nbsp;</p><p align="justify"><strong>Starting with what are stored Procedures?<br /></strong></p><p align="justify">In simple terms &quot;<strong>Stored Procedures are a set of already written SQL statements that are saved in the database</strong>.&quot; If you are executing the same query over and over again, then it would make sense to simply put it into stored procedure.</p><p align="justify">Furthermore, with a stored procedure, you can store all the logic in the database, and use a simple command to call the stored procedure. Later, if you decide to migrate from ASP to java, J2EE, you only need to change the application layer as much of the business logic will remain in the database.</p><p align="justify">&nbsp;</p><p align="justify"><strong>Getting Started with Stored Procedures<br /></strong></p><p align="justify"><span>&nbsp; </span>Basic requirements to begin writing stored procedures:</p><p><span>&nbsp; </span>1. A database Management System (Ex: <strong>Sql Server 2005</strong>)</p><p><span>&nbsp; </span>2. A database built inside the database Management System.(Ex : <strong>Demo database</strong>)</p><p><span>&nbsp; </span>3. A Query Analyzer which is <strong>Built-in</strong> into Sql server 2005. You need not worry!!</p><p>&nbsp;</p><strong>Writing Your First Stored Procedure<br /></strong><p>So let's begin our countdown, creativity all that matters!! </p><p><span>&nbsp; </span>1. Open <strong>Sql Server 2005</strong></p><p><span>&nbsp; </span>2. Right click -&gt; <strong>Create Database</strong></p><p><span>&nbsp; </span>3. Enter new Database name (<strong>dsp_users</strong>)</p><span>&nbsp; </span>4. Now Expand <strong>dsp_users</strong>, right-click on tables and create a new table with table name as <span><span><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>dbo.emp_users </strong>with the column names as below:</p><ul><li><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>uname<span>&nbsp;&nbsp;&nbsp;&nbsp; </span>nvarchar(50)</li><li><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>upass<span>&nbsp;&nbsp;&nbsp;&nbsp; </span>nvarchar(50)</li><li><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>uaddress<span>&nbsp; </span>nvarchar(50)</li><li><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>uage<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>int</li><li><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>uid<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>int</li></ul><p>&nbsp;</p></span><p><span>&nbsp;</span>5 Now expand <strong>Programmability</strong> -&gt; Right click <strong>Stored Procedures</strong> and select <strong>New Stored Procedure</strong>.</p><p><span>&nbsp;</span>Now, here the top section is useful for comments about the stored procedure, a change log, and other pertinent information. While this is not required, it is just a good programming habit</p><p>============================================================</p><p>-- Author:<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Tauseef</p><p>-- Create date:<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>09/03/09</p><p>-- Description:<span>&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Stored procedure to display results</p><p>=========================================================</p><span><span><p>&nbsp;</p><p align="justify">Now just below this, you will create a store procedure. It starts with the keyword <strong>CREATE PROCEDURE </strong>written as follows:</p><strong>CREATE PROCEDURE usp_display<br /></strong><p>/*</p><p>We will put the variables in here, if there are any</p><p>*/</p><strong>AS<br /></strong><p>/*</p><p>This is where the actual SQL statements will be written as below</p><p>*/</p><strong>BEGIN<br /></strong><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-- SET NOCOUNT ON added to prevent extra result sets from</p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-- interfering with SELECT statements.</p><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>SET NOCOUNT ON</strong>;</p><p>&nbsp;</p><p><span>&nbsp;&nbsp;&nbsp; </span>-- Insert statements for procedure here</p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>SELECT *from emp_users<br /></strong><strong>END<br /></strong><p align="justify">Here now the stored procedure name is <strong>usp_display</strong>. usp defines &quot;<strong>User Stored Procedure</strong>&quot;. The above stored procedure displays all the records of the <strong>emp_users</strong> table. </p><p>&nbsp;</p><p align="justify">Now in the <strong>menu-tab</strong> up (Click <strong>Query</strong>-&gt; <strong>Execute</strong>) . Now it says &ldquo;Command<strong> completed succesfully</strong>&quot; . Thus you have created your first stored procedure.</p><p>&nbsp;</p><strong>How to execute the created stored procedure?<br /></strong><p align="justify">Its simple, just open a new query and type the following command <strong>exec <span>&nbsp;</span>usp_display </strong>and run it. The records of the table <strong>emp_users</strong> <strong><span>&nbsp;</span></strong>gets displayed.<strong><br /></strong></p><p>&nbsp;</p><p align="justify">More Sophisticated Stored Procedures using input and output variables will be explained later.</p><p>(The author Tauseef. M, is a Software Developer at Binary Spectrum)</p><p>&nbsp;</p></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Handle null values in MySQL Query</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/03/handle_null_values_in_mysql_query.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=40" title="Handle null values in MySQL Query" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.40</id>
    
    <published>2009-03-19T12:34:00Z</published>
    <updated>2009-06-08T08:52:49Z</updated>
    
    <summary><![CDATA[- Jagadish. MThe following examples facilitate in handling null values in MySQL query itself instead of handling them in jsp pages.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Syntax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select IFNULL (exp1,exp2) , IFNULL (exp1,exp2) from tableName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IFNULL return exp1 if it is not null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...]]></summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p><span><span>- Jagadish. M</span></span></p><p><span><span><br /></span><span><span><span>The following examples facilitate in handling null values in MySQL query</span><span> itself instead of handling them in jsp pages.</span><span><br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp; <br /></span><strong><span>Syntax:<br /></span></strong><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /></span><span>Select IFNULL (exp1,exp2) , IFNULL (exp1,exp2) from tableName<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IFNULL return exp1 if it is not null<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If exp1 is null then returns exp2<br /></span><span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span></span></span></span></span></span></p><span><span><span><span><span><span><span><span>&nbsp;<strong>Example<span> </span><span>1:</span></strong></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span /></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span> <div><img title="Table_1" height="42" alt="Table_1" src="http://binaryspectrum.com/images/t1.JPG" width="476" border="0" /></div><p><span><span><span><span><span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><strong><span>In Interface it looks like this:</span></strong></span></span></span></span></span></span><span><span><span><span><span><span><strong><span><span><span><span><span><span><span><span><span><span><span><span><span><span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></span></span></span></span></span></p></span></span></span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span /></span></span></span></span></span></span></span></span><span><span><span><span><span><span><span><span><span><span><span><div><div style="text-align: center"><img title="Interface_1" height="158" alt="Interface_1" src="http://binaryspectrum.com/images/j1.JPG" width="308" border="0" /></div></div><p>&nbsp;</p><p align="justify"><span>Select IFNULL(Name,&rsquo; <span>Not Available</span> &rsquo;),IFNULL(Address,<span>&rsquo;Not Available</span> &nbsp;&rsquo;),IFNULL(emailed,<span>&rsquo;Not Available&rsquo;</span>) from tableName<br /></span></p><span><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Result:</strong></span></p><span><span><p><span><strong><div><img title="Table_2" height="48" alt="Table_2" src="http://binaryspectrum.com/images/t2.JPG" width="479" border="0" /></div></strong></span></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><span><span><p><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>In Interface it looks like this:</strong></span></span></p></span><div><div style="text-align: center"><img title="Interface_2" height="158" alt="Interface_2" src="http://binaryspectrum.com/images/j2.JPG" width="308" border="0" /></div></div><p>&nbsp;</p><p><span><span>&nbsp;&nbsp;&nbsp; </span></span><strong><span>Example 2:</span></strong></p><strong><span><br /></span></strong><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span>Select IFNULL(Name,&rsquo;<span>&nbsp; </span>&rsquo;),IFNULL(Address,<span>&rsquo; </span>&nbsp;&rsquo;),IFNULL(emailed,<span>&rsquo;<span>&nbsp; </span>&rsquo;</span>) from tableName<br /></span></span><span><span><span><p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Result:</strong></span></p><span><span><span><span><p><span><span><span><span><span><span><span>&nbsp;<img title="Table_3" height="47" alt="Table_3" src="http://binaryspectrum.com/images/t3.JPG" width="483" border="0" /></span></span></span></span></span></span></span></p><span><span><span><span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>In Interface it looks like this:</strong></span> </span></span></span></span></span><span><span><span><span><p>&nbsp;</p><div style="text-align: center"><img title="Interface_3" height="158" alt="Interface_3" src="http://binaryspectrum.com/images/j3.JPG" width="308" border="0" /></div><p>&nbsp;</p><p align="left"><span><span><span>(The author, Jagadish.M, is a Software Engineer at Binary Spectrum).<br /></span></span></span></p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Google Protocol Buffer faster than XML</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/03/google_protocol_buffer_faster_than_xml.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=39" title="Google Protocol Buffer faster than XML" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.39</id>
    
    <published>2009-03-16T13:33:01Z</published>
    <updated>2009-03-16T13:49:36Z</updated>
    
    <summary>- Jagadish. MDo you think XML is the only fastest way for serializing the structured data? Then go ahead and read this. I am sure you will have a different opinion at the end of this discussion.In 2001 Google had...</summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p align="justify"><span>- Jagadish. M</span></p><p align="justify"><span>Do you think XML is the only fastest way for serializing the structured data? <br /></span><span>Then go ahead and read this. I am sure you will have a different opinion at the end of this discussion.</span></p><span><span><p align="justify"><br /><span>In 2001 Google had developed its own data format, called Protocol Buffers. Google&rsquo;s documentation says that, &ldquo;protocol buffers were initially developed at Google to deal with an<strong> index server request/response protocol</strong>&rdquo;<strong>.</strong></span></p></span><span><p align="justify"><br /><span>Google is using Protocol Buffers for its internal Remote Procedure Calls, or RPC, protocols and file formats.</span></p></span><span><p align="justify"><br /><span>Using Google protocol buffer you define how you want your data to be structured once, then you can use special generated source code to simply write and read your structured data to and from a variety of data streams and using a variety of languages.</span></p><p align="justify"><span><br /></span><span>Google protocol buffer is <strong>3 to 10 times smaller</strong> and <strong>20 to 100 times faster</strong> than XML for serializing structured data.</span></p></span><span><span><p align="justify"><br /><span>See the Google Developer Guide:<br /></span><span><a href="http://code.google.com/apis/protocolbuffers/docs/javatutorial.html">Protocol Buffer Basics: Java</a><br /></span></p></span></span><span><p align="justify">(The author, <span>&nbsp;</span>Jagadish. M, is a Software Engineer at Binary Spectrum)</p></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Fixing the Error: “ASN1 bad tag value met”!</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/03/fixing_the_error_asn1_bad_tag.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=38" title="Fixing the Error: “ASN1 bad tag value met”!" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.38</id>
    
    <published>2009-03-16T07:18:04Z</published>
    <updated>2009-03-16T08:54:12Z</updated>
    
    <summary>-Tauseef. M For some files in your system that are not digitally signed, an error message ASN1 bad tag value met would appear when you install any new software or any critical updates for Win XP. To fix this error,...</summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p>-Tauseef. M<br /></p><h1>  </h1>  <p><span>For some files in your system that are not digitally signed, an error message <strong>ASN1 bad tag value met</strong> would appear when you install any new software or any critical updates for Win XP. </span></p>  <p><span>To fix this error, you can follow the steps given below, after which you will be able to download correct critical updates for WinXP, etc and your problem will be solved!</span><span><span><span /></span></span></p><blockquote><ol><li><p><span><span><span>Basic step: Click START-&gt;RUN</span><span><span><span><span><span /></span></span></span></span></span></span></p></li><li><p><span><span><span>Type<strong> SIGVERIF <span /></strong></span><span><span><span><span><span /></span></span></span></span></span></span></p></li><li><p><span><span><span>Click <strong>ADVANCED</strong><strong><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; font-weight: normal"> </span></strong><strong><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;">-&gt;</span></strong> then inside the <strong>SEARCH </strong>tab</span><span><span><span><span><span /></span></span></span></span></span></span></p></li><li><p><span><span><span>Click on <strong>Look for other files<span /></strong></span><span><span><span><span><span /></span></span></span></span></span></span></p></li><li><p><span><span><span>Then Down check the check box (Include Subfolders). Click on browse button. Then under the Windows Folder -&gt; Select</span> <strong><span>SYSTEM32 -&gt;CatRoot<strong><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;">. </span></strong></span></strong><span><span>&nbsp;</span>Then click ok button. Then click again ok in the<strong> SEARCH</strong> tab. Then click <strong>START</strong> on File Signature Verification.</span><span><span><span><span><span /></span></span></span></span></span></span></p></li><li><p><span><span><span>After scanning you will get a list of files that have not been digitally signed. Now without closing this window, create a Folder name TEMP into your desktop.</span></span></span></p></li></ol></blockquote>  <div align="left">  </div><div align="left">  </div><div align="left">  </div><div align="left">  </div><div align="left">  </div>  <p><span style="line-height: 115%">NEXT FOLLOW THESE STEPS:</span><span><span><span /></span></span></p><blockquote><ol><li><p><span><span><span>Go to start-&gt; run and type <strong>C:\WINDOWS\SYSTEM32\CATROOT</strong></span></span></span><span><span><span /></span></span></p></li><li><p><span><span><span>Now search the list of files that are not digitally signed by comparing the files that you got in the previous step 6</span></span></span><span><span><span /></span></span></p></li><li><p><span><span><span>Now select those files from <strong>C:\WINDOWS\SYSTEM32\CATROOT</strong> and cut and paste into the TEMP folder created into your desktop</span></span></span><span><span><span /></span></span></p></li><li><p><span><span><span>THUS &ldquo;<strong>ASN1 bad tag value met </strong>&ldquo;error is fixed</span></span></span><span><span><span /></span></span></p></li><li><p><span><span><span>Now delete the TEMP folder from desktop.</span></span></span></p></li></ol></blockquote>            <p><span>&nbsp;</span></p>  <p><span>(The author, Tauseef. M, is a Software Engineer at Binary Spectrum.)</span></p>  <h1><span style="line-height: 115%" /></h1>  <h1><span style="line-height: 115%" /></h1>  <h1><span style="line-height: 115%" /></h1>  <h1><span style="line-height: 115%" /></h1>]]>
        
    </content>
</entry>
<entry>
    <title>Securing Password in MySQL</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/03/securing_password_in_mysql.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=36" title="Securing Password in MySQL" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.36</id>
    
    <published>2009-03-06T11:56:36Z</published>
    <updated>2009-03-06T13:35:17Z</updated>
    
    <summary>- Jagadish.MStoring plaint text password in the database is never a good idea. Fortunately MySQL provides you with some options to protect passwords.MySQL provide following built-in functions do that:1. SHA1: Secure Hash Algorithm version 1.02. SHA functions3. MD5: Message Digest...</summary>
    <author>
        <name>Ratika</name>
        <uri>www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<div align="justify">- Jagadish.M<br /></div><p align="justify">Storing plaint text password in the database is never a good idea. Fortunately MySQL provides you with some options to protect passwords.</p><div align="justify"><strong>MySQL provide following built-in functions do that:</strong><br /></div><p align="justify">1. SHA1: Secure Hash Algorithm version 1.0</p><p align="justify">2. SHA functions</p><p align="justify">3. MD5: Message Digest Algorithm 5</p><p align="justify">4. RFC 1321: The Message Digest Algorithm</p><p align="justify">5. AES: Advanced Encryption Standard</p><p align="justify">I will disscuss on AES over here,</p><p align="justify">To implement <strong>AES (Advanced Encryption Standard)</strong> encryption in your database, you will need to specify the password field as BLOB data type.</p><strong><span>Syntax:</span></strong><span><br /></span><pre>&nbsp; mysql&gt; INSERT INTO TableName(field1,field2) VALUES ('fieldValue1',AES_ENCRYPT('fieldValue2','my_keyword_to_encrypt') ); </pre><p>&nbsp;</p> <p align="justify"><strong>Note: -</strong> fieldValue2 is password to be stored</p><p align="justify">To create a new record, we have to call AES function and in addition to providing the password to be protected, we will also provide the keyword/String to encrypt.</p><strong>For example:<br /></strong><span>mysql&gt; INSERT INTO tbluser (useName, Password) VALUES ('Jagadish', AES_ENCRYPT ('Jagadish123','J007&rsquo;) );<br /></span><span><span>mysql&gt;select * from tbluser;</span><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</p></span>  <table cellspacing="0" cellpadding="0" border="0" align="left" style="border-collapse: collapse; margin-left: 6.75pt; margin-right: 6.75pt" class="MsoNormalTable">  <tbody><tr style="height: 12.75pt">   <td valign="top" style="border: 1pt solid black; padding: 0in 5.4pt; width: 121px; height: 12.75pt">   <p class="MsoNormal"><strong>userName&nbsp; </strong></p>   </td>   <td valign="top" style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 179px; height: 12.75pt">   <p class="MsoNormal"><strong>Password</strong></p>   </td>  </tr>  <tr style="height: 12.75pt">   <td valign="top" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 121px; height: 12.75pt">   <p class="MsoNormal">jagadish</p>   </td>   <td valign="top" style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 179px; height: 12.75pt">   <p class="MsoNormal">]M&Uacute;&curren;&icirc;&curren;h&Aacute;&Eacute;[*,&raquo;</p>   </td>  </tr> </tbody></table>  <p>&nbsp;</p><p><span><p>&nbsp;</p><span><span> </span></span></span></p><div align="justify"><span><span><span><p>&nbsp;</p><p>&nbsp;<br />Now to authenticate a user, we have to decrypt the password which is stored in the database and compare with the password entered by the user to login with the same keyword/String as we used before. Also we can encrypt the password entered by the user and then compare it with the password stored in the database. And also we have to provide the keyword/String used before.</p></span></span></span></div><p><span><span><span><strong>For example:<br /></strong><span>mysql&gt; select userName, AES_DECRYPT (password,'J007') from tbluser where userName = 'Testing'</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></p><p><span><br /></span></p><span><span><span><p>  </p></span></span></span><table cellspacing="0" cellpadding="0" border="0" align="left" style="border-collapse: collapse; margin-left: 6.75pt; margin-right: 6.75pt" class="MsoNormalTable">  <tbody><tr style="height: 12.6pt">   <td valign="top" style="border: 1pt solid black; padding: 0in 5.4pt; width: 115px; height: 12.6pt">   <p class="MsoNormal"><strong>userName&nbsp; </strong></p>   </td>   <td valign="top" style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 179px; height: 12.6pt">   <p class="MsoNormal"><strong>Password</strong></p>   </td>  </tr>  <tr style="height: 12.6pt">   <td valign="top" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 115px; height: 12.6pt">   <p class="MsoNormal">jagadish</p>   </td>   <td valign="top" style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 179px; height: 12.6pt">   <p class="MsoNormal">Jagadish123</p>   </td>  </tr> </tbody></table>&nbsp;  <span><span><span><p><br /></p><p>&nbsp;</p><p>&nbsp;</p><p>(The author Jagdish.M is a Software Engineer at <u>Binary Spectrum</u>.)</p></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>Simple way for Applications to read Excel Workbooks</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2009/03/simple_way_for_applications_to.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=35" title="Simple way for Applications to read Excel Workbooks" />
    <id>tag:binaryspectrum.com,2009:/geeksatwork//1.35</id>
    
    <published>2009-03-04T12:33:18Z</published>
    <updated>2009-03-04T13:28:49Z</updated>
    
    <summary><![CDATA[QUERY DATA FROM EXCEL FILE -Jayanth Raj&nbsp;If you want to retrieve or upload data from an Excel file having more than one sheet and large number of data elements, it is generally a complicated process to import such data elements...]]></summary>
    <author>
        <name>Ashok Kumar</name>
        <uri>http://www.binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p align="center"><strong><span>QUERY DATA FROM EXCEL FILE</span></strong></p><strong><span /></strong><span><strong> </strong><span><span><p><span><strong>-</strong>Jayanth Raj</span></p><p>&nbsp;<br /><span><span><span>If you want to retrieve or upload data from an Excel file having more than one sheet and large number of data elements, it is generally a complicated process to import such data elements into an oracle database.<br /><span>The following approach is one possible way of simplifying the process of reading data from an excel workbook with multiple sheets.<br /></span><span>&nbsp;</span><span><br /></span><span>We can retrieve data by writing a simple query like, </span><span><br /></span><span>&nbsp;</span><span><br /></span><span>SELECT [column1.name], [column2.name], [column3.name] FROM </span><span><br /></span><span>[Sheet1$] </span><span><br /></span><span>Or</span><span><br /></span><span>SELECT [column1.name], [column2.name], [column3.name] FROM </span><span><br /></span><span>[Sheet1$] &nbsp;WHERE [column1.name] = &lsquo;TestData&rsquo; </span><span><br /></span><span>&nbsp;&nbsp;</span><span><br />Here I have explained how we can achieve this using a simple java code</span><span>. </span><span><br /></span><span>&nbsp;</span><span><br /></span><span><span>1.<span>&nbsp;&nbsp; </span></span></span><span>Create a DSN for Excel file</span><span><br /></span><span>&nbsp;</span><span><br /></span><span><span><span> </span></span></span></span></span></span></p></span></span></span><ul><li><span><span><span><span>Add new DSN</span><span /></span></span></span></li><li><span><span><span><span><span><span><span /></span><span>Select Microsoft Excel Driver &ndash; Driver do Microsoft Excel [*.xls]</span><span /></span></span></span></span></span></li><li><span><span><span><span><span><span><span /></span><span>Provide a Data Source Name&nbsp; </span><span /></span></span></span></span></span></li><li><span><span><span><span><span><span><span /></span><span>Select Workbook &ndash; Specifying the Excel file path</span><span /></span></span></span></span></span></li></ul><span><span><span><p><span><span><span><span>&nbsp;</span><span><br /></span><span><span>2.<span>&nbsp;&nbsp; </span></span></span><span>Write a java class to retrieve the data from the Excel file</span><span><br /></span><span>&nbsp;</span><span><br /></span><span><span /></span></span></span></span></p></span></span></span><ul><li><span><span><span><span><span><span /></span><span>Load JDBC driver class &ndash; use Jdbc Odbc Driver, Eg.</span><span /></span></span></span></span></li></ul><span><span><span><p><span><span><span><span>&nbsp;</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Class.forName(&quot;sun.jdbc.odbc.JdbcOdbcDriver&quot;);</span><span><br /></span><span>&nbsp;</span><span><br /></span><span><span /></span></span></span></span></p></span></span></span><ul><li><span><span><span><span>Create a Connection using Excel DSN URL , Eg. </span><span /></span></span></span></li></ul><span><span><span><p><span><span><span><span>&nbsp;</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Connection conn = DriverManager.getConnection(&quot;jdbc:odbc:&lt;DSN name&gt;&rdquo;)</span><span><br /></span><span>&nbsp;</span><span><br /></span><span><span /></span></span></span></span></p></span></span></span><ul><li><span><span><span><span>Create a statement, Eg.&nbsp;&nbsp; </span><span /></span></span></span></li></ul><span><span><span><p><span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Statement stmt = con.createStatement(); </span><span><br /></span><span>&nbsp;</span><span><br /></span><span><span /></span></span></span></span></p></span></span></span><ul><li><span><span><span><span>Data is retrieved from the Excel sheet using a query mechanism &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span /></span></span></span></li></ul><span><span><span><p><span><span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Statement stmt = conn.createStatement();</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ResultSet rs = stmt.executeQuery( &quot;SELECT [column1.name], [column2.name], &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [column3.name] FROM [Sheet1$] WHERE [column1.name] =&nbsp; &lsquo;Test&rsquo; &quot; );</span><span><br /></span><span>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; try {</span><span><br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; while ( rs.next() ) { // Retrieve data <span>&nbsp;</span>}</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } finally { rs.close();</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><span><br /></span><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } finally { stmt.close();<br /></span><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp;&nbsp;&nbsp;<br /></span><span>&nbsp;&nbsp;</span><span><br /></span><span><span><span>(The author Jayanth Raj is a Software Engineer at Binary Spectrum).</span></span></span></span></span></span></p><p>&nbsp;</p></span></span></span>]]>
        
    </content>
</entry>
<entry>
    <title>An Introduction to Web 2.0</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2007/02/an_introduction_to_web_20.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=30" title="An Introduction to Web 2.0" />
    <id>tag:binaryspectrum.com,2007:/geeksatwork//1.30</id>
    
    <published>2007-02-09T20:50:57Z</published>
    <updated>2007-02-09T21:09:27Z</updated>
    
    <summary> In 2004 O&apos;Reilly Media coined a phrase Web 2.0 which refers to proposed second generation of web based services that include: Social networking sites: Social networks connect people with all different types of interests, and one area that is...</summary>
    <author>
        <name>Prakash</name>
        <uri>http://www.Binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[  <p class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">In 2004<strong> </strong></span><span style="font-size: 10pt; font-family: Verdana">O'Reilly Media coined a phrase <strong><span>Web 2.0 </span></strong><span>which refers to proposed second generation of web based services that include:</span></span><strong><em><span style="font-size: 10pt; font-family: Verdana"> <br /></span></em></strong></p>  <ol style="margin-top: 0in"><li style="text-align: justify" class="MsoNormal"><strong><span style="font-size: 10pt; font-family: Verdana">Social      networking sites:</span></strong><span style="font-size: 10pt; font-family: Verdana"> Social networks connect people      with all different types of interests, and one area that is expanding in      the use of these networks is the corporate environment. Businesses are      beginning to use social networks as a means to connecting employees      together and helping employees to build profiles</span><span class="MsoHyperlink"><span style="font-size: 10pt; font-family: Verdana; color: windowtext; text-decoration: none"> <br /></span></span></li></ol>    <ol style="margin-top: 0in"><li style="text-align: justify" class="MsoNormal"><span class="MsoHyperlink"><strong><span style="font-size: 10pt; font-family: Verdana; color: windowtext; text-decoration: none">Wikis:</span></strong></span><span class="MsoHyperlink"><span style="font-size: 10pt; font-family: Verdana; color: windowtext; text-decoration: none"> </span></span><span style="font-size: 10pt; font-family: Verdana">are websites that allows the visitors to easily add, remove, and edit      available content, typically without the need for registration. This ease      of interaction and operation makes the wiki an effective tool for mass      collaborative authoring.</span><strong><span style="font-size: 10pt; font-family: Verdana"> <br /></span></strong></li></ol>    <ol style="margin-top: 0in"><li style="text-align: justify" class="MsoNormal"><strong><span style="font-size: 10pt; font-family: Verdana">Communication:</span></strong><span style="font-size: 10pt; font-family: Verdana"> </span><span style="font-size: 10pt; font-family: Verdana">Web      communication protocols are a key element of the Web 2.0 infrastructure.      Two major ones are REST and SOAP.</span><span style="font-size: 10pt; font-family: Verdana"> <br /></span></li></ol>    <ol style="margin-top: 0in"><ol style="margin-top: 0in"><li style="margin-bottom: 2pt; text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">REST (Representational State Transfer) indicates a       way to access and manipulate data on a server using the HTTP verbs GET,       POST, PUT, and DELETE.</span></li><li style="margin-bottom: 3pt; text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">SOAP involves posting XML messages and requests to a       server that may contain quite complex, but pre-defined, instructions for       it to follow.</span></li></ol></ol>    <p style="margin-left: 0.5in; text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">In both cases, access to the service is defined by an API. Often this API is specific to the server, but standard Web service APIs are also widely used (for example, when posting to a blog). <br /></span></p>  <ol style="margin-top: 0in"><li style="text-align: justify" class="MsoNormal"><strong><span style="font-size: 10pt; font-family: Verdana">Folksonomies:</span></strong><span style="font-size: 10pt; font-family: Verdana"> Tags are      personalized labels for describing Web content &ndash; web pages, blog&rsquo;s, news      stories, photos, and the like. </span><span style="font-size: 10pt; font-family: Verdana">Collectively,      the set of tags adopted by a community to facilitate the sharing of content      is known as a folksonomy.</span><strong><em><span style="font-size: 10pt; font-family: Verdana"> <br /></span></em></strong></li></ol>      <p class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">Web 2.0 services share many <strong>attributes</strong>. But which create competitive advantage and prompt fast growth? By tracking the services that embrace Web 2.0, we can identify attributes that have made a difference. <br /></span></p>    <p style="text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">The </span><strong><span style="font-size: 10pt; font-family: Verdana">Foundation Attributes</span></strong><em><span style="font-size: 10pt; font-family: Verdana"> </span></em><span style="font-size: 10pt; font-family: Verdana">that enable the economics of Web 2.0, such as the <strong>network effect, the Long Tail and user contributed values</strong>, pre-date other attributes by several years and exist in many non-Web 2.0 services They allow services to scale efficiently to accommodate many customers. (e.g., email and bulletin boards). <br /></span></p>        <p style="text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">The <strong>Experience Attributes</strong> create unique service experiences like <strong>decentralization, co-creation, remixabilty and emergent systems</strong> that were undeliverable before Web 2.0. Users can tailor services and systems to create new, relevant experiences that meet their needs on their terms.</span> <br /></p>    <p style="text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">Earlier users of the phrase &quot;Web 2.0&quot; employed it as a synonym for &quot;Semantic Web,&quot; (The <strong>Semantic Web</strong> is an evolution of the World Wide Web in which information is machine processable (rather than being only human oriented), thus permitting browsers or other software agents to find, share and combine information more easily). and indeed, the two concepts complement each other. The combination of social-networking systems such as a Friend Of Friend (FOF) and XHTML Friends Network (XFN) works to with the development of tag-based, delivered through <a title="Blog" href="http://en.wikipedia.org/wiki/Blog">bogs</a> and Wikis, sets up a basis for a semantic web environment. <br /></span></p>  <p style="text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">I leave you with O reillys definition for As defined by </span><span style="font-size: 10pt; font-family: Verdana">O'Reilly<span /></span></p><p style="text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"><span> </span></span><span style="font-size: 11pt">&quot;<em>Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform, and an attempt to understand the rules for success on that new platform. Chief among those rules is this: Build applications that harness network effects to get better the more people use them. (This is what I've elsewhere called 'harnessing collective intelligence.')</em>&quot;.</span><span style="font-size: 10pt; font-family: Verdana" /></p>      <p style="text-align: justify" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">&nbsp;</span><br />The Author Prakash T.C.is a Support Manager at <a href="http://www.binaryspectrum.com/">Binary Spectrum</a><span style="font-size: 10pt; font-family: Verdana" /></p>  <p class="MsoNormal"><span>&nbsp;</span></p>]]>
        
    </content>
</entry>
<entry>
    <title>Software testing                                      Part 2</title>
    <link rel="alternate" type="text/html" href="http://binaryspectrum.com/geeksatwork/2007/01/software_testing_part_2.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://binaryspectrum.com/geeksatwork-mt/mt-atom.cgi/weblog/blog_id=1/entry_id=27" title="Software testing                                      Part 2" />
    <id>tag:binaryspectrum.com,2007:/geeksatwork//1.27</id>
    
    <published>2007-01-25T22:59:34Z</published>
    <updated>2007-01-25T23:03:38Z</updated>
    
    <summary><![CDATA[Classic Testing Misconceptions and Mistakes:Assumption that all defects in the software product have been detectedThe assumption that he or she is &nbsp;capable of testing the program completelyThe opinion that testing team is responsible for assuring qualityThe opinion that the goal...]]></summary>
    <author>
        <name>Prakash</name>
        <uri>http://www.Binaryspectrum.com</uri>
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://binaryspectrum.com/geeksatwork/">
        <![CDATA[<p><span><strong>Classic Testing Misconceptions and Mistakes:</strong></span></p><span><span><ol><li><span>Assumption that all defects in the software product have been detected</span></li><li><span>The assumption that he or she is <span>&nbsp;</span>capable of testing the program completely</span></li><li><span>The opinion that testing team is responsible for assuring quality</span></li><li><span>The opinion that the goal of testing is to find bugs only</span></li><li><span>Careless approach to the detection of major bugs </span></li><li><span>Negligence in reporting usability problems</span></li><li><span>Starting the testing phase too late (bugs detection, not bugs reduction)</span></li><li><span>Putting stress and load testing off to the last minute</span></li><li><span>Incomplete evaluation of the related project&rsquo;s documentation</span></li><li><span>Ignore testing of installation procedures </span></li><li><span>Failure in correctly identifying risk areas</span></li><li><span>Paying more attention to running tests than to designing them.</span></li><li><span>Not reviewing test designs.</span></li><li><span>Checking that the product does what it&rsquo;s supposed to do, but not that it doesn&rsquo;t do what it isn&rsquo;t supposed to do</span></li><li><span>Poor bug reporting</span></li><li><span>Attempting to automate all tests</span></li><li><span>Expecting to re-run all manual tests</span></li></ol><span><p><span><strong>Typical Tester&rsquo;s Mistakes:</strong></span></p><ol><li><div align="justify"><span>Assuming that the program works correctly. </span></div></li><li><div align="justify"><span>Unwillingness to document each and every error.</span></div></li><li><div align="justify"><span>Ignoring or even hiding the problem.</span></div></li><li><div align="justify"><span>Falling under influence of developers which pressurize the tester not to submit detected defects or to ignore existing intelligence about defects without adequate reasons.</span></div></li><li><div align="justify"><span>Attempting to have a &ldquo;not escalate&rdquo; attitude towards the developer.</span></div></li><li><div align="justify"><span>Insufficient attention to test planning.</span></div></li><li><div align="justify"><span>Writing defect reports about non existing problems.</span></div></li></ol><span><span><p><span><strong>An ideal tester should:</strong></span></p><ol><li><div><span>Possess software engineering skills (understanding the rules of software engineering, knowing computer programming and having operating system level knowledge). Often a tester needs to be an expert in a number of areas. </span></div></li><li><div><span>Possess a good knowledge of the application being tested.</span></div></li><li><div><span>Possess a considerable intelligence.</span></div></li><li><div><span>Possess a hyper-sensitivity to little things.</span></div></li><li><div><span>Be steady to chaos and pressure of development, management, as well as pressure of different circumstances.</span><span><li><div><span>Possess organizational skills.</span></div></li><li><div><span>Be skeptical, but not take hostile attitude.</span></div></li><li><div><span>Be capable of breaking the software without feeling any remorse. </span></div></li><li><div><span>Be self-sufficient and tough.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></div></li><li><div><span>Be a technology hungry. </span></div></li><li><div><span>Be honest.</span></div></li><li><div><span>Be capable to bring the bad news to developers and management.</span></div></li><li><div><span>Be patient &ndash; be ready to perform monotonous work during a long time.</span></div></li><li><div><span>Possess a flexible thinking.</span></div></li><li><div><span>Be capable of viewing the project from a global point of view.</span></div></li><li><div><span>Possess detective skills.</span></div></li><span><li><div><span>Possess strong communication skills which include.</span></div></li><ul><li><div><span>People skills</span></div></li><li><div><span>Tenacity</span></div></li><li><div><span>Capability to criticize and interpret the criticism correctly</span></div></li></ul><span>&nbsp;</span></span></span></div></li></ol><ol><span><span><span><span>The Author </span><span>Abdul Quddus is a Test Engineer</span><span> at <a href="http://www.binaryspectrum.com/">Binary Spectrum</a><strong><br /></strong></span></span><span></span></span></span></ol></span></span></span></span></span>]]>
        
    </content>
</entry>

</feed> 

