dbutils模糊查询

代码:

 StringBuffer sql = new StringBuffer("select ti.ky_city,ti.car_number,ti.first_bus,ti.last_bus,ti.interval,tl.station,ti.price,ti.cost,ti.length,ti.remark,ti.cards from ecityadmin.T_DATA_BUS_INFO ti,ecityadmin.T_DATA_BUS_LIST tl where ti.CAR_NUMBER=tl.CAR_NUMBER ");
  sql.append("AND tl.STATION LIKE ? order by ti.CAR_NUMBER");
  Object[] params = new Object[]{};
  Object[] param = ArrayUtils.add(params, "%"+stationName+"%");
  System.out.println("stationQuery'sql = " + sql.toString());
  try {
   list = (List) queryRunner.query(conn,sql.toString(),param, new BeanListHandler(HebGongjiao.class));
  } catch (SQLException e) {
   throw new RuntimeException(e);
  } finally {
            DBCommonUtil.releaseConnection(conn);
        }

你可能感兴趣的:(dbutils模糊查询)