public static boolean checkUsername(String username,String role) {
	
    //preparing some objects for connection 
        Statement stmt = null;    
	String searchQuery ="SELECT * FROM user_login WHERE Username='"+ username+ "' AND Role='"+ role +"'";
        try 
        {
            //connect to DB 
            currentCon = loginpack.ConnectionManager.getConnection();
            stmt=currentCon.createStatement();
            rs = stmt.executeQuery(searchQuery);	        
            boolean more = rs.next();
            // if user does not exist return true
            if (!more) 
            {
                System.out.println("Sorry, you are not a registered user! Please sign up first");
                return true;
            } 
            //if user exists return false
            else
            {
                return false;
            }
        }catch (Exception ex){
            System.out.println("Log In failed: An Exception has occurred! " + ex);
            return false;
        } 
        //some exception handling
        finally 
        {
            if (rs != null)	{
                try {
                rs.close();
                } catch (Exception e) {}
                rs = null;
                }

            if (stmt != null) {
                try {
                stmt.close();
                } catch (Exception e) {}
                stmt = null;
                }

            if (currentCon != null) {
                try {
                currentCon.close();
                } catch (Exception e) {
                }

                currentCon = null;
            }
        }
    }