public static boolean dropIndex ( Connection conn , String table , String cname , String iname ) throws SQLException { if ( ! tableContainsIndex ( conn , table , cname , iname ) ) { return false ; } String update = "ALTER TABLE " + table + " DROP INDEX " + iname ; PreparedStatement stmt = null ; try { stmt = conn . prepareStatement ( update ) ; if ( stmt . executeUpdate ( ) == 1 ) { log . info ( "Database index '" + iname + "' removed from table '" + table + "'." ) ; } } finally { close ( stmt ) ; } return true ; }
Removes a named index from the specified table .