Reputation: 2128
The below code returns an "Invalid argument" exception on the last line of the code below in Google Apps Script.
var conn = Jdbc.getConnection(dbUrl, user, userPwd);
var stmt = conn.createStatement();
stmt.setQueryTimeout(40);
According to Google's own documentation, the argument accepts an integer defining the timeout in seconds, so I can't see anything wrong with it.
https://developers.google.com/apps-script/reference/jdbc/jdbc-statement#setquerytimeoutseconds
Also the documentation of java.sql.Statement (of which this Jdbc class is a direct port) doesn't give any hints as to were this could be wrong.
https://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int)
Upvotes: 0
Views: 580
Reputation: 2128
For no apparent (and more importantly undocumented) reason the limit for the setQueryTimeout seconds parameter is set to 30 in Google Apps Script.
So the below code runs fine.
stmt.setQueryTimeout(30);
Upvotes: 1