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 , .
, .
, , , - .