class JDBC method .getConnection()

JDBC is the Apps Script service.

.getConnection() is the method name you will see after a dot in your code.

What it does

Opens a connection to an external SQL database.

Why it's used

  • Connect Apps Script to MySQL, Postgres, or another SQL database.
  • Pull live data into a sheet from outside Google.

Common errors

  • Forgetting parentheses on getConnection. Write JDBC.getConnection(), not JDBC.getConnection or getConnection by itself.
  • Skipping dots between chained calls. Each step needs a dot, like JDBC.getConnection().
  • Adding spaces where they do not belong. Write JDBC.getConnection(), not JDBC .getConnection(), JDBC.getConnection (), or JDBC . getConnection().
  • Wrong capitalization. Use JDBC and getConnection, not jdbc or getconnection.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about JDBC.getConnection().

Browse the blog