class JDBC method .createStatement()

JDBC is the Apps Script service.

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

What it does

Creates a SQL statement to run against the database.

Why it's used

  • Run SQL after you open a database connection.
  • Execute queries or updates against external data.

Common errors

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

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.createStatement().

Browse the blog