public boolean checkData()
  {
    String out = "";     sql = "select * from Admin where Aid='" +getname + "';";
    System.out.println("要查询的SQL语句是:" + sql);
    try {
             rs = stmt.executeQuery(sql);
      while (rs.next())
      {
        out = rs.getString("Aid");
        System.out.println("查询的结果是:" + out);
      }
      if (out.equals(getname))
      {
        JOptionPane.showMessageDialog(wind, "数据已经存在,不要重复添加。", "温馨提示:", 1);
      }       return (rs == null) || (rs.equals(""));
    }
    catch (Exception e)
    {
      
      e.printStackTrace();
    }
    
    return false;
  }数据库