public int CheckAdd() throws SQLException
  {
    int NbreAjout=0;
    ResultSet R=M.exec("SELECT value FROM variable WHERE ID=1");
    if(R!=null && R.absolute(1))
    { 
      int x=R.getInt("Value");
      ResultSet RS=M.exec("SELECT COUNT(*)FROM message");
      if (RS!=null && RS.absolute(1)) {
        int y=RS.getInt("COUNT(*)");
        if(x<y)
        {
          NbreAjout=y-x;
        }
      }
    }
    return NbreAjout;
  }