Hi Ravi,
for me it looks like you are developing a custom login page. Why are you trying to do this? SAP provides different solutions depending on your requirements. In my opinion you should only develop security related functionality if
1.) it is really necessary
2.) you really know what you are doing! (From what I see it seems to you want to store passwords in clear text in the DB which is definitely something you should never ever do!)
Therefore, for me the question is what are you really want to do? Maybe someone here can suggest a better solution.
Best,
Christian