- jdbca.dicon
- jdbcb.dicon
- s2jdbca.dicon
- s2jdbcb.dicon
まずは、デフォルトで用意されているs2jdbc.diconを以下のように編集
<components>
<include path="s2jdbca.dicon"/>
<include path="s2jdbcb.dicon"/>
</components>
<components namespace="s2jdbcA">
<include path="jdbca.dicon"/>
<include path="s2jdbc-internal.dicon"/>
<component name="jdbcManagerA" class="org.seasar.extension.jdbc.manager.JdbcManagerImpl">
<property name="maxRows">0</property>
<property name="fetchSize">0</property>
<property name="queryTimeout">0</property>
<property name="dialect">mysqlDialect</property>
<property name="dataSource">DataSource</property>
</component>
</components></code></p></div>
<components namespace="s2jdbcB">
<include path="jdbcb.dicon"/>
<include path="s2jdbc-internal.dicon"/>
<component name="jdbcManagerB" class="org.seasar.extension.jdbc.manager.JdbcManagerImpl">
<property name="maxRows">0</property>
<property name="fetchSize">0</property>
<property name="queryTimeout">0</property>
<property name="dialect">mysqlDialect</property>
<property name="dataSource">DataSource</property>
</component>
</components>
<components namespace="jdbc">
<include path="jta.dicon"/>
<component name="xaDataSource"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">"org.h2.Driver"</property>
<property name="URL">
"jdbc:h2:tcp://localhost:8082/test"
</property>
<property name="user">"sa"</property>
<property name="password">""</property>
<destroyMethod>
@org.seasar.framework.util.DriverManagerUtil@deregisterAllDrivers()
</destroyMethod>
</component>
<component name="connectionPool"
class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
<property name="timeout">600</property>
<property name="maxPoolSize">10</property>
<property name="allowLocalTx">true</property>
<destroyMethod name="close"/>
</component>
<component name="DataSource" class="org.seasar.extension.dbcp.impl.DataSourceImpl"/>
</components>
<components namespace="jdbc">
<include path="jta.dicon"/>
<component name="xaDataSource"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">
"com.mysql.jdbc.Driver"
</property>
<property name="URL">
"jdbc:mysql://localhost:3306/clontalk03?useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull"
</property>
<property name="user">"root"</property>
<property name="password">""</property>
</component>
<component name="connectionPool"
class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
<property name="timeout">600</property>
<property name="maxPoolSize">10</property>
<property name="allowLocalTx">true</property>
<destroyMethod name="close"/>
</component>
<component name="DataSource"
class="org.seasar.extension.dbcp.impl.DataSourceImpl"
/>
</components>
上記設定が完了すれば。
下記のように@BindingでインジェクションしたいJdbcManagerを選択すればオッケー!
@Binding("jdbcManagerA")
private JdbcManager h2JdbcManager;
@Binding("jdbcManagerB")
private JdbcManager mySqlJdbcManagerB;
0 コメント:
コメントを投稿