Many publishers still seem to use commas before quotations, as in your first example, but Larry Trask argued persuasively against doing so:
A sentence containing a quotation is punctuated exactly like any other
sentence apart from the addition of the quotation marks. You should
not insert additional punctuation marks into the sentence merely to
warn the reader that a quotation is coming up: that's what the
quotation marks are for. Hence the first two of the following are bad
style, and the third one is wrong:
*President Nixon declared, "I am not a crook."
*President Nixon declared: "I am not a crook."
*President Nixon declared:- "I am not a crook."
The comma and the colon in the first two are completely pointless,
while the startling
arsenal of punctuation in the third is grotesque. (Remember, a colon
can never be followed by a hyphen or a dash.) Here is the sentence
with proper punctuation: President Nixon declared "I am not a crook."
Adding more dots and squiggles to this perfectly clear sentence would
do absolutely nothing to improve it. No punctuation mark should be
used if it is not necessary.
‘The Cambridge Guide to English Usage’ largely endorses this approach, describing the comma before a quotation as an ‘older convention’.
There is even less of a need for a comma in your second example.