Continued
To delete the Hibernate configuration file:
To add the relevant configuration for the database operation in Applicationcontext.xml:
<!--configuration database connection pool--
<bean id= "DataSource" class= "Com.mchange.v2.c3p0.ComboPooledDataSource" >
<property name= "Driverclass" value= "Com.mysql.jdbc.Driver"/>
<property name= "Jdbcurl" value= "jdbc:mysql://localhost:3306/spring"/>
<property name= "User" value= "root"/>
<property name= "Password" value= "root"/>
<!--The maximum number of connections in the connection pool--
<property name= "maxpoolsize" value= "/>"
<!--the minimum number of connections in the connection pool--
<property name= "Minpoolsize" value= "1" ></property>
<!--the number of connections in the connection pool is initialized, and the value is between Minpoolsize and Maxpoolsize, Default:3
<property name= "Initialpoolsize" value= "ten"/>
<!--maximum idle time, the connection is discarded if it is not used in 60s, and will never be discarded if it is 0. default:0
<property name= "maxidletime" value= "/>"
<!--How many connections are created at a time when the number of connections is not enough
<property name= "Acquireincrement" value= "5"/>
<!--check all the space connections in the connection pool every 60s, if not used, is discarded, default:0--
<property name= "idleconnectiontestperiod" value= "/>"
</bean>
<!--hibernate c3p0 sessionfactory--
<bean id= "Sessionfactory"
class= "Org.springframework.orm.hibernate4.LocalSessionFactoryBean" >
<!--database Connection pool configuration--
<property name= "DataSource" ref= "DataSource"/>
<!--Configure Hibernate Properties--
<property name= "Hibernateproperties" >
<props>
<prop key= "Hibernate.show_sql" >true</prop>
<prop key= "Hibernate.dialect" >org.hibernate.dialect.MySQLDialect</prop>
<!--generate table structure based on the entity's mapping file-
<prop key= "Hibernate.hbm2ddl.auto" >update</prop>
<!--formatted SQL--
<prop key= "Hibernate.format_sql" >false</prop>
</props>
</property>
<!--introduce a mapping file--
<property name= "Mappingresources" >
<list>
<value>com/buslines/domain/Admin.hbm.xml</value>
</list>
</property>
</bean>
Use configuration for SSH consolidation and administrator-managed cases (ii)