Given is a Windows desktop application (written in Java) that communicates directly with a DBMS (SQL). There is no service layer between the desktop application and the DBMS.
How can one secure the access credentials for the database and the database connection itself in a way that users without admin privileges cannot misuse them outside of the program? For example, by accessing the database directly with other programs.
Under Linux, one could potentially run the program with a separate Linux user (setuid) and assign permissions in such a way that the user launching the program cannot access the program's binary files or configuration files because they are within the permission space of the separate Linux user. Access to the process's memory space could also be prevented in this manner.
Windows runAs is not an option, because one cannot restrict it to a single program.