JNDI配置数据源

1 content.xml

<Resource name="jdbc/SQLServer" auth="Container" type="javax.sql.DataSource"
maxActive ="100"
maxIdle="30"
maxWait="10000"
username="sa"
password="sa"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;DataBaseName=jdbc_test"
/>

 

2。web.xml

<resource-ref>
	<description>DBConnection</description>
	<res-ref-name>jdbc/SQLServer</res-ref-name>
	<res-type>javax.sql.DataSource</res-type>
	<res-auth>Container</res-auth>
</resource-ref>

 3 再lib中放入相应得jar包

你可能感兴趣的:(sql,xml,Web,jdbc,Microsoft)