在Mysql中对应改update查select(增删改)
statment 状态通道
eg:
select * from student where id = 101
preparedstament 预状态通道
eg:
select * from student where id = ?
select * from user where name = “admin” and pssword =“root” & 1 = 1
区别:
预状态通道比状态通道安全,防止了sql注入
预状态通道可以实现预编译,效率高,维护性高,可读性强
测试数据来源:
1.开发的模拟数据
2.线上真实数据
3.测试模拟数据
4.同类产品的数据库采样
如何对数据库进行压力测试?
1.打开jmeter,先创建线程组。
2.配置元件 →JDBC → 以MySQL数据库为例,配置JDBC:jdbc:mysql://localhost:port/{dbname}
3.取样器 → JDBC Request
4.监听器 → 察看结果树