public boolean testUser(String u) throws Exception {
	
        Connection conn =null;
        Statement stmt = null;
        ResultSet rs=null;
  
        try{
	    Class.forName("com.mysql.jdbc.Driver");
            conn=DriverManager.getConnection(url);
            
            stmt = conn.createStatement();
            String sql;
            sql ="SELECT NAME from USERS WHERE USER_NAME = " + "'" + u + "'";
            rs= stmt.executeQuery(sql);

	    // check if we got any result set
	    
	    boolean b = rs.next();
            return b;
       }   
	catch(SQLException sqle){
            throw new Exception(sqle);
	}
        finally{
 	    try{
		rs.close();
            }
            catch(Exception e) {}
            try{
		stmt.close();
            }
	    catch(Exception e) {}
            try {
		conn.close();
            }
            catch(Exception e){}
        }
    }