Google Apps Script - Failed to connect to JDBC

I'm trying to open a connection from a Google Apps spreadsheet without success using the sample code from the Google Apps Developer Help ( https://developers.google.com/apps-script/jdbc )

function insert() {
    var conn = Jdbc.getConnection("jdbc:mysql://localhost:3306/test", "a", "a");

ERROR: Failed to establish database connection. Check the connection string, username and password. (line 56)

I tried replacing "localhost" with my specific IP address.

I can successfully connect to my database using Access, ODBC and the above credentials, so I know this is a JDBC / Google-apps-script problem.

CLASSPATH points to the correct jar file, as shown in the figure:

C:\>echo %CLASSPATH%
.;C:\Program Files\Java\mysql-connector-java-5.1.22\mysql-connector-java-5.1.22-
bin.jar

, - , script, google-doc- , Windows, .

, , JDBC , .

, .

, , , - .

+1
1

, localhost. Google Apps Google, . , localhost, .

, SQL Server, ( ). MySQL, SQL .

, MySQL, , , ( # 1, # 2, # 3)

00. JDBC IP. , . .

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

All Articles