在conf/server.xml中添加如下代码:(《/host》前)
- <Context path="/hibernate" docBase="E:\programming\java\eclipse_workplace2\hibernate\WebRoot" debug="0" reloadable="true" crossContext="true">
- <Resource name="jdbc/hibernate" auth="Container" type="javax.sql.DataSource"/>
- <ResourceParams name="jdbc/hibernate">
- <parameter>
- <name>factoryname>
- <value>org.apache.commons.dbcp.BasicDataSourceFactoryvalue>
- parameter>
- <parameter>
- <name>driverClassNamename>
- <value>net.sourceforge.jtds.jdbc.Drivervalue>
- parameter>
- <parameter>
- <name>urlname>
- <value>jdbc:jtds:sqlserver://localhost:1433/testvalue>
- parameter>
- <parameter>
- <name>usernamename>
- <value>savalue>
- parameter>
- <parameter>
- <name>passwordname>
- <value>savalue>
- parameter>
- <parameter>
- <name>maxActivename>
- <value>20value>
- parameter>
- <parameter>
- <name>maxIdlename>
- <value>10value>
- parameter>
- <parameter>
- <name>maxWaitname>
- <value>-1value>
- parameter>
- ResourceParams>
- Context>