public static void dropIndex(Connection conn,String schema,String table) throws SQLException {
  init(conn);
  PreparedStatement prep=conn.prepareStatement("SELECT ID FROM " + SCHEMA + ".INDEXES WHERE SCHEMA=? AND TABLE=?");
  prep.setString(1,schema);
  prep.setString(2,table);
  ResultSet rs=prep.executeQuery();
  if (!rs.next()) {
    return;
  }
  int indexId=rs.getInt(1);
  prep=conn.prepareStatement("DELETE FROM " + SCHEMA + ".INDEXES WHERE ID=?");
  prep.setInt(1,indexId);
  prep.execute();
  createOrDropTrigger(conn,schema,table,false);
  prep=conn.prepareStatement("DELETE FROM " + SCHEMA + ".ROWS WHERE INDEXID=? AND ROWNUM<10000");
  while (true) {
    prep.setInt(1,indexId);
    int deleted=prep.executeUpdate();
    if (deleted == 0) {
      break;
    }
  }
  prep=conn.prepareStatement("DELETE FROM " + SCHEMA + ".MAP M "+ "WHERE NOT EXISTS (SELECT * FROM "+ SCHEMA+ ".ROWS R WHERE R.ID=M.ROWID) AND ROWID<10000");
  while (true) {
    int deleted=prep.executeUpdate();
    if (deleted == 0) {
      break;
    }
  }
}

public static void dropIndex ( Connection conn , String schema , String table ) throws SQLException { init ( conn ) ; PreparedStatement prep = conn . prepareStatement ( "SELECT ID FROM " + SCHEMA + ".INDEXES WHERE SCHEMA=? AND TABLE=?" ) ; prep . setString ( 1 , schema ) ; prep . setString ( 2 , table ) ; ResultSet rs = prep . executeQuery ( ) ; if ( ! rs . next ( ) ) { return ; } int indexId = rs . getInt ( 1 ) ; prep = conn . prepareStatement ( "DELETE FROM " + SCHEMA + ".INDEXES WHERE ID=?" ) ; prep . setInt ( 1 , indexId ) ; prep . execute ( ) ; createOrDropTrigger ( conn , schema , table , false ) ; prep = conn . prepareStatement ( "DELETE FROM " + SCHEMA + ".ROWS WHERE INDEXID=? AND ROWNUM<10000" ) ; while ( true ) { prep . setInt ( 1 , indexId ) ; int deleted = prep . executeUpdate ( ) ; if ( deleted == 0 ) { break ; } } prep = conn . prepareStatement ( "DELETE FROM " + SCHEMA + ".MAP M " + "WHERE NOT EXISTS (SELECT * FROM " + SCHEMA + ".ROWS R WHERE R.ID=M.ROWID) AND ROWID<10000" ) ; while ( true ) { int deleted = prep . executeUpdate ( ) ; if ( deleted == 0 ) { break ; } } }
drop an existing full text index for a table . this method returns silently if no index for this table exists .
