How about set the integratedSecurity
to true.
Refer to this doc: Setting the connection properties.
Set to "true" to indicate that Windows credentials are used by SQL Server on Windows operating systems. If "true", the JDBC driver searches the local computer credential cache for credentials that were provided when a user signed in to the computer or network.
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".