I have a working programm with MySQL, Spring and a tomcat server, but the database connection is in spring-database.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="baseController" class="com.afterguard.sailplanner.controller.BaseController">
<property name="dao" ref="daoImpl" />
</bean>
<bean id="daoImpl" class="com.afterguard.sailplanner.dao.DaoImpl">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/sailplanner" />
<property name="username" value="sailplanner" />
<property name="password" value="sailplanner2" />
</bean>
</beans>
In order to deploy this program on a server now, I would need bring this database connection to the server, e.g. the context.xml oder server.xml.
How do I do I setup my tomcat 7 server to connect to the database and tell my application, that the database connection is setup in the tomcat?