title: jdbc DELETE update not working in Java code.
body: <p>I am working on a small Java JFrame desktop application for my website's staff to be able to delete all reported posts with just one click. </p>
  
  <p>So far, the GUI is correct, with 2 buttons- a getReports button to give the amount of posts, and a deleteReports button. </p>
  
  <p>The getReports function is working properly. However, for whatever reason, the DELETE query is not working. Interestingly enough, when I manually use the query on the database, it deletes the rows in question, so I don't think it is a problem with the query. </p>
  
  <p>Here are, in order, the getReports and deleteReports methods:</p>
  
  <pre><code>public static int getReports() throws InstantiationException, IllegalAccessException {
  
      Connection conn = null;
          try {
  
              conn = DriverManager.getConnection(url, username, password);
  
              Statement stmt = conn.createStatement();
              String sql = "SELECT count(*) as amount FROM `tryreports`";
              ResultSet rs = stmt.executeQuery(sql);
              rs.first();
              int quantity = rs.getInt("amount");
              conn.close();
              return quantity;
  
  
  
          }
          catch (SQLException ex) {
          // handle any errors
          System.out.println("SQLException: " + ex.getMessage());
          System.out.println("SQLState: " + ex.getSQLState());
          System.out.println("VendorError: " + ex.getErrorCode());
          return 0;
          } 
  
  
  
  }
  
  public static void deleteReports() throws InstantiationException, IllegalAccessException {
  
      Connection conn = null;
          try {                
              conn = DriverManager.getConnection(url, username, password);
              //System.out.println("Connected database successfully...");
  
              Statement stmt = conn.createStatement();
              String sql = "DELETE FROM `tryreports` WHERE posts IS NOT NULL";
              stmt.executeUpdate(sql);
  
  
  
          }
          catch (SQLException ex) {
          // handle any errors
          System.out.println("SQLException: " + ex.getMessage());
          System.out.println("SQLState: " + ex.getSQLState());
          System.out.println("VendorError: " + ex.getErrorCode());
          //return 0;
          } 
  
  
  
  }
  </code></pre>
  
  <p>thoughts? any help would be appreciated.</p>