It is better to avoid running functions on columns in a where clause, because it cripples the DB's ability to use indexes. Imagine you had 2 million rows in your table, 100 of which are from Feb 2020, and the date column is indexed. A DB can optimize a query like WHERE date BETWEEN '2020-02-01' AND '2020-02-29'
to use an index and retrieve just those 100 rows it knows matter, but it can't do the same with WHERE YEAR(date) = 2020 AND MONTH(date) = 2
: in this latter case it will just have to visit all 2 million rows, calling two functions per row (slooow), to find the same 100 rows
If you want data from the current month you should instead use something more like:
SELECT *
FROM table
WHERE datecolumn >= @startDate AND dateColumn < @endDate
And then get Java to work out fixed constants for the @startDate and @endDate parameters (why? because it makes the code flexible; if you code up current month into the SQL you can't later reuse the same code to query the current year)
At the very least if you're coding this logic into the SQL, only use functions for the constants to which dates are compared:
SELECT *
FROM table
WHERE
--add (1 minus the current day number) to get to start of month
datecolumn >= DATEADD(day, 1-DAY(getutcdate()), CAST(getutcdate() as date)) AND
--add 1 day to result of EOMONTH function to get constant for end of the month
datecolumn < DATEADD(DAY, 1, EOMONTH(getutcdate()))
Note: you didn't specify which DB you use so I guessed at SQLServer and use the @ form of parameter name. It doesn't change the core message here, which is "Don't use functions on table data, in a where clause"