Use configuration for SSH consolidation and administrator-managed cases (ii)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.