首页 > 其他 > 详细

PreparedStatement ResultSet

时间:2014-01-24 08:07:42      阅读:362      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
public int searchProblemDistinctCount() throws Exception {
        DBOperator dbo = getDBOperator();
        try {
            PatientproblemTableAdapter adapter = new PatientproblemTableAdapter(dbo);
            PreparedStatement st = dbo.prepareStatement("select distinct patientid from "
                    + adapter.getSchemaName() + "."
                    + adapter.getTableName() + " where status=‘active‘ and (deletedflag <> ‘1‘ or deletedflag is null)");
            ResultSet rs =st.executeQuery();
            int count=0;
            while(rs.next())
            {
                count++;
            }
            return count;
        } catch (Exception e) {
            dbo.rollback();
            throw e;
        } finally {
            dbo.close();
        }
    }
bubuko.com,布布扣

PreparedStatement ResultSet

原文:http://www.cnblogs.com/quietwalk/p/3531736.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!