标签:msyql 问号 传参
一、
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+"%‘";
本文出自 “Exist” 博客,请务必保留此出处http://exist.blog.51cto.com/10305882/1956818
标签:msyql 问号 传参
原文地址:http://exist.blog.51cto.com/10305882/1956818