SyntaxError: Unexpected token '(' (line 6, file "Code.gs")

Viewed 23

I am trying to connect my database to Google sheet via Appscript and trying to test my database connection but getting error

SyntaxError: Unexpected token '(' (line 6, file "Code.gs")

My code is

url = 'jdbc:mysql://1.1.1.1.1:3306/abc-def.3.3.5';
username = "abc_username"; 
password = "password_HHCenXA0"; 
System.out.println("Connecting database..."); 

try (Connection connection = DriverManager.getConnection(url, username, password)) { 

System.out.println("Database connected!"); 

} 
catch (SQLException e) { 
throw new IllegalStateException("Cannot connect the database!", e); 
}

I did whitelist the Ips range as well but not sure what is the cause. Anywork around this would be helpful

Thanks in advance

0 Answers
Related