<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          DbUtils數(shù)據(jù)庫查詢工具包

          聯(lián)合創(chuàng)作 · 2023-09-30 04:24

          原則上這不能說是一個(gè)持久層框架,它提供了一些Jdbc的操作封裝來簡(jiǎn)化數(shù)據(jù)查詢和記錄讀取操作。本站就是采用這個(gè)項(xiàng)目來讀寫數(shù)據(jù)庫,代碼非常簡(jiǎn)潔,如果你厭煩了Hibernate的龐大,不妨可以試試——DbUtils。

          給出一小段代碼看看DbUtils是怎么用的:

          QueryRunner run = new QueryRunner(dataSource); // Use the BeanHandler implementation to convert the first
          // ResultSet row into a Person JavaBean. ResultSetHandler h = new BeanHandler(Person.class); // Execute the SQL statement with one replacement parameter and
          // return the results in a new Person object generated by the BeanHandler. Person p = (Person) run.query("SELECT * FROM Person WHERE name=?", "John Doe", h);

          JavaDoc:http://tool.oschina.net/apidocs/apidoc?api=commons-dbutils

          本站對(duì) dbutils 做了一個(gè)改進(jìn),下載地址:http://www.oschina.net/uploads/app/commons-dbutils-1.1.fixed.jar
          主要解決了dbutils無法處理類似 SELECT userid AS id FROM osc_users 諸如此類的問題,因?yàn)?dbutils 使用的方法是 getColumnName 而不是 getColumnLabel (此問題已經(jīng)在官方的1.3版本中得以解決)。

          瀏覽 29
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  婬乱无码AV丰满熟妇 | 天天澡日日久 | 日韩a中文 | 精品久久久麻豆 | 久久一级精品视频 |