Sql-server – how to use sa to access local sql server database with jdbc

jdbcsql server

I have a new local sql server database, running hypothetically on port 48000. In SQL Server Management Studio under the name of the computer\MSSQLSERVER01, Security, Logins I clicked sa, properties and set the password. I have created a database, mystuff. sa is not listed under security under mystuff. I have the connection string
jdbc:sqlserver://MYDESKTOP\MSSQLSERVER01:48000;databasename=mystuff;user=sa;password=123
but I get "Login failed for user 'sa'" when I attempt to connect. What else do I need to do to setup sa? Something under mystuff?

Best Answer

You should not be connecting any application to your database installation using the installation owner account ("sa"). 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 "mess" made by everyone (and everything) else!

If an application connects with an "overpowered" account, like "sa"' 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.