首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

从数据库中取得多字段的list,怎样查询出所要知道的结果?解决办法

2012-03-04 
从数据库中取得多字段的list,怎样查询出所要知道的结果?问题这样:  用hibernate查询数据库取得结果放在lis

从数据库中取得多字段的list,怎样查询出所要知道的结果?
问题这样:
  用hibernate查询数据库取得结果放在list中.
  select   code,name   from   tbl;

        现在我想根据code得到name
        例如:code=1001,name=csdn_one
                    code=1002,name=csdn_two
        当我传入code=1001时,返回csnd_one;

不知道我描述的明不明白,请指点!!多谢!


[解决办法]
我觉得只能循环比较吧

热点排行