在resin中配置数据库连接池时如果让sql server的autocommit=false
z_j 2004-08-09 09:32:24 我在resin的 resin.conf 中对sql server 作了如下的配置:
<database>
<jndi-name>jdbc/test</jndi-name>
<driver type="com.microsoft.jdbc.sqlserver.SQLServerDriver">
<url>jdbc:microsoft:sqlserver://server:1433;DatabaseName=test</url>
<user>sa</user>
<password>123</password>
</driver>
</database>
在servlet中用如下程序得到数据库连接:
Context env = (Context) new InitialContext().lookup("java:comp/env");
_pool = (DataSource) env.lookup("jdbc/test");
con = _pool.getConnection();
这样得到的 con 的 autocommit=true, 如果才能让autocommit 缺省就是false