有谁知道sql语句预编译,在like后面应该怎样写啊?
例如:
pstmt = con.prepareStatement("select id,name from userid.person where name like '?%'");
pstmt.setString(1,"张");
但这样会报错,请问该如何写?
...全文
3094打赏收藏
关于一个sql预编译语句
有谁知道sql语句预编译,在like后面应该怎样写啊? 例如: pstmt = con.prepareStatement("select id,name from userid.person where name like '?%'"); pstmt.setString(1,"张"); 但这样会报错,请问该如何写?