开发者

SQL Server Windows Authentication using a Service

I开发者_如何学运维 am running a Java Application as a Service in Windows that's using JDBC to connect to SQL Server. This application is started as a different user than the one logged into the Machine. My question is will the JDBC Driver use the user assigned to start the service to authenticate against or the logged in user (which there might not be one)?

Thanks


You can change logged in users all you want, the service will keep running in the background under the account that it was initially started.

If the connection is set to using Integrated Security, then the account that the service is started under will be the one that is used.


The service will connect using whatever user the service is running under (as visible in the service control manager).


Your service application is configured to always run as a particular user, for example "Service_User".

Even if user "Bob" logs in to start the service - all connections/files made by that service will appear to be from user "Service_User".

In your service application you make a JDBC connection to a database. If you specify Integrated Security in the connection string, it will log in to the database as "Service_User".

If you specify a Database username / password in your connection string, it will log into the database as that user.

That will happen regardless of the interactive login used to start it on the system.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