以下代码返回"无效参数" Google Apps脚本中代码最后一行的例外情况。
var conn = Jdbc.getConnection(dbUrl, user, userPwd);
var stmt = conn.createStatement();
stmt.setQueryTimeout(40);
根据Google自己的文档,该参数接受一个以秒为单位定义超时的整数,因此我无法看到它有任何问题。
https://developers.google.com/apps-script/reference/jdbc/jdbc-statement#setquerytimeoutseconds
java.sql.Statement(此Jdbc类是直接端口)的文档也没有提供任何提示,这可能是错误的。
https://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int)
答案 0 :(得分:0)
对于没有明显(更重要的是未记录)的原因,在Google Apps脚本中将setQueryTimeout 秒参数的限制设置为30。
所以下面的代码运行正常。
stmt.setQueryTimeout(30);