$B$O$8$a$^$7$F!#B?ED$H?=$7$^$9!#(B<br><br>S2 + S2Dao + SQL Server 2000 $B$G%H%i%s%6%/%7%g%s=hM}$K:$$C$F$$$^$9!#(B<br>$B2r7h:v$,$"$j$^$7$?$i$465<x$*4j$$$$$?$7$^$9!#(B<br><br>$B4D6-$O(B<br>s2-2.3.10<br>s2dao-1.0.35<br>SQL Server 2000<br>SQL Server$B$N(BJDBC$B%I%i%$%P$O!"(B<br>Microsoft SQL Server 2005 JDBC Driver$B!J(Bsqljdbc.jar$B!K(BVersion 
1.0<br><a href="http://msdn.microsoft.com/data/ref/jdbc/">http://msdn.microsoft.com/data/ref/jdbc/</a><br>$B$r;HMQ$7$F$$$^$9!#(B<br><br>$B>e5-4D6-$K$F!"(B<br>Seasar$B$N%H%i%s%6%/%7%g%s!J(Bj2ee.requiredTx$B!K$r$&$^$/E,MQ$G$-$^$;$s$G$7$?!#(B<br><br>$BFbMF$H$7$F$O!"%F%9%HE*$KF1$8%F!<%V%k$KO"B3$GF1$8%G!<%?$rA^F~$7$F(B
<br><br>PRIMARY KEY $B0cH?(B $B"*(B $B%m!<%k%P%C%/(B $B"*(B $B%G!<%?;D$i$J$$(B<br><br>$B$H$$$&$h$&$J$b$N$G!"(B<br>$B%m%0>e$O!V%H%i%s%6%/%7%g%s$r%m!<%k%P%C%/$7$^$7$?!W$H=P$k$N$G$9$,!"(B<br>DB$B>e$K$O%G!<%?$,;D$C$F$7$^$$$^$9!#(B<br><br>$B%3!<%I$O0J2<$N$h$&$K$J$C$F$*$j$^$9!#(B<br><br>//////////////////////////////////////////////////<br><br>@S2Dao(bean=
User.class)<br>public interface UserDao {<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; int insert(User user);<br>&nbsp;&nbsp;&nbsp; int update(User user);<br>&nbsp;&nbsp;&nbsp; int delete(User user);<br>&nbsp;&nbsp;&nbsp; List&lt;User&gt; getAll();<br>&nbsp;&nbsp;&nbsp; List&lt;User&gt; getUser(User user);<br>
}<br><br>public interface TransactTestClient {<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; void add();<br><br>}<br><br>public class TransactTestClientImpl implements TransactTestClient {<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; private UserDao userDao;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public TransactTestClientImpl(UserDao userDao) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.userDao = userDao;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public void add() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User user = new User();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user.setName(&quot;testName&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user.setPassword(&quot;testPass&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
user.setFullname(&quot;testFullName&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userDao.insert(user);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // $B!z(B $B"-$3$3$G=EJ#H/@8(B $B",$3$l(B(1$B7oL\(B)$B$,%m!<%k%P%C%/$5$l$k$h$&$K$7$?$$(B $B!z(B<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userDao.insert(user);<br><br>&nbsp;&nbsp;&nbsp; }<br><br>}<br><br>public class TransactTestMain {
<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; private static String PATH = &quot;tranClient.dicon&quot;;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S2Container container = S2ContainerFactory.create(PATH);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
container.init();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TransactTestClient cl = <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (TransactTestClient) container.getComponent(TransactTestClient.class);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cl.add();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } finally {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
container.destroy();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>}<br><br>/// tranClient.dicon /////////////////////////////<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE components PUBLIC &quot;-//SEASAR//DTD S2Container 
2.3//EN&quot;<br>&nbsp;&nbsp;&nbsp; &quot;<a href="http://www.seasar.org/dtd/components23.dtd">http://www.seasar.org/dtd/components23.dtd</a>&quot;&gt;<br>&lt;components&gt;<br>&nbsp;&nbsp;&nbsp; &lt;include path=&quot;tranDao.dicon&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;include path=&quot;
j2ee.dicon&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;component class=&quot;XXX.TransactTestClientImpl&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg&gt;UserDao&lt;/arg&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;aspect&gt;j2ee.requiredTx&lt;/aspect&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/component&gt;<br>&lt;/components&gt;
<br><br>/// tranDao.dicon ////////////////////////////////<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE components PUBLIC &quot;-//SEASAR//DTD S2Container 2.3//EN&quot;<br>&nbsp;&nbsp;&nbsp; &quot;
<a href="http://www.seasar.org/dtd/components23.dtd">http://www.seasar.org/dtd/components23.dtd</a>&quot;&gt;<br>&lt;components&gt;<br>&nbsp;&nbsp;&nbsp; &lt;include path=&quot;dao.dicon&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;component name=&quot;UserDao&quot; class=&quot;
XXX.UserDao&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;aspect&gt;dao.interceptor&lt;/aspect&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/component&gt;<br>&lt;/components&gt;<br><br>/// $B%G!<%?%Y!<%9@_Dj!JH4?h!K(B /////////////////////<br><br>&lt;component name=&quot;xaDataSource&quot;
<br>&nbsp;&nbsp;&nbsp; class=&quot;org.seasar.extension.dbcp.impl.XADataSourceImpl&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;driverClassName&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;<br>&nbsp;&nbsp;&nbsp; &lt;/property&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;URL&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;jdbc:sqlserver://IP:Port;DatabaseName=DbName;SelectMethod=cursor&quot;<br>&nbsp;&nbsp;&nbsp; &lt;/property&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;user&quot;&gt;&quot;xxx&quot;&lt;/property&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;password&quot;&gt;&quot;xxx&quot;&lt;/property&gt;<br>&lt;/component&gt;<br><br>&lt;component name=&quot;connectionPool&quot;<br>&nbsp;&nbsp;&nbsp; class=&quot;org.seasar.extension.dbcp.impl.ConnectionPoolImpl
&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;timeout&quot;&gt;600&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;maxPoolSize&quot;&gt;3&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;allowLocalTx&quot;&gt;true&lt;/property&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;destroyMethod name=&quot;close&quot;/&gt;<br>&lt;/component&gt;<br><br>&lt;component name=&quot;dataSource&quot;<br>&nbsp;&nbsp;&nbsp; class=&quot;org.seasar.extension.dbcp.impl.DataSourceImpl&quot;/&gt;<br><br>/// $B%m%0(B /////////////////////////////////////////
<br><br>[main] $B%H%i%s%6%/%7%g%s$r3+;O$7$^$7$?(B<br>[main] $BJ*M}E*$J%3%M%/%7%g%s$r<hF@$7$^$7$?(B<br>[main] $BO@M}E*$J%3%M%/%7%g%s$r<hF@$7$^$7$?(B<br>[main] $BO@M}E*$J%3%M%/%7%g%s$rJD$8$^$7$?(B<br>[main] $BO@M}E*$J%3%M%/%7%g%s$r<hF@$7$^$7$?(B<br>[main] INSERT INTO USERS (password, fullname, name) VALUES ('testPass', 'testFullName', 'testName')
<br>[main] $BO@M}E*$J%3%M%/%7%g%s$rJD$8$^$7$?(B<br>[main] $BO@M}E*$J%3%M%/%7%g%s$r<hF@$7$^$7$?(B<br>[main] INSERT INTO USERS (password, fullname, name) VALUES ('testPass', 'testFullName', 'testName')<br>[main] $BO@M}E*$J%3%M%/%7%g%s$rJD$8$^$7$?(B<br>[main] $B%H%i%s%6%/%7%g%s$r%m!<%k%P%C%/$7$^$7$?(B<br>[main] $BJ*M}E*$J%3%M%/%7%g%s$rJD$8$^$7$?(B
<br><br>//////////////////////////////////////////////////<br><br>$B2?$+@_Dj$,B-$j$J$$!&4V0c$C$F$$$kEy$"$j$^$9$G$7$g$&$+!)(B<br><br>$B%"%I%P%$%9!"$h$m$7$/$*4j$$$$$?$7$^$9!#(B<br>