无法使用 Googls Apps 脚本和 JDBC 建立与本地 Microsoft SQL Server 的连接

问题描述 投票:0回答:0

我正在尝试使用带有 JDBC 的 Google Apps 脚本连接到本地 MS-SQL Server,但我收到以下错误消息“异常:无法建立数据库连接。检查连接字符串、用户名和密码。”

我的脚本有以下代码:

function getConnection() 
{
    let HostName = "192.XX.0.XX";
    let DatabaseName = "my_base";
    let Username = "william";
    let Password = "XXXXXXXX";
    let Port = "7990";
    let url = "jdbc:sqlserver://"+HostName+":"+Port+"/"+DatabaseName;
    let connection = Jdbc.getConnection(url, Username, Password);
    Logger.log(connection);
    connection.close();
}

我想使用 JDBC 将 Google Apps 脚本连接到 MS-SQL Server 中的本地数据库。

sql database jdbc server local
© www.soinside.com 2019 - 2024. All rights reserved.