presto-jdbc/src/main/java/io/prestosql/jdbc/PrestoStatement.java/PrestoStatement/connection
class PrestoStatement:    protected final PrestoConnection connection()
            throws SQLException
    {
        PrestoConnection connection = this.connection.get();
        if (connection == null) {
            throw new SQLException("Statement is closed");
        }
        if (connection.isClosed()) {
            throw new SQLException("Connection is closed");
        }
        return connection;
    }