From https://developers.google.com/apps-script/jdbc

How to read data from a database into Google Apps Script