sql语句模糊查询并且要传入参数

jdbc中的查询语句会经常用到:
String sql2 = "select u.USERID from USER_PREF u " +
        "where u.USERID like ?||'%' and ( u.key like 'SEARCH_TEMPLATE:%')";
uidList = (List) qr.query(sql2, new ColumnListHandler("USERID"), uid);

你可能感兴趣的:(mysql优化)