1.地址不加BATCH_MODE=TRUE
preparedStatement使用如果不在链接参数添加_batch_mode=true参数_实际上未做批量发送给数据库
地址加BATCH_MODE=TRUE
2_preparedStatement在链接参数添加_batch_mode=true参数_实际上做了批量发送给数据库,虚谷数据库上可以查看GN的值为多少
3. 执行Prepare 命令
命令能直接在 xgconsole命令行中执行,如下:
4. 生成sql key
com.xugu.cloudjdbc.Statement.java 文件中
this.conObjName = Integer.toHexString(this.connection.hashCode());
在:
com.xugu.cloudjdbc.Statement.java 文件中
MessageFormat messageFormat = new MessageFormat(SQLCommon.getProperties().getProperty(“Statement.prepare”));
String[] preObj = new String[]{this.conObjName + String.valueOf(this.stId), preSql};
String sql = messageFormat.format(preObj);
在这里组装 Prepare命令
Prepare st7fbe847c0 as insert into xugu_table1 (name) values(?)
说明 key 是 本地JVM中生成的,且命令可以直接 xgconsole执行。