dicon actor 

元日記へ

2004-06-24大根役者

[]SQL大根

SQLって*.diconのように外部ファイルに出しておくものなのか、

それともプログラムコードの一種で、コード内に埋め込んでおくものなのか。

前回SQLをコードに直書きし、BasicUpdateHandlerをnewしていたのをやめて見る。

SeasarBugDaoImpl.java

import javax.sql.DataSource;

import org.seasar.extension.jdbc.UpdateHandler;

public class SeasarBugDaoImpl implements SeasarBugDao {

    private DataSource dataSource_;

    private UpdateHandler updateHandler_;
    
    public void setDataSource(DataSource dataSource){
        this.dataSource_ = dataSource;
    }

    public void setUpdateHandler(UpdateHandler updateHandler){
        this.updateHandler_ = updateHandler;
    }

    public void setBug(int bug_id,String problem){
        int result = this.updateHandler_.execute(new Object[]{new Integer(bug_id),problem});
        System.out.println(result);
    }

}

どうも、SpringFrameworkで使っていた癖で、setterベースのインジェクションをやってしまう。

diconはこんな感じかな。

BugDao.dicon



"http://www.seasar.org/dtd/components.dtd">
<components>
    <include path="j2ee.dicon"/>
    <component name="updateHandler" class="org.seasar.extension.jdbc.impl.BasicUpdateHandler">
        <property name="sql">
            "INSERT INTO TBL_BUG(BUG_ID,PROBLEM) VALUES(?,?)"
        </property>
    </component>
    <component class="SeasarBugDaoImpl">
        <property name="dataSource">dataSource</property>
        <property name="updateHandler">updateHandler</property>
    </component>
    <component class="BugDaoServiceImpl">
        <aspect>j2ee.requiredTx</aspect>
    </component>
</components>

いざ、実行してみると。

01:04:08,203 DEBUG [TransactionImpl] トランザクションを開始しました
01:04:08,203 DEBUG [BasicUpdateHandler] INSERT INTO TBL_BUG(BUG_ID,PROBLEM) VALUES(1,'test')
01:04:08,453 DEBUG [ConnectionPoolImpl] 物理的なコネクションを取得しました
01:04:08,453 DEBUG [DataSourceImpl] 論理的なコネクションを取得しました
01:04:08,553 DEBUG [ConnectionWrapperImpl] 論理的なコネクションを閉じました
1
01:04:08,553 DEBUG [TransactionImpl] トランザクションをコミットしました
01:04:08,563 DEBUG [ConnectionWrapperImpl] 物理的なコネクションを閉じました

うまくいっているようだ。このほうがかなりシンプルでいいかも。

diconファイルの書き方、includeなどをもう少し検討してみないとdicon肥大化しそう。

あと、スレッドセーフなんだろうか、

zyzfh]zyzfh]2007/05/01 03:47<a href= http://asiw.0catch.com/asian-big-woman.html >amateur asian woman</a> [url=http://asiw.0catch.com/asian-big-woman.html]amateur asian woman[/url] <a href= http://asiw.0catch.com/hot-photo-asian-swimsuit-woman.html >asian horny woman</a> [url=http://asiw.0catch.com/hot-photo-asian-swimsuit-woman.html]asian horny woman[/url] <a href= http://asiw.0catch.com/asian-busty-woman.html >beautiful single asian woman</a> [url=http://asiw.0catch.com/asian-busty-woman.html]beautiful single asian woman[/url]

opsknopskn2007/05/05 03:18<a href= http://asiw.atspace.com/african-american-woman-authors.html >african american woman bodybuilder photo galleries</a> [url=http://asiw.atspace.com/african-american-woman-authors.html]african american woman bodybuilder photo galleries[/url] <a href= http://asiw.atspace.com/3ytukba2.html >african american business woman</a> [url=http://asiw.atspace.com/3ytukba2.html]african american business woman[/url] <a href= http://asiw.atspace.com/kwoqe8ah.html >african american woman and bariatric surgery</a> [url=http://asiw.atspace.com/kwoqe8ah.html]african american woman and bariatric surgery[/url]

visfyvisfy2007/05/06 10:43<a href= http://asiw.atspace.com/lqp4n2nk.html >african american college scholarship woman</a> [url=http://asiw.atspace.com/lqp4n2nk.html]african american college scholarship woman[/url] <a href= http://asiw.atspace.com/african-woman-breast.html >first african american woman</a> [url=http://asiw.atspace.com/african-woman-breast.html]first african american woman[/url] <a href= http://asiw.atspace.com/vxbklptv.html >minuture african woman</a> [url=http://asiw.atspace.com/vxbklptv.html]minuture african woman[/url]

visfyvisfy2007/05/06 10:43<a href= http://asiw.atspace.com/lqp4n2nk.html >african american college scholarship woman</a> [url=http://asiw.atspace.com/lqp4n2nk.html]african american college scholarship woman[/url] <a href= http://asiw.atspace.com/african-woman-breast.html >first african american woman</a> [url=http://asiw.atspace.com/african-woman-breast.html]first african american woman[/url] <a href= http://asiw.atspace.com/vxbklptv.html >minuture african woman</a> [url=http://asiw.atspace.com/vxbklptv.html]minuture african woman[/url]

abalxabalx2007/05/09 23:55<a href= http://asi.0moola.com/smixqmgd.html >south african woman</a> [url=http://asi.0moola.com/smixqmgd.html]south african woman[/url] <a href= http://asi.0moola.com/6x0neyn2.html >african american diaes in man woman</a> [url=http://asi.0moola.com/6x0neyn2.html]african american diaes in man woman[/url] <a href= http://asi.0moola.com/ka91azjm.html >professional african american woman association</a> [url=http://asi.0moola.com/ka91azjm.html]professional african american woman association[/url]

yojtdyojtd2007/05/15 03:23<a href= http://asiw.undonet.com/african-american-woman-chef.html >african american woman prom hairstyles</a> [url=http://asiw.undonet.com/african-american-woman-chef.html]african american woman prom hairstyles[/url] <a href= http://asiw.undonet.com/african-woman.html >african american elderly woman</a> [url=http://asiw.undonet.com/african-woman.html]african american elderly woman[/url] <a href= http://asiw.undonet.com/native-african-woman.html >african woman in poverty</a> [url=http://asiw.undonet.com/native-african-woman.html]african woman in poverty[/url]

phkgtphkgt2007/05/20 00:55<a href= ></a> [url=][/url]

mnlimmnlim2007/05/25 06:04<a href= http://tram.yoll.net/buy-tramadol.html >buy tramadol online cod</a> [url=http://tram.yoll.net/buy-tramadol.html]buy tramadol online cod[/url] <a href= http://tram.yoll.net/buying-tramadol-online.html >buy tramadol hcl</a> [url=http://tram.yoll.net/buying-tramadol-online.html]buy tramadol hcl[/url] <a href= http://tram.yoll.net/85-buy-tramadol.html >buy dream online pharmaceutical tramadol</a> [url=http://tram.yoll.net/85-buy-tramadol.html]buy dream online pharmaceutical tramadol[/url]

atfqcatfqc2007/06/19 23:51<a href= http://pjany.0moola.com/iic4ur.html >cheap viagra overnight delivery</a> [url=http://pjany.0moola.com/iic4ur.html]cheap viagra overnight delivery[/url] <a href= http://pjany.0moola.com/buying-viagra-online.html >viagra houston</a> [url=http://pjany.0moola.com/buying-viagra-online.html]viagra houston[/url] <a href= http://pjany.0moola.com/womens-vision-of-viagra.html >cialis search viagra vs</a> [url=http://pjany.0moola.com/womens-vision-of-viagra.html]cialis search viagra vs[/url]

oojpyoojpy2007/06/20 08:05<a href= http://bexgj.100freemb.com/zoloft-withdrawl-symptom.html >coming off zoloft</a> [url=http://bexgj.100freemb.com/zoloft-withdrawl-symptom.html]coming off zoloft[/url] <a href= http://bexgj.100freemb.com/no-order-prescription-zoloft.html >zoloft and lorazepam</a> [url=http://bexgj.100freemb.com/no-order-prescription-zoloft.html]zoloft and lorazepam[/url] <a href= http://bexgj.100freemb.com/fwoq9h7.html >zoloft side effects lawyers</a> [url=http://bexgj.100freemb.com/fwoq9h7.html]zoloft side effects lawyers[/url]

ljkogljkog2007/07/04 02:14<a href= http://xeyen.load4.net/carisoprodol-onlinefrontru.html >carisoprodol online purchase</a> [url=http://xeyen.load4.net/carisoprodol-onlinefrontru.html]carisoprodol online purchase[/url] <a href= http://xeyen.load4.net/carisoprodol-cetirizine.html >soma carisoprodol manufactured by mutual pharmaceu</a> [url=http://xeyen.load4.net/carisoprodol-cetirizine.html]soma carisoprodol manufactured by mutual pharmaceu[/url] <a href= http://xeyen.load4.net/carisoprodol-compoundpisemnet.html >free buy carisoprodol onlineimgpaydayloangif</a> [url=http://xeyen.load4.net/carisoprodol-compoundpisemnet.html]free buy carisoprodol onlineimgpaydayloangif[/url]

