JBoss配置mysql數據源

- 中國WEB開發者網絡 (http://www.webasp.net)
-- 技術教程 (http://www.webasp.net/article/)
--- JBoss配置mysql數據源 (http://www.webasp.net/article/17/16583.htm)
-- 作者:未知
-- 發佈日期: 2005-02-22
編寫mysql-ds.xml並放在server/default/deploy(如果使用default作為server的話)

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

<!-- $Id: mysql-ds.xml,v 1.3 2004/09/15 14:37:40 loubyansky Exp $ -->
<!-- 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>MySqlDSForum</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/dbname</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>xxx</user-name>
<password>xxx</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>30</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>

</datasources>

同時確保mysql的驅動在classpath上或者在server/lib下



webasp.net