Google Apps脚本上的JDBC.异常:由于超时或客户端请求,语句被取消 [英] JDBC on Google Apps Script. Exception: Statement cancelled due to timeout or client request

查看:237
本文介绍了Google Apps脚本上的JDBC.异常:由于超时或客户端请求,语句被取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google Apps脚本中的JDBC从Google Cloud SQL上的mySQL数据库中获取数据.但是,我得到了这个错误:

I am trying to fetch data from mySQL database on Google Cloud SQL using JDBC from Google Apps Script. However, I got this error:

例外:由于超时或客户端请求而取消了语句

Exception: Statement cancelled due to timeout or client request

我可以成功获取其他一些数据.但是,有些数据我无法提供.

I can fetch some other data successfully. However, some data I can't.

我在mySQL工作台上执行成功查询之一和不成功查询之一.我可以在MySQL工作台上执行成功的查询而不会出现问题.

I execute one of the successful queries and one of the unsuccessful queries on mySQL workbench. I can execute the unsuccessful query with no problem on mySQL workbench.

我比较了持续时间.

Duration / Fetch
-------------------------------------------
Successful query:     0.140 sec / 0.016 sec
Unsuccessful query:   0.406 sec / 0.047 sec

不成功的查询似乎需要更长的时间.因此,我将查询超时设置为:

The unsuccessful query seems to take longer. So, I set query timeout with:

stmt.setQueryTimeout(0);

打算不设置超时(当该值设置为零时,表示执行没有超时限制).然后,我在Google Apps脚本上执行了它.

intending to set no timeout (when the value is set to zero it means that the execution has no timeout limit). Then, I executed it on Google Apps Script.

但是,它不起作用并出现相同的错误.您能告诉我解决方案吗?

However, it doesn't work and get the same error. Could you tell me a solution for this?

推荐答案

这似乎是一个已知问题.加上星号★并评论问题,以使Google开发人员优先考虑该问题.在问题解决之前,您可以切换回犀牛运行时.

This seems to be a known issue. Star ★ and comment on the issue to get Google developers to prioritise the issue. Until the issue is fixed, you can switch back to rhino runtime.

这篇关于Google Apps脚本上的JDBC.异常:由于超时或客户端请求,语句被取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