could not complete schema update

<!--定义与数据库相关的数据源  -->
	<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="sun.jdbc.odbc.JdbcOdbcDriver" />
		<property name="url" value="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=e:/stu.mdb" />
		 <property name="username" value=""></property>
         <property name="password" value=""></property>
         <property name="maxActive" value="100"></property>
         <property name="maxIdle"  value="30"></property>
         <property name="maxWait" value="500"></property>
         <property name="defaultAutoCommit" value="true"></property>         
	</bean>
	<!--定义与数据库相关的数据源  -
			<property name="url" value="jdbc:access:///e:/stu.mdb" />
	
	<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
		<property name="url" value="jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=edu" />
		<property name="username" value="test" />
		<property name="password" value="test" />
	</bean>
	-->
    <!--将数据源注入到会话工厂的dataSource属性中  -->
	<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		
		<!-- 设置自动扫描pojo所在的包 -->
		 <property name="mappingResources">

		 		<list>
				<!-- <value>hbm/Student.hbm.xml</value>
				<value>hbm/Clss.hbm.xml</value>				
				<value>hbm/TESTABCD.hbm.xml</value>	 -->
				<value>hbm/BJB.hbm.xml</value>	
				<value>hbm/GGXXB.hbm.xml</value>	
				<value>hbm/GLYB.hbm.xml</value>	
				<value>hbm/JSB.hbm.xml</value>	
				<value>hbm/LDXSB.hbm.xml</value>	
				<value>hbm/MBDAB.hbm.xml</value>	
				<value>hbm/MMWTB.hbm.xml</value>	
				<value>hbm/XSB.hbm.xml</value>	
				<value>hbm/XZJGB.hbm.xml</value>	
				<value>hbm/YXB.hbm.xml</value>	
				<value>hbm/YZB.hbm.xml</value>	
				<value>hbm/DSB.hbm.xml</value>	
				<!-- value>
					classpath*:/hbm/*.hbm.xml
				</value> -->			
		</list>	
		</property>		
		<property name="hibernateProperties">
			<!--<props>
				<prop key="hibernate.dialect">
					${hibernate.dialect}
				</prop>
				<prop key="show_sql">${hibernate.show_sql}</prop>
			</props>					
		   -->
		<value>
		    hibernate.dialect=org.hibernate.dialect.SQLServerDialect
	        hibernate.hbm2ddl.auto=update
	        hibernate.show_sql=true
	        hibernate.format_sql=false
		</value>
		</property>	
	</bean>
	<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">	
		<property name="sessionFactory" ref="sessionFactory"></property>
	</bean>


hibernate.hbm2ddl.auto=update

看到上面的这句话了么 程序在初始化sessionfactory的时候 会去检查更新表结构 如果配置和自己表结构不一样的话 就会报错!

 

你可能感兴趣的:(could not complete schema update)