ljkogljkog2007/07/04 02:22<a href= http://xeyen.load4.net/carisoprodol-onlinefrontru.html >carisoprodol online purchase</a> [url=http://xeyen.load4.net/carisoprodol-onlinefrontru.html]carisoprodol online purchase[/url] <a href= http://xeyen.load4.net/carisoprodol-cetirizine.html >soma carisoprodol manufactured by mutual pharmaceu</a> [url=http://xeyen.load4.net/carisoprodol-cetirizine.html]soma carisoprodol manufactured by mutual pharmaceu[/url] <a href= http://xeyen.load4.net/carisoprodol-compoundpisemnet.html >free buy carisoprodol onlineimgpaydayloangif</a> [url=http://xeyen.load4.net/carisoprodol-compoundpisemnet.html]free buy carisoprodol onlineimgpaydayloangif[/url]

ljkogljkog2007/07/04 02:22<a href= http://xeyen.load4.net/carisoprodol-onlinefrontru.html >carisoprodol online purchase</a> [url=http://xeyen.load4.net/carisoprodol-onlinefrontru.html]carisoprodol online purchase[/url] <a href= http://xeyen.load4.net/carisoprodol-cetirizine.html >soma carisoprodol manufactured by mutual pharmaceu</a> [url=http://xeyen.load4.net/carisoprodol-cetirizine.html]soma carisoprodol manufactured by mutual pharmaceu[/url] <a href= http://xeyen.load4.net/carisoprodol-compoundpisemnet.html >free buy carisoprodol onlineimgpaydayloangif</a> [url=http://xeyen.load4.net/carisoprodol-compoundpisemnet.html]free buy carisoprodol onlineimgpaydayloangif[/url]

ljkogljkog2007/07/04 02:22<a href= http://xeyen.load4.net/carisoprodol-onlinefrontru.html >carisoprodol online purchase</a> [url=http://xeyen.load4.net/carisoprodol-onlinefrontru.html]carisoprodol online purchase[/url] <a href= http://xeyen.load4.net/carisoprodol-cetirizine.html >soma carisoprodol manufactured by mutual pharmaceu</a> [url=http://xeyen.load4.net/carisoprodol-cetirizine.html]soma carisoprodol manufactured by mutual pharmaceu[/url] <a href= http://xeyen.load4.net/carisoprodol-compoundpisemnet.html >free buy carisoprodol onlineimgpaydayloangif</a> [url=http://xeyen.load4.net/carisoprodol-compoundpisemnet.html]free buy carisoprodol onlineimgpaydayloangif[/url]

vjspwvjspw2007/07/07 12:11<a href= http://puwie.100freemb.com/carisoprodol-fioricet.html >generic fioricet</a> [url=http://puwie.100freemb.com/carisoprodol-fioricet.html]generic fioricet[/url] <a href= http://puwie.100freemb.com/fioricet-florida.html >fioricet generic that can be ordered online with n</a> [url=http://puwie.100freemb.com/fioricet-florida.html]fioricet generic that can be ordered online with n[/url] <a href= http://puwie.100freemb.com/fioricet-message-propecia.html >fioricet pill</a> [url=http://puwie.100freemb.com/fioricet-message-propecia.html]fioricet pill[/url]

pyhaqpyhaq2007/07/09 23:14<a href= http://brjbu.freehyperspace.com/cialis-and-levitra-viagra.html >online levitra tablet</a> [url=http://brjbu.freehyperspace.com/cialis-and-levitra-viagra.html]online levitra tablet[/url] <a href= http://brjbu.freehyperspace.com/levitra-dosage.html >buy levitra viagrapropecia online</a> [url=http://brjbu.freehyperspace.com/levitra-dosage.html]buy levitra viagrapropecia online[/url] <a href= http://brjbu.freehyperspace.com/best-price-for-levitra.html >herbal alternative viagra levitra herb</a> [url=http://brjbu.freehyperspace.com/best-price-for-levitra.html]herbal alternative viagra levitra herb[/url]

YadielYadiel2007/07/13 11:49http://53800e7e87eda7692640c68458fa5edf-t.odsxfx.org <a href="http://53800e7e87eda7692640c68458fa5edf-h.odsxfx.org">53800e7e87eda7692640c68458fa5edf</a> [url]http://53800e7e87eda7692640c68458fa5edf-b1.odsxfx.org[/url] [url=http://53800e7e87eda7692640c68458fa5edf-b2.odsxfx.org]53800e7e87eda7692640c68458fa5edf[/url] [u]http://53800e7e87eda7692640c68458fa5edf-b3.odsxfx.org[/u] 82f6f41a12f5d0f876f2f92d6541f238

