Statement cancelled due to timeout or client request

后端 未结 2 1728
生来不讨喜
生来不讨喜 2021-01-28 06:24

I am trying to add data to my Google Cloud SQL database using Google App Script. My code was working fine last night when I finished but when I ran it this morning it is now giv

2条回答
  •  星月不相逢
    2021-01-28 07:12

    Try it like this:

    function connection(folderId, db, c1, c2, c3, c4, c5, c6, c7) {
      var ss=SpreadsheetApp.openById("fileId");//just go to the file and get the id
      var sh=ss.getSheetByName('Report 1');
      var rg=sh.getRange("B5:H16");
      var sheetdata=rg.getValues();
      var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);//dburl is not defined
      conn.setAutoCommit(false);
      var stmt = conn.prepareStatement('INSERT INTO '+ db + ' ' + '('+c1+','+c2+','+c3+','+c4+','+c5+','+c6+','+c7+') values (?, ?, ?, ?, ?, ?, ?)');
      for (var i=0; i

提交回复
热议问题