Skip to content

ParameterizedOutputVisitor

wenshao edited this page Jun 3, 2016 · 1 revision
import com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils;
import com.alibaba.druid.util.JdbcConstants;

String sql = "select id from t where id = 3 /*!30000union all select 2*/";
String psql = ParameterizedOutputVisitorUtils.parameterize(sql, JdbcConstants.MYSQL);
Assert.assertEquals("SELECT id" //
                    + "\nFROM t"//
                    + "\nWHERE id = ?/*!30000union all select 2*/", psql);
Clone this wiki locally