锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品无码专区在线在线播放,久久久综合亚洲色一区二区三区 ,久久精品亚洲视频http://www.tkk7.com/heroking2000/category/6670.htmlzh-cnSat, 03 Mar 2007 09:04:15 GMTSat, 03 Mar 2007 09:04:15 GMT60涓涓畝媧佺殑鏁版嵁搴撹闂鏋?/title><link>http://www.tkk7.com/heroking2000/articles/26530.html</link><dc:creator>Hero King</dc:creator><author>Hero King</author><pubDate>Wed, 04 Jan 2006 03:15:00 GMT</pubDate><guid>http://www.tkk7.com/heroking2000/articles/26530.html</guid><wfw:comment>http://www.tkk7.com/heroking2000/comments/26530.html</wfw:comment><comments>http://www.tkk7.com/heroking2000/articles/26530.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/heroking2000/comments/commentRss/26530.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/heroking2000/services/trackbacks/26530.html</trackback:ping><description><![CDATA[<P>      綆浠嬶細(xì)璇ユ鏋跺惛鍙朓Batis璁捐鎬濇兂鍜屾柟娉曟槧灝勬満鍒訛紝緇撳悎妯″紡鍖歸厤錛屽皢鏌ヨ緇撴灉鐩存帴鏄犲皠鎴愬煙瀵硅薄妯″瀷錛屽茍鏀寔鍒嗛〉銆?BR>      浠g爜濡備笅錛?BR>package heroking.db;</P> <P>import java.util.List;<BR>import java.util.ArrayList;<BR>import java.util.regex.Pattern;<BR>import java.util.regex.Matcher;<BR>import java.sql.*;</P> <P><BR>public class GeneralDao {<BR>    private Connection connection = null;</P> <P>    public Connection getConnection() {<BR>        return connection;<BR>    }</P> <P>    public void setConnection(Connection connection) {<BR>        this.connection = connection;<BR>    }</P> <P>    /**<BR>     * 鎵ц鎻掑叆錛屾洿鏂幫紝鍒犻櫎鎿嶄綔錛岃繑鍥炲間負(fù)褰卞搷璁板綍鏁般?BR>     * @param sql<BR>     * @param parameter<BR>     */<BR>    public int executeUpdate(String sql, Object parameter) {<BR>        List result = new ArrayList();<BR>        //鎸夋ā寮忓尮閰嶈漿鎹ql璇彞<BR>        Pattern pattern = Pattern.compile("#[a-zA-Z]+#");   //妯″紡鍖歸厤<BR>        Matcher matcher = pattern.matcher(sql);<BR>        String formatSql = matcher.replaceAll("?");<BR>        //榪炴帴鏁版嵁婧?BR>        PreparedStatement st = null;<BR>        try {<BR>            st = connection.prepareStatement(formatSql);<BR>        } catch (Exception e) {<BR>            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>        }<BR>        //娣誨姞棰勫鐞嗗弬鏁?BR>        int i = 1;<BR>        while (matcher.find()) {<BR>            String field = matcher.group();<BR>            String formatField = field.substring(1, field.length() - 1);<BR>            try {<BR>                st.setObject(i++, DataBaseUtil.excuteGetMethod(formatField, parameter));<BR>            } catch (SQLException e) {<BR>                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>            }<BR>        }<BR>        try {<BR>            return st.executeUpdate();<BR>        } catch (SQLException e) {<BR>            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>        }<BR>        return 0;<BR>    }<BR>    </P> <P>    /**<BR>     * 鏌ヨ絎琾ageCount欏甸潰錛堟瘡涓〉闈㈢殑璁板綍鏁頒負(fù)pageSize錛夌殑緇撴灉<BR>     * @param sql   sql鏌ヨ<BR>     * @param parameter 鍙傛暟瀵硅薄<BR>     * @param pageSize 欏甸潰緇撴灉闆嗗ぇ灝?BR>     * @param pageCount 欏甸潰鏁?BR>     * @param resultClass 緇撴灉綾?BR>     * @return List<BR>     */<BR>    public List executeQuerys(String sql, Object parameter, int pageSize, int pageCount, Class resultClass){<BR>        List result = new ArrayList();<BR>        //鎸夋ā寮忓尮閰嶈漿鎹ql璇彞<BR>        Pattern pattern = Pattern.compile("#[a-zA-Z]+#");   //妯″紡鍖歸厤<BR>        Matcher matcher = pattern.matcher(sql);<BR>        String formatSql = matcher.replaceAll("?");<BR>        //榪炴帴鏁版嵁婧?BR>        PreparedStatement st = null;<BR>        try {<BR>            //璁劇疆棰勫鐞嗙姸鎬佸弬鏁幫紝婊氬姩錛屽彧璇匯?BR>            st = connection.prepareStatement(formatSql, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);<BR>        } catch (Exception e) {<BR>            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>        }<BR>        //娣誨姞棰勫鐞嗗弬鏁?BR>        int i = 1;<BR>        while (matcher.find()) {<BR>            String field = matcher.group();<BR>            String formatField = field.substring(1, field.length() - 1);<BR>            try {<BR>                st.setObject(i++, DataBaseUtil.excuteGetMethod(formatField, parameter));<BR>            } catch (SQLException e) {<BR>                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>            }<BR>        }<BR>        ResultSet rs = null;<BR>        try {<BR>            rs = st.executeQuery();<BR>            //鑾峰彇鎬昏褰曟暟<BR>            rs.last();<BR>            int totalCount = rs.getRow();</P> <P>            //褰撳墠欏甸潰絎竴鏉¤褰曚綅緗?BR>            int curPagePosition = (pageCount -1)*pageSize + 1;<BR>            if (totalCount < curPagePosition) {<BR>                return null;<BR>            }<BR>            rs.beforeFirst();<BR>            rs.absolute(curPagePosition);</P> <P>            //灝佽鍊煎璞?BR>            int k = 0;<BR>            ResultSetMetaData rsmd = rs.getMetaData();<BR>            int cols = rsmd.getColumnCount();<BR>            while (rs.next() && k < pageSize) {<BR>                Object o = resultClass.newInstance();<BR>                for (int j = 1; j <= cols; j++) {<BR>                    String name = rsmd.getColumnName(j);<BR>                    Object value = rs.getObject(j);//浣滈氱敤綾誨瀷澶勭悊,榪欐牱row涓殑綾誨瀷閮芥槸Object鍨嬬殑銆?BR>                    String voName = DataBaseUtil.toInValueName(name);<BR>                    DataBaseUtil.executeSetMethod(voName, value, o);<BR>                }<BR>                result.add(o);<BR>                k++;    //鑾峰彇鏁板姞1<BR>            }<BR>        } catch (SQLException e) {<BR>            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>        } catch (IllegalAccessException e) {<BR>            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>        } catch (InstantiationException e) {<BR>            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.<BR>        }<BR>        return result;<BR>    }<BR>    /**<BR>     * 鏌ヨ鎵鏈夌邯褰?BR>     * @param sql<BR>     * @param parameter<BR>     * @param resultClass<BR>     * @return List<BR>     */<BR>    public List executeQuerys(String sql, Object parameter, Class resultClass){<BR>        //榛樿涓烘墍鏈夎褰?BR>        return this.executeQuerys(sql, parameter, Integer.MAX_VALUE, 1, resultClass);<BR>    }</P> <P>    /**<BR>     * 鏌ヨ鍗曚釜璁板綍<BR>     * @param sql<BR>     * @param parameter<BR>     * @param resultClass<BR>     * @return Object<BR>     */<BR>    public Object executeQuery(String sql, Object parameter, Class resultClass){<BR>        List list = executeQuerys(sql, parameter,resultClass);<BR>        if (list == null || list.size() == 0) {<BR>            return null;<BR>        }<BR>        return list.get(0);<BR>    }<BR>}<BR></P><img src ="http://www.tkk7.com/heroking2000/aggbug/26530.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/heroking2000/" target="_blank">Hero King</a> 2006-01-04 11:15 <a href="http://www.tkk7.com/heroking2000/articles/26530.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://sjmthanks.com" target="_blank">人妖系列免费网站观看</a>| <a href="http://628669.com" target="_blank">亚洲精品理论电影在线观看</a>| <a href="http://taoh2510.com" target="_blank">黄色短视频免费看</a>| <a href="http://chuguo65.com" target="_blank">免费播放春色aⅴ视频</a>| <a href="http://22nee.com" target="_blank">久久精品国产亚洲AV电影网</a>| <a href="http://01shanzhai.com" target="_blank">久久久久亚洲av无码专区蜜芽</a>| <a href="http://345504.com" target="_blank">国产免费高清69式视频在线观看</a>| <a href="http://www999973.com" target="_blank">亚洲精品美女久久久久99小说</a>| <a href="http://8654123.com" target="_blank">美女免费视频一区二区三区</a>| <a href="http://zjtuntex.com" target="_blank">亚洲av无码成人精品区</a>| <a href="http://xww678.com" target="_blank">色噜噜综合亚洲av中文无码</a>| <a href="http://sh-lkby.com" target="_blank">少妇人妻偷人精品免费视频 </a>| <a href="http://8b22.com" target="_blank">99视频全部免费精品全部四虎</a>| <a href="http://27simnjingmiguan.com" target="_blank">免费无码A片一区二三区 </a>| <a href="http://55118885.com" target="_blank">亚洲最大福利视频网站</a>| <a href="http://zzyqr.com" target="_blank">久久精品一本到99热免费</a>| <a href="http://19b1.com" target="_blank">亚洲午夜成激人情在线影院</a>| <a href="http://3c3w.com" target="_blank">毛片基地免费视频a</a>| <a href="http://spxingyiquan.com" target="_blank">午夜亚洲WWW湿好爽</a>| <a href="http://s88s88.com" target="_blank">久久久久亚洲AV无码专区桃色</a>| <a href="http://wangdei.com" target="_blank">黄色短视频免费看</a>| <a href="http://www454yu.com" target="_blank">亚洲精品综合久久中文字幕 </a>| <a href="http://abab14.com" target="_blank">亚洲成a∨人片在无码2023</a>| <a href="http://5r7b.com" target="_blank">免费乱码中文字幕网站</a>| <a href="http://pgyadv.com" target="_blank">成人免费一区二区三区 </a>| <a href="http://df8848.com" target="_blank">国产亚洲精品AA片在线观看不加载 </a>| <a href="http://173ba.com" target="_blank">国产精品久免费的黄网站</a>| <a href="http://www988555.com" target="_blank">成年免费a级毛片</a>| <a href="http://ztsf6688.com" target="_blank">亚洲国产人成在线观看69网站</a>| <a href="http://www-13696.com" target="_blank">亚洲一区二区三区免费观看</a>| <a href="http://xy167.com" target="_blank">亚洲国产成人久久精品大牛影视</a>| <a href="http://tsxyhq.com" target="_blank">亚洲成av人在片观看</a>| <a href="http://rr433.com" target="_blank">久久99精品国产免费观看</a>| <a href="http://aicbbs.com" target="_blank">久久夜色精品国产噜噜亚洲a</a>| <a href="http://wankufan.com" target="_blank">国产一区二区三区在线免费</a>| <a href="http://ulihix.com" target="_blank">最近更新免费中文字幕大全</a>| <a href="http://w6446.com" target="_blank">亚洲一区二区三区不卡在线播放</a>| <a href="http://xmjcjc.com" target="_blank">亚洲免费观看视频</a>| <a href="http://ljdst.com" target="_blank">久久夜色精品国产噜噜亚洲a</a>| <a href="http://shrongshan.com" target="_blank">国产亚洲精久久久久久无码AV</a>| <a href="http://www998xe.com" target="_blank">日本免费xxxx色视频</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>