Google脚本与jdbc和数据库mysql配合使用

Google脚本与jdbc和数据库mysql配合使用,mysql,jdbc,google-apps-script,Mysql,Jdbc,Google Apps Script,我使用google脚本和JDBC连接器连接MySQL数据库。我想使用变量运行查询,例如: var rs = stmt.executeQuery("select*from Comuni where nomeComune=v"); 如何让JDBC将末尾的v解释为一个变量?我只会使用常规字符串连接-这只是JavaScript 为什么不尝试以下方法: var rs = stmt.executeQuery( "select * from Comuni where nomeComune={0}".form

我使用google脚本和JDBC连接器连接MySQL数据库。我想使用变量运行查询,例如:

var rs = stmt.executeQuery("select*from Comuni where nomeComune=v");

如何让JDBC将末尾的
v
解释为一个变量?

我只会使用常规字符串连接-这只是JavaScript

为什么不尝试以下方法:

var rs = stmt.executeQuery( "select * from Comuni where nomeComune={0}".format( value ) );

参数化查询-通常带有“?”