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 +"%");
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 +"%");