select * from dict_item t where t.code like '?%'

select *  from dict_item t  where t.code like '?%'

程序中使用该段代码,依次报“无效的列索引”、“无效的字符”,后来发现该段代码有误。

以下正解:

    StringBuffer sql = new StringBuffer("select *  from dict_item t  where t.code like ?");

            ...

    pst.setString(1, preOrgCode +"%");

猜你喜欢

转载自argel-lj.iteye.com/blog/1312490
今日推荐