PreparedStatement设置的参数在哪看!

现在的公司经常使用PreparedStatement,防止sql注入,但有时设置的参数就忘记咋看了,做下记录,下次直接翻阅博客

// 代码块
PreparedStatement statement = null;
DruidPooledConnection connection = null;
connection = this.getUCDruidConnection();
String sql="select * from xxxx where xx=? and xx=? and xx=? and xx=? and xxx=? and xxx=? and xxx=? and xxx=? and xxx=?";
statement = connection.prepareStatement(sql);
statement.setInt(1, xxx);
statement.setInt(2, xxx);

在这里插入图片描述

打开后就可以看到我们存放的参数:
在这里插入图片描述
展开parameters,便可看到设置的值:
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_42258975/article/details/108732126