关于查找算法-
2014-03-03 19:58
169 查看
public ResultSet equipmentList(Connection con,EquipmentType equipmentType) throws Exception{ StringBuffer sb=new StringBuffer("select * from t_equipmenttype"); //System.out.print(equipmentType.getEquipmentTypeName()); if(StringUtil.isNotEmpty(equipmentType.getEquipmentTypeName())){ sb.append(" and equipmentTypeName like '%"+equipmentType.getEquipmentTypeName()+"%'"); } PreparedStatement pstmt=con.prepareStatement(sb.toString().replaceFirst("and", "where")); System.out.print(pstmt); return pstmt.executeQuery(); }
挺好,学习到了.
相关文章推荐
- 一个运营的自我修养:初级运营需要了解的书籍、网站、工具
- oracle中的commit-备忘
- ToStringBuilder 学习
- ZOJ Monthly, March 2014 (2014省赛练习)
- 求离散数据极值(点)
- rtp
- 13-14寒假作业2
- Reading Liat
- (转)类的sizeof
- Eclipse格式化代码时不换行与自动换行
- Linux中重定向输出的学习
- [转]nosql数据库学习一:安装和使用memcached
- oracle 存储过程和游标的使用
- android 与c#服务端DES加密不一致问题解决
- 最大子段和——分治与动态规划
- Go语言linux下构造tcp数据包(不使用net包和Cgo)
- myeclipse快捷键ALT+/失效的解决办法
- 学习笔记----扩展欧几里德
- 监听---共享连接参数配置介绍
- Solr的分析器,分词器和分词过滤器