I have created URL object and through this i want to access the User and password
and submit the request through URL.
There is no API in the world that will provide you with a users password (excpet for authentication modules that actively rectrieve the password from the user "manually", of course).
What is this currently? There have been, in the past few days, between here, Java World, and the Sun forums, about 50 questions by someone wanting to get the user password. Does no one understand that providing that is a huge, gaping, security hole? And because of that , no respectable software is going to provide it.