一、
sql = "select * from tb_user where user_name like ‘%‘||?‘%‘";
pstmt.setString(1, userPartName);
二、
sql = "select * from tb_user where user_name like ?";
pstmt.setString(1, "%" + userPartName + "%");
三、
sql = "select * from tb_user where user_name like ‘%"+userPartName+"%‘";
时间: 2024-10-23 08:38:28