Well, yes, you can. You're getting the "invalid column name" error because one of the two queries has an invalid column name. (Sometimes it's better to treat the error messages as if they are providing you useful information about what you did wrong...)
In your case I'm guessing that "employeeID" isn't the name of a column in the "attendance" table. If that's the case then
you should use the PreparedStatement feature where you can use "?" as a place-holder and then set its value via the setInt or setString method or another one like it.
You might also consider using a "select count(*) ..." query which returns a single record containing the number you want, instead of writing
Java code to drag all of the records across the network and then do nothing except count them.
By the way this applies to Java in general, because Java code written for a
JSF application is still Java code.