You can connect to the database by sys or system but not other users.I found a solution for this.
SQL> create user joe identified by joe;
User created.

SQL> create role "joe" identified by joe;
Role created.

SQL> select name,password from sys.user$ where name in('JOE','joe');

NAME PASSWORD
------------------------------ ------------------------------
joe 8E38D56D83C9573B
JOE 8E38D56D83C9573B

SQL> drop role "joe";
Role dropped.

There is less risk involved here because you create a role similiar to username and checking the password for both the username and role.If it matches the username is having the password same and if not its different and you can delete the role immly.This was is much simplier because you dont want to create the user in a dummy database and check.