日期:2014-05-20 浏览次数:20849 次
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"> </property> <property name="url" value="jdbc:microsoft:sqlserver://localhost:1433"> </property> <property name="username" value="sa"></property> <property name="password" value="sa"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.SQLServerDialect </prop> </props> </property> <property name="mappingResources"> <list> <value>cn/tpexam/model/Tpexamtmp.hbm.xml</value> </property> </bean>
try { this.getHibernateTemplate().deleteAll(list); return true; } catch (RuntimeException e) { logger.error("deleteAll entity err:" , e); throw e; }