Google Apps Script - JDBC Connection Failed

前端 未结 1 856
再見小時候
再見小時候 2020-12-21 22:07

I am attempting to open a connection from a Google Apps Spreadsheet without success, using example code from the Google Apps Developers reference (https://developers.google.

1条回答
  •  再見小時候
    2020-12-21 22:47

    The problem is that the localhost is used as the host. Google Apps Scripts are executed on Google servers and not on local computers. This means that the scripts cannot access the localhost and the error is logical.

    To get rid of the error is necessary to have an SQL Server accessible outside of a local network (public in internet). It can be a MySQL port forwarded behind of a firewall or a 3rd part public SQL service.

    Searching in internet, I found a few public MySQL Servers, but I don not know either they are online or not (link #1, link #2, link #3)

    Update 00: The JDBC Service has a bug with impossibility to resolve host name to IP. I tried to test using the following code. It makes a connection to the DB.

    function test() {
      var connection = Jdbc.getConnection("jdbc:mysql://193.62.203.76:3306/", "anonymous", "");
      debugger;
    }
    

    0 讨论(0)
提交回复
热议问题