使用服务的 SQL Server Windows 身份验证

发布于 2024-08-18 08:43:46 字数 145 浏览 3 评论 0原文

我正在 Windows 中运行 Java 应用程序即服务,它使用 JDBC 连接到 SQL Server。该应用程序以与登录计算机的用户不同的用户身份启动。我的问题是 JDBC 驱动程序是否会使用分配的用户来启动服务来进行身份验证或登录用户(可能没有)?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

迷雾森÷林ヴ 2024-08-25 08:43:46

您可以随意更改登录的用户,该服务将在最初启动的帐户下在后台继续运行。

如果连接设置为使用集成安全性,则将使用启动服务的帐户。

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.

分開簡單 2024-08-25 08:43:46

该服务将使用运行该服务的任何用户进行连接(如服务控制管理器中可见)。

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

魔法少女 2024-08-25 08:43:46

您的服务应用程序配置为始终以特定用户身份运行,例如“Service_User”。

即使用户“Bob”登录并启动该服务,该服务建立的所有连接/文件也将显示为来自用户“Service_User”。

在您的服务应用程序中,您与数据库建立 JDBC 连接。如果您在连接字符串中指定集成安全性,它将以“Service_User”身份登录到数据库。

如果您在连接字符串中指定数据库用户名/密码,它将以该用户身份登录数据库。

无论用于在系统上启动它的交互式登录如何,都会发生这种情况。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文