数据源是在tomcat配置的
server.xml中<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" maxActive="20" maxIdel="10" maxWait="1000" name="jdbc/jtDS" password="000544" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/jt_test" username="root"/>然后我web.xml<resource-ref>
<description>DataSource</description>
<res-ref-name>jdbc/jtDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>Spring MVCMySQLJava数据库