Both SQL Audit and Extended Events (which Audit builds on) will do this for you. Here's an XE session I created to capture all queries executed against a specific database a few weeks ago:
CREATE EVENT SESSION [Find YOURDB queries] ON SERVER
ADD EVENT sqlserver.rpc_starting(
WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)) AND [sqlserver].[database_name]=N'YOURDB')),
ADD EVENT sqlserver.sql_batch_starting(
WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)) AND [sqlserver].[database_name]=N'YOURDB'))
ADD TARGET package0.event_file(SET filename=N'C:\IT\XEData\FindYOURDBQueries.xel')
WITH (MAX_MEMORY=2048 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=PER_CPU,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
There's a visual editor for XE sessions as well which can help you fine-tune the event filtering so that you can capture only connections.
Question: are you counting only connections to the database, or any connection which accesses the database? IOW, would a connection that's using
master but then querying your database via three-part naming (
select * from YOURDB.dbo.tablename ) need to be counted as well?