protected static void removeAllTriggers(Connection conn,String prefix) throws SQLException {
  Statement stat=conn.createStatement();
  ResultSet rs=stat.executeQuery("SELECT * FROM INFORMATION_SCHEMA.TRIGGERS");
  Statement stat2=conn.createStatement();
  while (rs.next()) {
    String schema=rs.getString("TRIGGER_SCHEMA");
    String name=rs.getString("TRIGGER_NAME");
    if (name.startsWith(prefix)) {
      name=StringUtils.quoteIdentifier(schema) + "." + StringUtils.quoteIdentifier(name);
      stat2.execute("DROP TRIGGER " + name);
    }
  }
}

protected static void removeAllTriggers ( Connection conn , String prefix ) throws SQLException { Statement stat = conn . createStatement ( ) ; ResultSet rs = stat . executeQuery ( "SELECT * FROM INFORMATION_SCHEMA.TRIGGERS" ) ; Statement stat2 = conn . createStatement ( ) ; while ( rs . next ( ) ) { String schema = rs . getString ( "TRIGGER_SCHEMA" ) ; String name = rs . getString ( "TRIGGER_NAME" ) ; if ( name . startsWith ( prefix ) ) { name = StringUtils . quoteIdentifier ( schema ) + "." + StringUtils . quoteIdentifier ( name ) ; stat2 . execute ( "DROP TRIGGER " + name ) ; } } }
remove all triggers that start with the given prefix .
