日期:2014-05-17  浏览次数:20835 次

spring+hibernate不能自动生成数据库表
自己看视频写的代码,就是不能生成数据库表,测试类也没报错,控制台也没报错,求解?
console:
2014-4-24 15:40:26 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1034bb5: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1034bb5]; startup date [Thu Apr 24 15:40:26 CST 2014]; root of context hierarchy
2014-4-24 15:40:27 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans.xml]
2014-4-24 15:40:27 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@1034bb5]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1c74f37
2014-4-24 15:40:28 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1c74f37: defining beans [org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,dataSource,sessionFactory,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor]; root of factory hierarchy
2014-4-24 15:40:28 org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
信息: Building new Hibernate SessionFactory
2014-4-24 15:40:30 org.springframework.orm.hibernate3.HibernateTransactionManager afterPropertiesSet
信息: Using DataSource [org.apache.commons.dbcp.BasicDataSource@15e2075] of Hibernate SessionFactory for HibernateTransactionManager

------解决方案--------------------
你登录的用户没有create table的权限
------解决方案--------------------
数据库要自己创建的吧,表可以由hibernate帮你建