SpiSqlUpdate updateSql = request.getUpdateSql();
SpiTransaction t = request.getTransaction();
String sql = updateSql.getSql();
BindParams bindParams = updateSql.getBindParams();
// process named parameters if required
sql = BindParamsParser.parse(bindParams, sql);
boolean logSql = request.isLogSql();
PreparedStatement pstmt;
if (batchThisRequest){
pstmt = pstmtFactory.getPstmt(t, logSql, sql, request);
if (pstmtBatch != null){
// oracle specific JDBC setting batch size ahead of time
int batchSize = t.getBatchSize();
if (batchSize < 1){
batchSize = defaultBatchSize;
}
pstmtBatch.setBatchSize(pstmt, batchSize);
}
} else {
if (logSql){
t.logSql(sql);
}
pstmt = pstmtFactory.getPstmt(t, sql);
}
if (updateSql.getTimeout() > 0){
pstmt.setQueryTimeout(updateSql.getTimeout());
}
String bindLog = null;
if (!bindParams.isEmpty()){
bindLog = binder.bind(bindParams, new DataBind(pstmt));
}
request.setBindLog(bindLog);