public void removeScript ( int id ) throws Exception { PreparedStatement statement = null ; try ( Connection sqlConnection = SQLService . getInstance ( ) . getConnection ( ) ) { statement = sqlConnection . prepareStatement ( "DELETE FROM " + Constants . DB_TABLE_SCRIPT + " WHERE " + Constants . GENERIC_ID + " = ?" ) ; statement . setInt ( 1 , id ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } finally { try { if ( statement != null ) { statement . close ( ) ; } } catch ( Exception e ) { } } }
Remove script for a given ID