Posts

Showing posts from 2013

Behind the City of Lights

As everyone knows that Karachi is a city of light but these days lights have more than one source. Initially the city sparkled by the KESC but these days bullet sparks are also helping the cause. But, this is what everyone must be aware of but, what people are not aware of can be easily understood by this reading. I don’t read newspaper because of the depressing news into it, but yes if something informative than I must go through. And in my case ‘informative’ means anything which can help me out.  So, I was just reading news that was shared by one of my colleague which was related to statistics of express crime in Karachi on monthly basis. And it’s around 130 registered crimes and around 500 unregistered crimes because no one goes for FIR of such crimes and in many cases Police don’t even lodge an FIR. So, here few questions rise: How they target us? Why Police don’t lodge an FIR? If anyone of us thinks that they are not organized then it must be our thoughts, bec...

Merge Multiple Rows in SQL Server

I was just going through a problem in database which was related to querying data from two tables but all the uncommon columns should be merged to a single row even comma separated. Primary Table ID Value_1 Value_2 1 ABC DEF 2 GEH IJK Foreign Table ID FK_ID Value_1 1 1 LMK 2 1 IJKK 3 2 ZZZ 4 2 YYY  Expected Result PK.ID FK_ID PK.Value_1 FK_Value_1 PK.Value_2 1 1122,2122 ABC LMK,IJKK LKM 2 3122,4122 GEH ZZZ,YYY NOP Query Select PK . ID , PK . Value_1 , PK . Value_2 ,       ( SELECT STUFF ( ( SELECT ', ' +   CONVERT ( varchar ( 25 ), FK . ID , 1 )    ...

Maven + Struts2 + Spring + Hibernate + Struts2-Convention-Plugin

Image
After spending so many days and nights and days again I finally be able to achieve the basic Architecture. Well, the basic architecture was quite simple and you will be able to get a lot of tutorials online about it but, probably they have few things missing (i.e. Maven or sometimes Struts2-Convention-Plugin). Reason behind choosing this structure is to make an easy expandable application structure with an isolation in between layers. Reason Behind: Maven is just used for dependency management of libraries and easy deployment. Struts2  is used for UI. Spring for service layer, as we all know we can easily change implementation which will be helpful for us to entertain the change request. Hibernate for ORM that will play with the database. Directory Structure: Don't worry about such a big directory tree. One by one I will tell you each and everything about it. Before starting everything we will start telling you about the pom that will be required to setup the ...