以下语句:
1、在ibatis中有sql语句select * from archive where category=1这种用什么样的方法处理?
2、在ibatis中有select count(*) from archive where category=1这又怎么处理?
1、在ibatis中有sql语句select * from archive where category=1这种用什么样的方法处理?
2、在ibatis中有select count(*) from archive where category=1这又怎么处理?
你可以定一个javabean,里面的内容就是你archive表里面的字段名,然后resultClass=定义的javabean
这样你搜索出来的内容会映射到javabean里面
然后再logic里面用List<javabean> out = 执行sql的方法
2、在ibatis中有select count(*) from archive where category=1这又怎么处理?
返回类型时java.lang.Integer就可以了
再logic里面用Integer变量接受就可以了。
2.返回所有成一个list集合,然后list.size();
很笨的解决方案,呵呵
1、在ibatis中有sql语句select * from archive where category=#category# 传值(参数)
2、在ibatis中有select count(*) from archive where category=#category# 传值(参数)