通过 Windows 身份验证连接到 Microsoft SQL Server

action Database 配置您的设备和连接 package,以通过 Windows NT 身份验证自动连接到 Microsoft SQL Server

此任务只适用于 Build 9664 之前的版本。从 Build 9664 开始,不再需要手动添加 DLL 文件就可以连接到 Microsoft SQL Server

过程

要对与 Microsoft SQL Server 的连接使用 Windows NT 身份验证,请执行以下步骤:

  1. 下载 Microsoft SQL Server 的 JDBC 驱动程序。

  2. 在解压后的文件夹中,在 auth\x64\ 文件路径中找到 .dll 文件。
  3. 如果 .dll 文件有不同的名称,请将该文件重命名为 sqljdbc_auth.dll
  4. Bot CreatorBot Runner 设备上,将 sqljdbc_auth.dll 文件复制到以下路径之一,具体取决于您在何处安装了 Bot Agent 以及您在安装时选择的选项:
    注: 如果使用的是内部版本 9664 或更高版本,则不必将该文件复制到已安装 Bot Agent 的位置。
    • 如果已在用户级别安装 Bot Agent,并选择了只适用于我(用户名)选项,请复制到 C:\Users\User Name\AppData\Local\Programs\Automation Anywhere\Bot Agent\jre\bin
    • 如果已在系统级别安装 Bot Agent,并选择了任何使用此计算机的人(所有用户)选项,请复制到 C:\Program Files\Automation Anywhere\Bot Agent\jre\bin
    这将启用 Windows 身份验证,因为 JDBC 驱动程序在默认情况下无法执行身份验证。
  5. 选择默认连接选项。
  6. 输入连接字符串:jdbc:sqlserver://localhost;databaseName=Test;integratedSecurity=true;
  7. 单击保存

后续步骤

Choose from the following:
  • Use the Read from action to retrieve records from the database.

    使用读取自 action

  • If you are automating a task that involves making changes to the database, insert the Begin database transaction action.

    This action ensures that all records are updated or deleted in their entirety, and prevents accidental updates or deletions of incomplete data if the bot encounters an error during run time.

    Database package