首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

JNDI tomcat6 配备Mysql的数据池

2012-10-17 
JNDI tomcat6 配置Mysql的数据池在Tomcat 6.0\conf\context.xml中?xml version1.0 encodingutf-8?

JNDI tomcat6 配置Mysql的数据池

在Tomcat 6.0\conf\context.xml中

<?xml version='1.0' encoding='utf-8'?>

<Context>

?? ?<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource

?name="jdbc/exam"

?auth="Container"

?type="javax.sql.DataSource"?

driverClassName="com.mysql.jdbc.Driver"

?maxIdle="2"

?maxWait="5000"?

url="jdbc:mysql://localhost:3306/exam?useUnicode=true&amp;characterEncoding=gbk"

?username="root"

?password="root"

?maxActive="20" />?

</Context>

---------------------------------------------

&amp;??&?的转义字符

在xml文件中写成:

url="jdbc:mysql://localhost:3306/exam?useUnicode=true&amp;characterEncoding=gbk"

在java类中写成:

url="jdbc:mysql://localhost:3306/exam?useUnicode=true&characterEncoding=gbk"

热点排行