Tomcat 配置数据源

<Resource name="jdbc/PUBLICDB" auth="Container" type="javax.sql.DataSource"
		maxIdle="30" maxWait="10000" maxActive="10" username="root" 

password="1111"  
		 validationQuery="select 1+1" testOnBorrow="true"  testOnReturn="true" testWhileIdle="true" 
		

driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://192.168..1:3306/publicdb?

useUnicode=true&amp;characterEncoding=GBK&amp;autoReconnect=true&amp;autoReconnectForPools=true">
	</Resource>

 

 

以上是mysql

 

以下是sql server

 

<Resource auth="Container" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
		maxActive="10" maxIdle="30" maxWait="10000" name="jdbc/Infodb"
		password="sa" testOnBorrow="true" testOnReturn="true" testWhileIdle="true"
		type="javax.sql.DataSource"
		url="jdbc:sqlserver://192.168.1.1:1433;databaseName=mydb"
		username="sa" validationQuery="select 1+1">

 

你可能感兴趣的:(tomcat)