after the execution of a SQL statement, it seems that the CPU occupancy of the Oracle database (12c) server has been pulled up, causing all database operations to be slowed down. SQL itself is not special. The logic is as follows:
"select sum(a.shuliang) sl from a,b where a.someid_a=? and a.someid_b=? and b.someid_c=? and a.id=b.id"
ps = con.prepareStatement(sql);
if (params != null) {
for (int i = 0; i < params.size(); iPP) {
Object v = params.get(i);
ps.setObject(i + 1, v);
}
}
rs = ps.executeQuery();
there has been no problem with the program using the above SQL. One day, I found that the database will slow down as long as it is executed. Then after the above SQL parameter values are directly inserted into the SQL in the program (below), the problem of slowing down no longer occurs, and other SQL in the same processing also use the parameter form, but only this SQL has a problem.
"select sum(a.shuliang) sl from a,b where a.someid_a=""+A+"" and a.someid_b=""+B+"" and b.someid_c=""+C+"" and a.id=b.id"
solve.