nikk 0 Light Poster

Hello friends, i'm creating a website using JSP with MS SQL.
I want to use md5 to encrypt user's password.
1. Is it safe?
2. how to use it i.e. can you guide me what code should be written in "New user's sign up" page and "Login page"?

Please Help.
Thank you.