how do I use sa to access local sql server database with jdbc
You should not be connecting any application to your database installation using the installation owner account (&quot;sa&quot;).  Instead, create an account dedicated for the use of your Application and grant that account the right privileges.
Why?
Always keep the biggest and best tools in the box for yourself, because it's your job to clean up the &quot;mess&quot; made by everyone (and everything) else!
If an application connects with an &quot;overpowered&quot; account, like &quot;sa&quot;' and that application gets hacked, then your database can be wrecked in all sorts of nasty, painful and expensive to recover ways!
Save yourself the grief.