首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

java写preparedStatement中的sql的like话语

2012-11-03 
java写preparedStatement中的sql的like语句今天写到这个,很郁闷,用了三种方法:PreparedStatementstat Co

java写preparedStatement中的sql的like语句
今天写到这个,很郁闷,用了三种方法:
PreparedStatement  stat ; Connection conn;
1:

stat = conn.PreparedStatement("select * from book where bookname like ?");stat.setString(1,"%"+bookname+"%");


这样最后终于达到模糊匹配查询功能。

还望各位高人告诉鄙人第一种方法为什么不行。在此谢过。 1 楼 Maplemirror 2011-07-28   http://hi.baidu.com/fei126222/blog/item/e35326d61468943d06088b66.html

热点排行