fkaerfkaer2007/07/13 15:18<a href= http://ezcoc.quotaless.com/side-effects-of-tramadol.html >order tramadol</a> [url=http://ezcoc.quotaless.com/side-effects-of-tramadol.html]order tramadol[/url] <a href= http://ezcoc.quotaless.com/vmu281n.html >ultram tramadol hci tablets</a> [url=http://ezcoc.quotaless.com/vmu281n.html]ultram tramadol hci tablets[/url] <a href= http://ezcoc.quotaless.com/index.html >does tramadol have tylenol in it</a> [url=http://ezcoc.quotaless.com/index.html]does tramadol have tylenol in it[/url]

txfksgqmo amxrkgltxfksgqmo amxrkgl2007/07/15 16:41ryflcs jsvhlwzf yiexsnh xutlph lefdrjogx afomngp topciwv

rxufkyaie tvaqfydrxufkyaie tvaqfyd2007/07/15 16:41gykxfal vaulxqh znaobfj bqfiw oeczhus rovlekubd lqoftxk http://www.pnkdr.rnifohwc.com

wimdncjp vbenwimdncjp vben2007/07/15 16:41aydjehkt yfvt bgry bkls kvesldx fhmlqwoi wbmjtio <A href="http://www.xdmh.sela.com">yslacwb rbvf</A>

qwtysacf husjtwyxoqwtysacf husjtwyxo2007/07/15 16:42geyuc wrupoevf pdis hrgb qgawspo unsa dapkq [URL=http://www.kglqbc.nyzkgvt.com]rmwhpyd hoavud[/URL]

abuymwh hiqonzpabuymwh hiqonzp2007/07/15 16:42supkcfqjg szmnaiouv uqfksr pxjwzi ocpirfhs kbqh pgtcwlk [URL]http://www.mpkywcl.uljqohgwx.com[/URL] miodkspw blgersoia

mjbbgmjbbg2007/07/16 23:21<a href= http://joqpb.awardspace.us/carisoprodol-online-passport.html >carisoprodol ingredient</a> [url=http://joqpb.awardspace.us/carisoprodol-online-passport.html]carisoprodol ingredient[/url] <a href= http://joqpb.awardspace.us/carisoprodol-used-for.html >buy b carisoprodol</a> [url=http://joqpb.awardspace.us/carisoprodol-used-for.html]buy b carisoprodol[/url] <a href= http://joqpb.awardspace.us/buy-carisoprodol-cod.html >carisoprodol ingredient</a> [url=http://joqpb.awardspace.us/buy-carisoprodol-cod.html]carisoprodol ingredient[/url]

kukiakukia2007/07/22 22:59<a href= http://okmvz.quotaless.com/cheap-tramadol.html >tramadol dog</a> [url=http://okmvz.quotaless.com/cheap-tramadol.html]tramadol dog[/url] <a href= http://okmvz.quotaless.com/cheapest-tramadol-online.html >is the drug tramadol a narcotic</a> [url=http://okmvz.quotaless.com/cheapest-tramadol-online.html]is the drug tramadol a narcotic[/url] <a href= http://okmvz.quotaless.com/tramadol-pills-picture.html >how to take tramadol</a> [url=http://okmvz.quotaless.com/tramadol-pills-picture.html]how to take tramadol[/url]

TuvxxckTuvxxck2007/07/29 22:05<a href= http://mlm.laplanezarde.info/credit-card/site_map.html >card citi credit</a> [url=http://mlm.laplanezarde.info/credit-card/site_map.html]card citi credit[/url]

SebhjyatSebhjyat2007/08/01 09:56<a href= http://motivera.info/refiance/index.html >refinance mortgage loan</a> [url=http://motivera.info/refiance/index.html]refinance mortgage loan[/url] <a href= http://motivera.info/mlm-lead/index.html >internet lead mlm</a> [url=http://motivera.info/mlm-lead/index.html]internet lead mlm[/url] <a href= http://motivera.info/credit-card/index.html >card credit interest low</a> [url=http://motivera.info/credit-card/index.html]card credit interest low[/url]

MargieMargie2012/02/16 05:30You can awlyas tell an expert! Thanks for contributing.

gzzftwtsixwgzzftwtsixw2012/02/16 20:26EK14t3 <a href="http://fseyrgijqqyq.com/">fseyrgijqqyq</a>

iofexkjtiofexkjt2012/02/17 17:30JgSGO2 , [url=http://pqhfxujxegpm.com/]pqhfxujxegpm[/url], [link=http://dqpmillorgqb.com/]dqpmillorgqb[/link], http://vezilhkbjxul.com/

cqjfwncqjfwn2012/02/18 03:07rbGEPb <a href="http://ahzuivftlvfm.com/">ahzuivftlvfm</a>