可以在sql上做文章这里的字段是你想要的字段 select * from (select 字段1,字段2.....字段n ,rownum from table1 t1) where t1.rownum =你想要的行(eg:2) 或者:select * from (select 字段1,字段2.....字段n ,rownum from table1 t1) where t1.rownum between 1 and 2
把a,b的权限设置一个列数组, 如a的权限为column1,column2 b的权限为column1,column3 这样SQL语句可以写两种,第一种遍历该用户的权限数组,使sql最后成为 select column1,column2 from tablename; select column1,column3 from tablename;第二种就用select * from tablename, 在结果显示上判断是否包含权利里列名,包含则显示,不包含就不显示
然后不同的人对应不同的SQL语句。
会decode函数吧?
拼sql
我不知道PreparedStatement ps=conn.prepareStatement(select ? from table);这种语句能不能出现在jdbc中。
select * from (select 字段1,字段2.....字段n ,rownum from table1 t1) where t1.rownum =你想要的行(eg:2)
或者:select * from (select 字段1,字段2.....字段n ,rownum from table1 t1) where t1.rownum between 1 and 2
如a的权限为column1,column2
b的权限为column1,column3
这样SQL语句可以写两种,第一种遍历该用户的权限数组,使sql最后成为 select column1,column2 from tablename;
select column1,column3 from tablename;第二种就用select * from tablename,
在结果显示上判断是否包含权利里列名,包含则显示,不包含就不显示
------------
是怎么配置的?第几列还是字段名?
我觉得这个并不难实现,关键是你的(需求)配置抽象到什么程度