eRr: JDBC:mysql:// localhost:3306/字典xxxxxx xxxxxx 12:26:37 PM错误例外:无法建立数据库连接。检查连接字符串,用户名和密码。 然后,我尝试致电我的本地API: 从javasctipt成功致电:
let response = await fetch(url, {
method:"POST",
headers:{'Content-Type': 'application/json'},
body:JSON.stringify({sqlline:this.sqlline})
}
)
从应用程序脚本呼叫:
function apiTEST() {
let url = 'http://localhost:4000/wordle/read';
let sqlline = 'select word from dictionary.gamewords;'
all_data = ""
var options = {
'method' : 'POST',
'header': {'Content-Type': 'application/json'},
'payload' : JSON.stringify({sqlline:sqlline})
};
console.log("URL:", url, "OPTIONS:", options);
let response = UrlFetchApp.fetch(url, options);
console.log("RESPONSE:", response)
if (response.ok) {
all_data = response.json()
console.log("Response JSON")
console.log("ALL_DATA: ",all_data)
}
else {
console.log("HTTP-Error:", response.status)
}
return
}
提出以下错误: 异常:DNS错误:http:// localhost:4000/wordle/read
我猜想也许是因为我从Google产品中调用API,也许我需要在某个地方授予许可? 只是一个猜测ok,我发现了多个帖子,说我的问题是脚本正在运行在Google服务器上,这些服务器试图击中我的本地计算机。
由于我不愿意打开对我的PC的访问,我将通过从Python或Javascript生成电子表格来攻击我的问题。