I wanted to share my related issue that this post made me aware of as it helped to resolve my problem. Hopefully, this may avoid some extra hours trying to figure this out.
I was able to get my Tomcat 10.1 JDBC connection to work finally after removing the "databaseName=" in my URL in the jdbc resource in context.xml as mentioned here. My app worked as expected in Eclipse using the same instance of Tomcat and connecting to the same local 2022 SqlServer Express DB. However, as mentioned here, I got the same "SQLServerException: Cannot open database .....The login failed. " error when the war was deployed to my local instance of Tomcat.
Removing the mentioned parameter resolved this issue. While my user did work in Eclipse and also in SSMS, it was a user that had read only access to only 2 tables and nothing else. I suspect the internal of SQLServer did not allow such a restricted user to login via a service.