jboss环境安装jivejdon的时候,怎么样设置数据源?

08-09-01 xrmeng
我的mysql-ds.xml如下:

<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: mysql-ds.xml 71535 2008-04-01 07:05:03Z adrian@jboss.org $ -->

<!-- Datasource config for MySQL using 3.0.9 available from:

http://www.mysql.com/downloads/api-jdbc-stable.html

-->

<datasources>

<local-tx-datasource>

<jndi-name>maojin168</jndi-name>

<connection-url>jdbc:mysql://127.0.0.1:3306/maojin168</connection-url>

<driver-class>com.mysql.jdbc.Driver</driver-class>

<user-name>root</user-name>

<password>mysqlpass</password>

<min-pool-size>20</min-pool-size>

<max-pool-size>300</max-pool-size>

<idle-timeout-minutes>0</idle-timeout-minutes>

<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>

<!-- should only be used on drivers after 3.22.1 with "ping" support

<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>

-->

<!-- sql to call when connection is created

<new-connection-sql>some arbitrary sql</new-connection-sql>

-->

<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers

<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>

-->

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

<metadata>

<type-mapping>mySQL</type-mapping>

</metadata>

</local-tx-datasource>

</datasources>

怎样才能再增加一下数据源?是再增加一个ds.xml文件,还是在这个文件里设置?

oojdon
2008-09-02 11:02
这样应该很明了吧:

<?xml version="1.0" encoding="UTF-8"?>

<datasources> 
  
   <local-tx-datasource>
    	<jndi-name>Security</jndi-name>
    	<connection-url>jdbc:mysql://127.0.0.1:3306/security?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>
    	<driver-class>com.mysql.jdbc.Driver</driver-class>
    	<user-name>banq</user-name>
    	<password>225034ba</password>
			<min-pool-size>3</min-pool-size>
			<max-pool-size>10</max-pool-size>    
			<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>  
  </local-tx-datasource>
  
   <local-tx-datasource>
    	<jndi-name>JiveJdonDS</jndi-name>
    	<connection-url>jdbc:mysql://127.0.0.1:3306/jivejdon?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>
    	<driver-class>com.mysql.jdbc.Driver</driver-class>
    	<user-name>banq</user-name>
    	<password>225034ba</password>
			<min-pool-size>5</min-pool-size>
			<max-pool-size>20</max-pool-size>    
			<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>   
  </local-tx-datasource> 
  
 
  <local-tx-datasource>
    	<jndi-name>TestDS</jndi-name>
    	<connection-url>jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>
    	<driver-class>com.mysql.jdbc.Driver</driver-class>
    	<user-name>banq</user-name>
    	<password>225034ba</password>
			<min-pool-size>5</min-pool-size>
			<max-pool-size>20</max-pool-size>    
			<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>   
  </local-tx-datasource>  
   
    
  <local-tx-datasource>
    	<jndi-name>SecurityOfEconomic</jndi-name>
    	<connection-url>jdbc:mysql://127.0.0.1:3306/economic_security?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>
    	<driver-class>com.mysql.jdbc.Driver</driver-class>
    	<user-name>banq</user-name>
    	<password>225034ba</password>
			<min-pool-size>3</min-pool-size>
			<max-pool-size>10</max-pool-size>    
			<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>  
  </local-tx-datasource>
  
   <local-tx-datasource>
    	<jndi-name>Economic</jndi-name>
    	<connection-url>jdbc:mysql://127.0.0.1:3306/economic?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>
    	<driver-class>com.mysql.jdbc.Driver</driver-class>
    	<user-name>banq</user-name>
    	<password>225034ba</password>
			<min-pool-size>5</min-pool-size>
			<max-pool-size>20</max-pool-size>    
			<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>   
  </local-tx-datasource> 
  
</datasources>

<p>

[该贴被oojdon于2008-09-02 11:03修改过]

xrmeng
2008-09-02 12:30
谢谢..

jivejdon3.1的里文档有一个mysql-ds.xml,我没注意...

猜你喜欢