当前位置:开发者网络 >> 技术教程 >> JSP教程 >> 数据库相关 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
JBoss配置mysql数据源
作者:未知
日期:2005-02-22
人气:
投稿:snow(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:
编写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下


相关文章: