关系管理系统:CustomerDaoimpl中获取总记录数getTotalrecord()
生活随笔
收集整理的這篇文章主要介紹了
关系管理系统:CustomerDaoimpl中获取总记录数getTotalrecord()
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
//得到總記錄數(shù)public int getTotalrecord(){Connection conn = null;PreparedStatement st = null;ResultSet rs = null;try{conn = JdbcUtils.getConnection();String sql = "select count(*) from customer";st = conn.prepareStatement(sql);rs = st.executeQuery();if(rs.next()){return rs.getInt(1);}return 0;}catch (Exception e) {throw new DaoException(e);}finally{JdbcUtils.release(conn, st, rs);}}
?
轉(zhuǎn)載于:https://www.cnblogs.com/lichone2010/p/3175874.html
總結(jié)
以上是生活随笔為你收集整理的关系管理系统:CustomerDaoimpl中获取总记录数getTotalrecord()的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】 UML类图关系(泛化 、继承、实
- 下一篇: 前端性能优化:使用Data URI代替图